diff --git a/packages/google-cloud-gkebackup/.eslintignore b/packages/google-cloud-gkebackup/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-gkebackup/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-gkebackup/.eslintrc.json b/packages/google-cloud-gkebackup/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-gkebackup/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-gkebackup/.gitattributes b/packages/google-cloud-gkebackup/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-gkebackup/.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/packages/google-cloud-gkebackup/.github/.OwlBot.yaml b/packages/google-cloud-gkebackup/.github/.OwlBot.yaml new file mode 100644 index 00000000000..3d5a095fbae --- /dev/null +++ b/packages/google-cloud-gkebackup/.github/.OwlBot.yaml @@ -0,0 +1,22 @@ +# 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 +# +# 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. +docker: + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/gkebackup/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 diff --git a/packages/google-cloud-gkebackup/.gitignore b/packages/google-cloud-gkebackup/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-gkebackup/.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/packages/google-cloud-gkebackup/.jsdoc.js b/packages/google-cloud-gkebackup/.jsdoc.js new file mode 100644 index 00000000000..693ed3b5476 --- /dev/null +++ b/packages/google-cloud-gkebackup/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/gke-backup', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-gkebackup/.mocharc.js b/packages/google-cloud-gkebackup/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-cloud-gkebackup/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-gkebackup/.nycrc b/packages/google-cloud-gkebackup/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-gkebackup/.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 +} diff --git a/packages/google-cloud-gkebackup/.prettierignore b/packages/google-cloud-gkebackup/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-gkebackup/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-gkebackup/.prettierrc.js b/packages/google-cloud-gkebackup/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-gkebackup/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-gkebackup/.repo-metadata.json b/packages/google-cloud-gkebackup/.repo-metadata.json new file mode 100644 index 00000000000..2cd83487fd1 --- /dev/null +++ b/packages/google-cloud-gkebackup/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/gke-backup/latest", + "api_id": "gkebackup.googleapis.com", + "distribution_name": "@google-cloud/gke-backup", + "release_level": "stable", + "default_version": "v1", + "language": "nodejs", + "name_pretty": "Backup for GKE API", + "repo": "googleapis/nodejs-gke-backup", + "product_documentation": "https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke", + "requires_billing": true, + "name": "gkebackup", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559746", + "api_shortname": "gkebackup", + "library_type": "GAPIC_AUTO" + } \ No newline at end of file diff --git a/packages/google-cloud-gkebackup/CHANGELOG.md b/packages/google-cloud-gkebackup/CHANGELOG.md new file mode 100644 index 00000000000..4708a7bde01 --- /dev/null +++ b/packages/google-cloud-gkebackup/CHANGELOG.md @@ -0,0 +1,32 @@ +# Changelog + +## [0.2.2](https://github.com/googleapis/nodejs-gke-backup/compare/v0.2.1...v0.2.2) (2022-11-11) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#27](https://github.com/googleapis/nodejs-gke-backup/issues/27)) ([9fe267c](https://github.com/googleapis/nodejs-gke-backup/commit/9fe267cbad703730c43dc039b36dfc17184c518b)) +* Regenerated protos JS and TS definitions ([#31](https://github.com/googleapis/nodejs-gke-backup/issues/31)) ([bb11ae0](https://github.com/googleapis/nodejs-gke-backup/commit/bb11ae024de98de8ac530c9746eaa00705318de6)) + +## [0.2.1](https://github.com/googleapis/nodejs-gke-backup/compare/v0.2.0...v0.2.1) (2022-10-06) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#19](https://github.com/googleapis/nodejs-gke-backup/issues/19)) ([be50ca6](https://github.com/googleapis/nodejs-gke-backup/commit/be50ca6ffad150c2a01d278bed2a6c0b3c5bb25c)) +* Better support for fallback mode ([#15](https://github.com/googleapis/nodejs-gke-backup/issues/15)) ([97bc598](https://github.com/googleapis/nodejs-gke-backup/commit/97bc5987b3273be24009cf2057208e602284e298)) +* Change import long to require ([#16](https://github.com/googleapis/nodejs-gke-backup/issues/16)) ([954a348](https://github.com/googleapis/nodejs-gke-backup/commit/954a3488b822fb4f6f6eab0ac89a0dd12aa44b2c)) +* **deps:** Update dependency google-gax to v3 ([#11](https://github.com/googleapis/nodejs-gke-backup/issues/11)) ([f4ac21d](https://github.com/googleapis/nodejs-gke-backup/commit/f4ac21d3ade5906714f971fa9c1de935995776e9)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-gke-backup/issues/1553)) ([#18](https://github.com/googleapis/nodejs-gke-backup/issues/18)) ([6c6b272](https://github.com/googleapis/nodejs-gke-backup/commit/6c6b272e2a7732ef73326beb40f44f84544a5362)) +* Preserve default values in x-goog-request-params header ([#20](https://github.com/googleapis/nodejs-gke-backup/issues/20)) ([46e4b70](https://github.com/googleapis/nodejs-gke-backup/commit/46e4b70f6e6f5fa29d9c7351022d8ac936062c01)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-gke-backup/issues/1546)) ([#17](https://github.com/googleapis/nodejs-gke-backup/issues/17)) ([ccd066b](https://github.com/googleapis/nodejs-gke-backup/commit/ccd066b358ea6903af72016d3f0c65ecca2bba95)) +* use google-gax v3.3.0 ([6c6b272](https://github.com/googleapis/nodejs-gke-backup/commit/6c6b272e2a7732ef73326beb40f44f84544a5362)) + +## 0.2.0 (2022-06-28) + + +### Features + +* add initial samples and tests ([a1d643f](https://github.com/googleapis/nodejs-gke-backup/commit/a1d643f73f9b59711cfce570873f56485906a9a9)) +* add templated files from docker image ([d93ad51](https://github.com/googleapis/nodejs-gke-backup/commit/d93ad515762a761909e8953ada069fc0291f9a80)) +* initial stub of library ([7d10d2e](https://github.com/googleapis/nodejs-gke-backup/commit/7d10d2ea8fa14ff6f5e37a8fc4aa17132ebea831)) diff --git a/packages/google-cloud-gkebackup/CODE_OF_CONDUCT.md b/packages/google-cloud-gkebackup/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-gkebackup/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/packages/google-cloud-gkebackup/CONTRIBUTING.md b/packages/google-cloud-gkebackup/CONTRIBUTING.md new file mode 100644 index 00000000000..4b17155dc23 --- /dev/null +++ b/packages/google-cloud-gkebackup/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 Backup for GKE API 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=gkebackup.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-gkebackup/LICENSE b/packages/google-cloud-gkebackup/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-gkebackup/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/packages/google-cloud-gkebackup/README.md b/packages/google-cloud-gkebackup/README.md new file mode 100644 index 00000000000..1da739b1b48 --- /dev/null +++ b/packages/google-cloud-gkebackup/README.md @@ -0,0 +1,126 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Backup for GKE API: Node.js Client](https://github.com/googleapis/nodejs-gke-backup) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/gke-backup.svg)](https://www.npmjs.org/package/@google-cloud/gke-backup) + + + + +gkebackup client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-gke-backup/blob/main/CHANGELOG.md). + +* [Backup for GKE API Node.js Client API Reference][client-docs] +* [Backup for GKE API Documentation][product-docs] +* [github.com/googleapis/nodejs-gke-backup](https://github.com/googleapis/nodejs-gke-backup) + +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 for GKE API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/gke-backup +``` + + + + + +The [Backup for GKE API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +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/gke-backup@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +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. + + + + + + +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/nodejs-gke-backup/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-gke-backup/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/gke-backup/latest +[product-docs]: https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke +[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=gkebackup.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-gkebackup/linkinator.config.json b/packages/google-cloud-gkebackup/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-gkebackup/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-gkebackup/package.json b/packages/google-cloud-gkebackup/package.json new file mode 100644 index 00000000000..cf58e62e867 --- /dev/null +++ b/packages/google-cloud-gkebackup/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/gke-backup", + "version": "0.2.2", + "description": "gkebackup client for Node.js", + "repository": "googleapis/nodejs-gke-backup", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google gkebackup", + "gkebackup", + "gkebackup service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^10.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.2.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=v12.0.0" + } +} diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup.proto new file mode 100644 index 00000000000..5e8193b75ea --- /dev/null +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup.proto @@ -0,0 +1,219 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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.gkebackup.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gkebackup/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.GkeBackup.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/gkebackup/v1;gkebackup"; +option java_multiple_files = true; +option java_outer_classname = "BackupProto"; +option java_package = "com.google.cloud.gkebackup.v1"; +option php_namespace = "Google\\Cloud\\GkeBackup\\V1"; +option ruby_package = "Google::Cloud::GkeBackup::V1"; + +// Represents a request to perform a single point-in-time capture of +// some portion of the state of a GKE cluster, the record of the backup +// operation itself, and an anchor for the underlying artifacts that +// comprise the Backup (the config backup and VolumeBackups). +// Next id: 28 +message Backup { + option (google.api.resource) = { + type: "gkebackup.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}/backups/{backup}" + }; + + // Information about the GKE cluster from which this Backup was created. + message ClusterMetadata { + // The source cluster from which this Backup was created. + // Valid formats: + // + // - projects/*/locations/*/clusters/* + // - projects/*/zones/*/clusters/* + // + // This is inherited from the parent BackupPlan's + // [cluster][google.cloud.gkebackup.v1.BackupPlan.cluster] field. + string cluster = 1; + + // The Kubernetes server version of the source cluster. + string k8s_version = 2; + + // A list of the Backup for GKE CRD versions found in the cluster. + map backup_crd_versions = 3; + + // Platform-specific version + oneof platform_version { + // GKE version + string gke_version = 4; + + // Anthos version + string anthos_version = 5; + } + } + + // State + enum State { + // The Backup resource is in the process of being created. + STATE_UNSPECIFIED = 0; + + // The Backup resource has been created and the associated BackupJob + // Kubernetes resource has been injected into the source cluster. + CREATING = 1; + + // The gkebackup agent in the cluster has begun executing the backup + // operation. + IN_PROGRESS = 2; + + // The backup operation has completed successfully. + SUCCEEDED = 3; + + // The backup operation has failed. + FAILED = 4; + + // This Backup resource (and its associated artifacts) is in the process + // of being deleted. + DELETING = 5; + } + + // Output only. The fully qualified name of the Backup. + // projects/*/locations/*/backupPlans/*/backups/* + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated global unique identifier of + // [UUID4](https://en.wikipedia.org/wiki/Universally_unique_identifier) + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this Backup resource was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this Backup resource was last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This flag indicates whether this Backup resource was created manually + // by a user or via a schedule in the BackupPlan. A value of True means that + // the Backup was created manually. + bool manual = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A set of custom labels supplied by user. + map labels = 6; + + // Minimum age for this Backup (in days). If this field is set to a non-zero + // value, the Backup will be "locked" against deletion (either manual or + // automatic deletion) for the number of days provided (measured from the + // creation time of the Backup). MUST be an integer value between 0-90 + // (inclusive). + // + // Defaults to parent BackupPlan's + // [backup_delete_lock_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_delete_lock_days] + // setting and may only be increased + // (either at creation time or in a subsequent update). + int32 delete_lock_days = 7; + + // Output only. The time at which an existing delete lock will expire for this backup + // (calculated from create_time + [delete_lock_days][google.cloud.gkebackup.v1.Backup.delete_lock_days]). + google.protobuf.Timestamp delete_lock_expire_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The age (in days) after which this Backup will be automatically deleted. + // Must be an integer value >= 0: + // + // - If 0, no automatic deletion will occur for this Backup. + // - If not 0, this must be >= [delete_lock_days][google.cloud.gkebackup.v1.Backup.delete_lock_days]. + // + // Once a Backup is created, this value may only be increased. + // + // Defaults to the parent BackupPlan's + // [backup_retain_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_retain_days] value. + int32 retain_days = 9; + + // Output only. The time at which this Backup will be automatically deleted (calculated + // from create_time + [retain_days][google.cloud.gkebackup.v1.Backup.retain_days]). + google.protobuf.Timestamp retain_expire_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The customer managed encryption key that was used to encrypt the Backup's + // artifacts. Inherited from the parent BackupPlan's + // [encryption_key][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.encryption_key] value. + EncryptionKey encryption_key = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Defines the "scope" of the Backup - which namespaced resources in the + // cluster were included in the Backup. Inherited from the parent + // BackupPlan's [backup_scope][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.backup_scope] value. + oneof backup_scope { + // Output only. If True, all namespaces were included in the Backup. + bool all_namespaces = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If set, the list of namespaces that were included in the Backup. + Namespaces selected_namespaces = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If set, the list of ProtectedApplications whose resources were included + // in the Backup. + NamespacedNames selected_applications = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Whether or not the Backup contains volume data. Controlled by the parent + // BackupPlan's + // [include_volume_data][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.include_volume_data] value. + bool contains_volume_data = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether or not the Backup contains Kubernetes Secrets. Controlled by the + // parent BackupPlan's + // [include_secrets][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.include_secrets] value. + bool contains_secrets = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about the GKE cluster from which this Backup was created. + ClusterMetadata cluster_metadata = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the Backup + State state = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable description of why the backup is in the current `state`. + string state_reason = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Completion time of the Backup + google.protobuf.Timestamp complete_time = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total number of Kubernetes resources included in the Backup. + int32 resource_count = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total number of volume backups contained in the Backup. + int32 volume_count = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total size of the Backup in bytes = config backup size + sum(volume + // backup sizes) + int64 size_bytes = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. `etag` is used for optimistic concurrency control as a way to help + // prevent simultaneous updates of a backup from overwriting each other. + // It is strongly suggested that systems make use of the `etag` in the + // read-modify-write cycle to perform backup updates in order to avoid + // race conditions: An `etag` is returned in the response to `GetBackup`, + // and systems are expected to put that etag in the request to + // `UpdateBackup` or `DeleteBackup` to ensure that their change will be + // applied to the same version of the resource. + string etag = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User specified descriptive string for this Backup. + string description = 25; + + // Output only. The total number of Kubernetes Pods contained in the Backup. + int32 pod_count = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the config backup in bytes. + int64 config_backup_size_bytes = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup_plan.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup_plan.proto new file mode 100644 index 00000000000..ae823f18a33 --- /dev/null +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup_plan.proto @@ -0,0 +1,195 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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.gkebackup.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gkebackup/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.GkeBackup.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/gkebackup/v1;gkebackup"; +option java_multiple_files = true; +option java_outer_classname = "BackupPlanProto"; +option java_package = "com.google.cloud.gkebackup.v1"; +option php_namespace = "Google\\Cloud\\GkeBackup\\V1"; +option ruby_package = "Google::Cloud::GkeBackup::V1"; + +// Defines the configuration and scheduling for a "line" of Backups. +message BackupPlan { + option (google.api.resource) = { + type: "gkebackup.googleapis.com/BackupPlan" + pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}" + }; + + // RetentionPolicy defines a Backup retention policy for a BackupPlan. + message RetentionPolicy { + // Minimum age for Backups created via this BackupPlan (in days). + // This field MUST be an integer value between 0-90 (inclusive). + // A Backup created under this BackupPlan will NOT be deletable until it + // reaches Backup's (create_time + backup_delete_lock_days). + // Updating this field of a BackupPlan does NOT affect existing Backups + // under it. Backups created AFTER a successful update will inherit + // the new value. + // + // Default: 0 (no delete blocking) + int32 backup_delete_lock_days = 1; + + // The default maximum age of a Backup created via this BackupPlan. + // This field MUST be an integer value >= 0. + // If specified, a Backup created under this BackupPlan will be + // automatically deleted after its age reaches (create_time + + // backup_retain_days). + // If not specified, Backups created under this BackupPlan will NOT be + // subject to automatic deletion. + // Updating this field does NOT affect existing Backups under it. Backups + // created AFTER a successful update will automatically pick up the new + // value. + // NOTE: backup_retain_days must be >= [backup_delete_lock_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_delete_lock_days]. + // + // Default: 0 (no automatic deletion) + int32 backup_retain_days = 2; + + // This flag denotes whether the retention policy of this BackupPlan is + // locked. If set to True, no further update is allowed on this policy, + // including the `locked` field itself. + // + // Default: False + bool locked = 3; + } + + // Schedule defines scheduling parameters for automatically creating Backups + // via this BackupPlan. + message Schedule { + // A standard [cron](https://wikipedia.com/wiki/cron) string that defines a + // repeating schedule for creating Backups via this BackupPlan. + // + // Default (empty): no automatic backup creation will occur. + string cron_schedule = 1; + + // This flag denotes whether automatic Backup creation is paused for this + // BackupPlan. + // + // Default: False + bool paused = 2; + } + + // BackupConfig defines the configuration of Backups created via this + // BackupPlan. + message BackupConfig { + // This defines the "scope" of the Backup - which namespaced + // resources in the cluster will be included in a Backup. + // Exactly one of the fields of backup_scope MUST be specified. + oneof backup_scope { + // If True, include all namespaced resources + bool all_namespaces = 1; + + // If set, include just the resources in the listed namespaces. + Namespaces selected_namespaces = 2; + + // If set, include just the resources referenced by the listed + // ProtectedApplications. + NamespacedNames selected_applications = 3; + } + + // This flag specifies whether volume data should be backed up when + // PVCs are included in the scope of a Backup. + // + // Default: False + bool include_volume_data = 4; + + // This flag specifies whether Kubernetes Secret resources should be + // included when they fall into the scope of Backups. + // + // Default: False + bool include_secrets = 5; + + // This defines a customer managed encryption key that will be used to + // encrypt the "config" portion (the Kubernetes resources) of Backups + // created via this plan. + // + // Default (empty): Config backup artifacts will not be encrypted. + EncryptionKey encryption_key = 6; + } + + // Output only. The full name of the BackupPlan resource. + // Format: projects/*/locations/*/backupPlans/* + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated global unique identifier of + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this BackupPlan resource was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this BackupPlan resource was last + // updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User specified descriptive string for this BackupPlan. + string description = 5; + + // Required. Immutable. The source cluster from which Backups will be created via + // this BackupPlan. + // Valid formats: + // + // - projects/*/locations/*/clusters/* + // - projects/*/zones/*/clusters/* + string cluster = 6 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "container.googleapis.com/Cluster" + } + ]; + + // RetentionPolicy governs lifecycle of Backups created under this plan. + RetentionPolicy retention_policy = 7; + + // A set of custom labels supplied by user. + map labels = 8; + + // Defines a schedule for automatic Backup creation via this BackupPlan. + Schedule backup_schedule = 9; + + // Output only. `etag` is used for optimistic concurrency control as a way to help + // prevent simultaneous updates of a backup plan from overwriting each other. + // It is strongly suggested that systems make use of the 'etag' in the + // read-modify-write cycle to perform BackupPlan updates in order to avoid + // race conditions: An `etag` is returned in the response to `GetBackupPlan`, + // and systems are expected to put that etag in the request to + // `UpdateBackupPlan` or `DeleteBackupPlan` to ensure that their change + // will be applied to the same version of the resource. + string etag = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This flag indicates whether this BackupPlan has been deactivated. + // Setting this field to True locks the BackupPlan such that no further + // updates will be allowed (except deletes), including the deactivated field + // itself. It also prevents any new Backups from being created via this + // BackupPlan (including scheduled Backups). + // + // Default: False + bool deactivated = 11; + + // Defines the configuration of Backups created via this BackupPlan. + BackupConfig backup_config = 12; + + // Output only. The number of Kubernetes Pods backed up in the + // last successful Backup created via this BackupPlan. + int32 protected_pod_count = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/common.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/common.proto new file mode 100644 index 00000000000..f86e95eae4e --- /dev/null +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/common.proto @@ -0,0 +1,58 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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.gkebackup.v1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.GkeBackup.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/gkebackup/v1;gkebackup"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.gkebackup.v1"; +option php_namespace = "Google\\Cloud\\GkeBackup\\V1"; +option ruby_package = "Google::Cloud::GkeBackup::V1"; + +// A list of Kubernetes Namespaces +message Namespaces { + // A list of Kubernetes Namespaces + repeated string namespaces = 1; +} + +// A reference to a namespaced resource in Kubernetes. +message NamespacedName { + // The Namespace of the Kubernetes resource. + string namespace = 1; + + // The name of the Kubernetes resource. + string name = 2; +} + +// A list of namespaced Kubernetes resources. +message NamespacedNames { + // A list of namespaced Kubernetes resources. + repeated NamespacedName namespaced_names = 1; +} + +// Defined a customer managed encryption key that will be used to encrypt Backup +// artifacts. +message EncryptionKey { + // Google Cloud KMS encryption key. Format: + // projects/*/locations/*/keyRings/*/cryptoKeys/* + string gcp_kms_encryption_key = 1 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; +} diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/gkebackup.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/gkebackup.proto new file mode 100644 index 00000000000..84da52d465f --- /dev/null +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/gkebackup.proto @@ -0,0 +1,940 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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.gkebackup.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gkebackup/v1/backup.proto"; +import "google/cloud/gkebackup/v1/backup_plan.proto"; +import "google/cloud/gkebackup/v1/restore.proto"; +import "google/cloud/gkebackup/v1/restore_plan.proto"; +import "google/cloud/gkebackup/v1/volume.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.GkeBackup.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/gkebackup/v1;gkebackup"; +option java_multiple_files = true; +option java_outer_classname = "GKEBackupProto"; +option java_package = "com.google.cloud.gkebackup.v1"; +option php_namespace = "Google\\Cloud\\GkeBackup\\V1"; +option ruby_package = "Google::Cloud::GkeBackup::V1"; +option (google.api.resource_definition) = { + type: "container.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; + +// BackupForGKE allows Kubernetes administrators to configure, execute, and +// manage backup and restore operations for their GKE clusters. +service BackupForGKE { + option (google.api.default_host) = "gkebackup.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new BackupPlan in a given location. + 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" + }; + } + + // Lists BackupPlans in a given location. + rpc ListBackupPlans(ListBackupPlansRequest) returns (ListBackupPlansResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupPlans" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieve the 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"; + } + + // 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" + }; + } + + // Deletes an existing 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" + }; + } + + // Creates a Backup for the given BackupPlan. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/backupPlans/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Lists the Backups for a given BackupPlan. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/backupPlans/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieve the details of a single Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupPlans/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update a Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/locations/*/backupPlans/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Deletes an existing Backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupPlans/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists the VolumeBackups for a given Backup. + rpc ListVolumeBackups(ListVolumeBackupsRequest) returns (ListVolumeBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/backupPlans/*/backups/*}/volumeBackups" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieve the details of a single VolumeBackup. + rpc GetVolumeBackup(GetVolumeBackupRequest) returns (VolumeBackup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new RestorePlan in a given location. + rpc CreateRestorePlan(CreateRestorePlanRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/restorePlans" + body: "restore_plan" + }; + option (google.api.method_signature) = "parent,restore_plan,restore_plan_id"; + option (google.longrunning.operation_info) = { + response_type: "RestorePlan" + metadata_type: "OperationMetadata" + }; + } + + // Lists RestorePlans in a given location. + rpc ListRestorePlans(ListRestorePlansRequest) returns (ListRestorePlansResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/restorePlans" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieve the details of a single RestorePlan. + rpc GetRestorePlan(GetRestorePlanRequest) returns (RestorePlan) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/restorePlans/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update a RestorePlan. + rpc UpdateRestorePlan(UpdateRestorePlanRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{restore_plan.name=projects/*/locations/*/restorePlans/*}" + body: "restore_plan" + }; + option (google.api.method_signature) = "restore_plan,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "RestorePlan" + metadata_type: "OperationMetadata" + }; + } + + // Deletes an existing RestorePlan. + rpc DeleteRestorePlan(DeleteRestorePlanRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/restorePlans/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new Restore for the given RestorePlan. + rpc CreateRestore(CreateRestoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/restorePlans/*}/restores" + body: "restore" + }; + option (google.api.method_signature) = "parent,restore,restore_id"; + option (google.longrunning.operation_info) = { + response_type: "Restore" + metadata_type: "OperationMetadata" + }; + } + + // Lists the Restores for a given RestorePlan. + rpc ListRestores(ListRestoresRequest) returns (ListRestoresResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/restorePlans/*}/restores" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the details of a single Restore. + rpc GetRestore(GetRestoreRequest) returns (Restore) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update a Restore. + rpc UpdateRestore(UpdateRestoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{restore.name=projects/*/locations/*/restorePlans/*/restores/*}" + body: "restore" + }; + option (google.api.method_signature) = "restore,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Restore" + metadata_type: "OperationMetadata" + }; + } + + // Deletes an existing Restore. + rpc DeleteRestore(DeleteRestoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists the VolumeRestores for a given Restore. + rpc ListVolumeRestores(ListVolumeRestoresRequest) returns (ListVolumeRestoresResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/restorePlans/*/restores/*}/volumeRestores" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieve the details of a single VolumeRestore. + rpc GetVolumeRestore(GetVolumeRestoreRequest) returns (VolumeRestore) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for CreateBackupPlan. +message CreateBackupPlanRequest { + // Required. The location within which to create the BackupPlan. + // Format: projects/*/locations/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The BackupPlan resource object to create. + BackupPlan backup_plan = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The client-provided short name for the BackupPlan resource. + // This name must: + // + // - be between 1 and 63 characters long (inclusive) + // - consist of only lower-case ASCII letters, numbers, and dashes + // - start with a lower-case letter + // - end with a lower-case letter or number + // - be unique within the set of BackupPlans in this location + string backup_plan_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListBackupPlans. +message ListBackupPlansRequest { + // Required. The location that contains the BackupPlans to list. + // Format: projects/*/locations/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The target number of results to return in a single response. + // If not specified, a default value will be chosen by the service. + // Note that the response may inclue a partial list and a caller should + // only rely on the response's + // [next_page_token][google.cloud.gkebackup.v1.ListBackupPlansResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2; + + // The value of + // [next_page_token][google.cloud.gkebackup.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; + + // Field match expression used to filter the results. + string filter = 4; + + // Field by which to sort the results. + string order_by = 5; +} + +// Response message for ListBackupPlans. +message ListBackupPlansResponse { + // The list of BackupPlans matching the given criteria. + repeated BackupPlan backup_plans = 1; + + // A token which may be sent as + // [page_token][google.cloud.gkebackup.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; +} + +// Request message for GetBackupPlan. +message GetBackupPlanRequest { + // Required. Fully qualified BackupPlan name. + // Format: projects/*/locations/*/backupPlans/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/BackupPlan" + } + ]; +} + +// Request message for UpdateBackupPlan. +message UpdateBackupPlanRequest { + // Required. A new version of the BackupPlan resource that contains updated fields. + // This may be sparsely populated if an `update_mask` is provided. + BackupPlan backup_plan = 1 [(google.api.field_behavior) = REQUIRED]; + + // This is used to specify the fields to be overwritten in the + // BackupPlan targeted for update. The values for each of these + // updated fields will be taken from the `backup_plan` provided + // with this request. Field names are relative to the root of the resource + // (e.g., `description`, `backup_config.include_volume_data`, etc.) + // If no `update_mask` is provided, all fields in `backup_plan` will be + // written to the target BackupPlan resource. + // Note that OUTPUT_ONLY and IMMUTABLE fields in `backup_plan` are ignored + // and are not used to update the target BackupPlan. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for DeleteBackupPlan. +message DeleteBackupPlanRequest { + // Required. Fully qualified BackupPlan name. + // Format: projects/*/locations/*/backupPlans/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/BackupPlan" + } + ]; + + // If provided, this value must match the current value of the + // target BackupPlan's [etag][google.cloud.gkebackup.v1.BackupPlan.etag] field or the request is + // rejected. + string etag = 2; +} + +// Request message for CreateBackup. +message CreateBackupRequest { + // Required. The BackupPlan within which to create the Backup. + // Format: projects/*/locations/*/backupPlans/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/BackupPlan" + } + ]; + + // The Backup resource to create. + Backup backup = 2; + + // The client-provided short name for the Backup resource. + // This name must: + // + // - be between 1 and 63 characters long (inclusive) + // - consist of only lower-case ASCII letters, numbers, and dashes + // - start with a lower-case letter + // - end with a lower-case letter or number + // - be unique within the set of Backups in this BackupPlan + string backup_id = 3; +} + +// Request message for ListBackups. +message ListBackupsRequest { + // Required. The BackupPlan that contains the Backups to list. + // Format: projects/*/locations/*/backupPlans/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/BackupPlan" + } + ]; + + // The target number of results to return in a single response. + // If not specified, a default value will be chosen by the service. + // Note that the response may inclue a partial list and a caller should + // only rely on the response's + // [next_page_token][google.cloud.gkebackup.v1.ListBackupsResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2; + + // The value of + // [next_page_token][google.cloud.gkebackup.v1.ListBackupsResponse.next_page_token] + // received from a previous `ListBackups` call. + // Provide this to retrieve the subsequent page in a multi-page list of + // results. When paginating, all other parameters provided to + // `ListBackups` must match the call that provided the page token. + string page_token = 3; + + // Field match expression used to filter the results. + string filter = 4; + + // Field by which to sort the results. + string order_by = 5; +} + +// Response message for ListBackups. +message ListBackupsResponse { + // The list of Backups matching the given criteria. + repeated Backup backups = 1; + + // A token which may be sent as [page_token][google.cloud.gkebackup.v1.ListBackupsRequest.page_token] in + // a subsequent `ListBackups` 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; +} + +// Request message for GetBackup. +message GetBackupRequest { + // Required. Full name of the Backup resource. + // Format: projects/*/locations/*/backupPlans/*/backups/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/Backup" + } + ]; +} + +// Request message for UpdateBackup. +message UpdateBackupRequest { + // Required. A new version of the Backup resource that contains updated fields. + // This may be sparsely populated if an `update_mask` is provided. + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // This is used to specify the fields to be overwritten in the + // Backup targeted for update. The values for each of these + // updated fields will be taken from the `backup_plan` provided + // with this request. Field names are relative to the root of the resource. + // If no `update_mask` is provided, all fields in `backup` will be + // written to the target Backup resource. + // Note that OUTPUT_ONLY and IMMUTABLE fields in `backup` are ignored + // and are not used to update the target Backup. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for DeleteBackup. +message DeleteBackupRequest { + // Required. Name of the Backup resource. + // Format: projects/*/locations/*/backupPlans/*/backups/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/Backup" + } + ]; + + // If provided, this value must match the current value of the + // target Backup's [etag][google.cloud.gkebackup.v1.Backup.etag] field or the request is + // rejected. + string etag = 2; + + // If set to true, any VolumeBackups below this Backup will also be deleted. + // Otherwise, the request will only succeed if the Backup has no + // VolumeBackups. + bool force = 3; +} + +// Request message for ListVolumeBackups. +message ListVolumeBackupsRequest { + // Required. The Backup that contains the VolumeBackups to list. + // Format: projects/*/locations/*/backupPlans/*/backups/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/Backup" + } + ]; + + // The target number of results to return in a single response. + // If not specified, a default value will be chosen by the service. + // Note that the response may inclue a partial list and a caller should + // only rely on the response's + // [next_page_token][google.cloud.gkebackup.v1.ListVolumeBackupsResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2; + + // The value of + // [next_page_token][google.cloud.gkebackup.v1.ListVolumeBackupsResponse.next_page_token] + // received from a previous `ListVolumeBackups` call. + // Provide this to retrieve the subsequent page in a multi-page list of + // results. When paginating, all other parameters provided to + // `ListVolumeBackups` must match the call that provided the page token. + string page_token = 3; + + // Field match expression used to filter the results. + string filter = 4; + + // Field by which to sort the results. + string order_by = 5; +} + +// Response message for ListVolumeBackups. +message ListVolumeBackupsResponse { + // The list of VolumeBackups matching the given criteria. + repeated VolumeBackup volume_backups = 1; + + // A token which may be sent as + // [page_token][google.cloud.gkebackup.v1.ListVolumeBackupsRequest.page_token] in a subsequent + // `ListVolumeBackups` 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; +} + +// Request message for GetVolumeBackup. +message GetVolumeBackupRequest { + // Required. Full name of the VolumeBackup resource. + // Format: projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/VolumeBackup" + } + ]; +} + +// Request message for CreateRestorePlan. +message CreateRestorePlanRequest { + // Required. The location within which to create the RestorePlan. + // Format: projects/*/locations/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The RestorePlan resource object to create. + RestorePlan restore_plan = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The client-provided short name for the RestorePlan resource. + // This name must: + // + // - be between 1 and 63 characters long (inclusive) + // - consist of only lower-case ASCII letters, numbers, and dashes + // - start with a lower-case letter + // - end with a lower-case letter or number + // - be unique within the set of RestorePlans in this location + string restore_plan_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListRestorePlans. +message ListRestorePlansRequest { + // Required. The location that contains the RestorePlans to list. + // Format: projects/*/locations/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The target number of results to return in a single response. + // If not specified, a default value will be chosen by the service. + // Note that the response may inclue a partial list and a caller should + // only rely on the response's + // [next_page_token][google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2; + + // The value of + // [next_page_token][google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token] + // received from a previous `ListRestorePlans` call. + // Provide this to retrieve the subsequent page in a multi-page list of + // results. When paginating, all other parameters provided to + // `ListRestorePlans` must match the call that provided the page token. + string page_token = 3; + + // Field match expression used to filter the results. + string filter = 4; + + // Field by which to sort the results. + string order_by = 5; +} + +// Response message for ListRestorePlans. +message ListRestorePlansResponse { + // The list of RestorePlans matching the given criteria. + repeated RestorePlan restore_plans = 1; + + // A token which may be sent as + // [page_token][google.cloud.gkebackup.v1.ListRestorePlansRequest.page_token] in a subsequent + // `ListRestorePlans` 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; +} + +// Request message for GetRestorePlan. +message GetRestorePlanRequest { + // Required. Fully qualified RestorePlan name. + // Format: projects/*/locations/*/restorePlans/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/RestorePlan" + } + ]; +} + +// Request message for UpdateRestorePlan. +message UpdateRestorePlanRequest { + // Required. A new version of the RestorePlan resource that contains updated fields. + // This may be sparsely populated if an `update_mask` is provided. + RestorePlan restore_plan = 1 [(google.api.field_behavior) = REQUIRED]; + + // This is used to specify the fields to be overwritten in the + // RestorePlan targeted for update. The values for each of these + // updated fields will be taken from the `restore_plan` provided + // with this request. Field names are relative to the root of the resource. + // If no `update_mask` is provided, all fields in `restore_plan` will be + // written to the target RestorePlan resource. + // Note that OUTPUT_ONLY and IMMUTABLE fields in `restore_plan` are ignored + // and are not used to update the target RestorePlan. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for DeleteRestorePlan. +message DeleteRestorePlanRequest { + // Required. Fully qualified RestorePlan name. + // Format: projects/*/locations/*/restorePlans/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/RestorePlan" + } + ]; + + // If provided, this value must match the current value of the + // target RestorePlan's [etag][google.cloud.gkebackup.v1.RestorePlan.etag] field or the request is + // rejected. + string etag = 2; + + // If set to true, any Restores below this RestorePlan will also be deleted. + // Otherwise, the request will only succeed if the RestorePlan has no + // Restores. + bool force = 3; +} + +// Request message for CreateRestore. +message CreateRestoreRequest { + // Required. The RestorePlan within which to create the Restore. + // Format: projects/*/locations/*/restorePlans/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/RestorePlan" + } + ]; + + // Required. The restore resource to create. + Restore restore = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The client-provided short name for the Restore resource. + // This name must: + // + // - be between 1 and 63 characters long (inclusive) + // - consist of only lower-case ASCII letters, numbers, and dashes + // - start with a lower-case letter + // - end with a lower-case letter or number + // - be unique within the set of Restores in this RestorePlan. + string restore_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListRestores. +message ListRestoresRequest { + // Required. The RestorePlan that contains the Restores to list. + // Format: projects/*/locations/*/restorePlans/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/RestorePlan" + } + ]; + + // The target number of results to return in a single response. + // If not specified, a default value will be chosen by the service. + // Note that the response may inclue a partial list and a caller should + // only rely on the response's + // [next_page_token][google.cloud.gkebackup.v1.ListRestoresResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2; + + // The value of + // [next_page_token][google.cloud.gkebackup.v1.ListRestoresResponse.next_page_token] + // received from a previous `ListRestores` call. + // Provide this to retrieve the subsequent page in a multi-page list of + // results. When paginating, all other parameters provided to `ListRestores` + // must match the call that provided the page token. + string page_token = 3; + + // Field match expression used to filter the results. + string filter = 4; + + // Field by which to sort the results. + string order_by = 5; +} + +// Response message for ListRestores. +message ListRestoresResponse { + // The list of Restores matching the given criteria. + repeated Restore restores = 1; + + // A token which may be sent as [page_token][google.cloud.gkebackup.v1.ListRestoresRequest.page_token] + // in a subsequent `ListRestores` 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; +} + +// Request message for GetRestore. +message GetRestoreRequest { + // Required. Name of the restore resource. + // Format: projects/*/locations/*/restorePlans/*/restores/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/Restore" + } + ]; +} + +// Request message for UpdateRestore. +message UpdateRestoreRequest { + // Required. A new version of the Restore resource that contains updated fields. + // This may be sparsely populated if an `update_mask` is provided. + Restore restore = 1 [(google.api.field_behavior) = REQUIRED]; + + // This is used to specify the fields to be overwritten in the + // Restore targeted for update. The values for each of these + // updated fields will be taken from the `restore` provided + // with this request. Field names are relative to the root of the resource. + // If no `update_mask` is provided, all fields in `restore` will be + // written to the target Restore resource. + // Note that OUTPUT_ONLY and IMMUTABLE fields in `restore` are ignored + // and are not used to update the target Restore. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for DeleteRestore. +message DeleteRestoreRequest { + // Required. Full name of the Restore + // Format: projects/*/locations/*/restorePlans/*/restores/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/Restore" + } + ]; + + // If provided, this value must match the current value of the + // target Restore's [etag][google.cloud.gkebackup.v1.Restore.etag] field or the request is + // rejected. + string etag = 2; + + // If set to true, any VolumeRestores below this restore will also be deleted. + // Otherwise, the request will only succeed if the restore has no + // VolumeRestores. + bool force = 3; +} + +// Request message for ListVolumeRestores. +message ListVolumeRestoresRequest { + // Required. The Restore that contains the VolumeRestores to list. + // Format: projects/*/locations/*/restorePlans/*/restores/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/Restore" + } + ]; + + // The target number of results to return in a single response. + // If not specified, a default value will be chosen by the service. + // Note that the response may inclue a partial list and a caller should + // only rely on the response's + // [next_page_token][google.cloud.gkebackup.v1.ListVolumeRestoresResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2; + + // The value of + // [next_page_token][google.cloud.gkebackup.v1.ListVolumeRestoresResponse.next_page_token] + // received from a previous `ListVolumeRestores` call. + // Provide this to retrieve the subsequent page in a multi-page list of + // results. When paginating, all other parameters provided to + // `ListVolumeRestores` must match the call that provided the page token. + string page_token = 3; + + // Field match expression used to filter the results. + string filter = 4; + + // Field by which to sort the results. + string order_by = 5; +} + +// Response message for ListVolumeRestores. +message ListVolumeRestoresResponse { + // The list of VolumeRestores matching the given criteria. + repeated VolumeRestore volume_restores = 1; + + // A token which may be sent as + // [page_token][google.cloud.gkebackup.v1.ListVolumeRestoresRequest.page_token] in a subsequent + // `ListVolumeRestores` 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; +} + +// Request message for GetVolumeRestore. +message GetVolumeRestoreRequest { + // Required. Full name of the VolumeRestore resource. + // Format: projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/VolumeRestore" + } + ]; +} diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore.proto new file mode 100644 index 00000000000..b2eb017a521 --- /dev/null +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore.proto @@ -0,0 +1,326 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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.gkebackup.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gkebackup/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.GkeBackup.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/gkebackup/v1;gkebackup"; +option java_multiple_files = true; +option java_outer_classname = "RestoreProto"; +option java_package = "com.google.cloud.gkebackup.v1"; +option php_namespace = "Google\\Cloud\\GkeBackup\\V1"; +option ruby_package = "Google::Cloud::GkeBackup::V1"; + +// Represents both a request to Restore some portion of a Backup into +// a target GKE cluster and a record of the restore operation itself. +// Next id: 18 +message Restore { + option (google.api.resource) = { + type: "gkebackup.googleapis.com/Restore" + pattern: "projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}" + }; + + // Possible values for state of the Restore. + enum State { + // The Restore resource is in the process of being created. + STATE_UNSPECIFIED = 0; + + // The Restore resource has been created and the associated RestoreJob + // Kubernetes resource has been injected into target cluster. + CREATING = 1; + + // The gkebackup agent in the cluster has begun executing the restore + // operation. + IN_PROGRESS = 2; + + // The restore operation has completed successfully. Restored workloads may + // not yet be operational. + SUCCEEDED = 3; + + // The restore operation has failed. + FAILED = 4; + + // This Restore resource is in the process of being deleted. + DELETING = 5; + } + + // Output only. The full name of the Restore resource. + // Format: projects/*/locations/*/restorePlans/*/restores/* + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated global unique identifier of + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this Restore resource was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this Restore resource was last + // updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User specified descriptive string for this Restore. + string description = 5; + + // Required. Immutable. A reference to the [Backup][google.cloud.gkebackup.v1.Backup] used as the source from which this Restore + // will restore. Note that this Backup must be a sub-resource of the + // RestorePlan's [backup_plan][google.cloud.gkebackup.v1.RestorePlan.backup_plan]. + // Format: projects/*/locations/*/backupPlans/*/backups/*. + string backup = 6 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/Backup" + } + ]; + + // Output only. The target cluster into which this Restore will restore data. + // Valid formats: + // + // - projects/*/locations/*/clusters/* + // - projects/*/zones/*/clusters/* + // + // Inherited from parent RestorePlan's [cluster][google.cloud.gkebackup.v1.RestorePlan.cluster] value. + string cluster = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "container.googleapis.com/Cluster" + } + ]; + + // Output only. Configuration of the Restore. Inherited from parent RestorePlan's + // [restore_config][google.cloud.gkebackup.v1.RestorePlan.restore_config]. + RestoreConfig restore_config = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A set of custom labels supplied by user. + map labels = 9; + + // Output only. The current state of the Restore. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable description of why the Restore is in its current state. + string state_reason = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of when the restore operation completed. + google.protobuf.Timestamp complete_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of resources restored during the restore execution. + int32 resources_restored_count = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of resources excluded during the restore execution. + int32 resources_excluded_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of resources that failed to be restored during the restore + // execution. + int32 resources_failed_count = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of volumes restored during the restore execution. + int32 volumes_restored_count = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. `etag` is used for optimistic concurrency control as a way to help + // prevent simultaneous updates of a restore from overwriting each other. + // It is strongly suggested that systems make use of the `etag` in the + // read-modify-write cycle to perform restore updates in order to avoid + // race conditions: An `etag` is returned in the response to `GetRestore`, + // and systems are expected to put that etag in the request to + // `UpdateRestore` or `DeleteRestore` to ensure that their change will be + // applied to the same version of the resource. + string etag = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration of a restore. +// Next id: 9 +message RestoreConfig { + // Defines how volume data should be restored + enum VolumeDataRestorePolicy { + // Unspecified (illegal). + VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED = 0; + + // For each PVC to be restored, will create a new underlying volume (and PV) + // from the corresponding VolumeBackup contained within the Backup. + RESTORE_VOLUME_DATA_FROM_BACKUP = 1; + + // For each PVC to be restored, attempt to reuse the original PV contained + // in the Backup (with its original underlying volume). Note that option + // is likely only usable when restoring a workload to its original cluster. + REUSE_VOLUME_HANDLE_FROM_BACKUP = 2; + + // For each PVC to be restored, PVCs will be created without any particular + // action to restore data. In this case, the normal Kubernetes provisioning + // logic would kick in, and this would likely result in either dynamically + // provisioning blank PVs or binding to statically provisioned PVs. + NO_VOLUME_DATA_RESTORATION = 3; + } + + // Defines the behavior for handling the situation where cluster-scoped + // resources being restored already exist in the target cluster. + enum ClusterResourceConflictPolicy { + // Unspecified. Only allowed if no cluster-scoped resources will be + // restored. + CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED = 0; + + // Do not attempt to restore the conflicting resource. + USE_EXISTING_VERSION = 1; + + // Delete the existing version before re-creating it from the Backup. + // Note that this is a dangerous option which could cause unintentional + // data loss if used inappropriately - for example, deleting a CRD will + // cause Kubernetes to delete all CRs of that type. + USE_BACKUP_VERSION = 2; + } + + // Defines the behavior for handling the situation where sets of namespaced + // resources being restored already exist in the target cluster. + enum NamespacedResourceRestoreMode { + // Unspecified (invalid). + NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED = 0; + + // When conflicting top-level resources (either Namespaces or + // ProtectedApplications, depending upon the scope) are encountered, this + // will first trigger a delete of the conflicting resource AND ALL OF ITS + // REFERENCED RESOURCES (e.g., all resources in the Namespace or all + // resources referenced by the ProtectedApplication) before restoring the + // resources from the Backup. This mode should only be used when you are + // intending to revert some portion of a cluster to an earlier state. + DELETE_AND_RESTORE = 1; + + // If conflicting top-level resources (either Namespaces or + // ProtectedApplications, depending upon the scope) are encountered at the + // beginning of a restore process, the Restore will fail. If a conflict + // occurs during the restore process itself (e.g., because an out of band + // process creates conflicting resources), a conflict will be reported. + FAIL_ON_CONFLICT = 2; + } + + // This is a direct map to the Kubernetes GroupKind type + // [GroupKind](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind) + // and is used for identifying specific "types" of resources to restore. + message GroupKind { + // API group string of a Kubernetes resource, e.g. + // "apiextensions.k8s.io", "storage.k8s.io", etc. + // Note: use empty string for core API group + string resource_group = 1; + + // Kind of a Kubernetes resource, e.g. + // "CustomResourceDefinition", "StorageClass", etc. + string resource_kind = 2; + } + + // Identifies the cluster-scoped resources to restore from the Backup. + message ClusterResourceRestoreScope { + // A list of "types" of cluster-scoped resources to be restored from the + // Backup. An empty list means that NO cluster-scoped resources will be + // restored. Note that Namespaces and PersistentVolume restoration is + // handled separately and is not governed by this field. + repeated GroupKind selected_group_kinds = 1; + } + + // A transformation rule to be applied against Kubernetes resources as they + // are selected for restoration from a Backup. A rule contains both filtering + // logic (which resources are subject to substitution) and substitution logic. + message SubstitutionRule { + // (Filtering parameter) Any resource subject to substitution must be + // contained within one of the listed Kubernetes Namespace in the Backup. + // If this field is not provided, no namespace filtering will be performed + // (all resources in all Namespaces, including all cluster-scoped resources, + // will be candidates for substitution). + // To mix cluster-scoped and namespaced resources in the same rule, use an + // empty string ("") as one of the target namespaces. + repeated string target_namespaces = 1; + + // (Filtering parameter) Any resource subject to substitution must belong to + // one of the listed "types". + // If this field is not provided, no type filtering will be performed (all + // resources of all types matching previous filtering parameters will be + // candidates for substitution). + repeated GroupKind target_group_kinds = 2; + + // Required. This is a [JSONPath] + // (https://kubernetes.io/docs/reference/kubectl/jsonpath/) + // expression that matches specific fields of candidate + // resources and it operates as both a filtering parameter (resources that + // are not matched with this expression will not be candidates for + // substitution) as well as a field identifier (identifies exactly which + // fields out of the candidate resources will be modified). + string target_json_path = 3 [(google.api.field_behavior) = REQUIRED]; + + // (Filtering parameter) This is a [regular expression] + // (https://en.wikipedia.org/wiki/Regular_expression) + // that is compared against the fields matched by the target_json_path + // expression (and must also have passed the previous filters). + // Substitution will not be performed against fields whose + // value does not match this expression. If this field is NOT specified, + // then ALL fields matched by the target_json_path expression will undergo + // substitution. Note that an empty (e.g., "", rather than unspecified) + // value for for this field will only match empty fields. + string original_value_pattern = 4; + + // This is the new value to set for any fields that pass the filtering and + // selection criteria. To remove a value from a Kubernetes resource, either + // leave this field unspecified, or set it to the empty string (""). + string new_value = 5; + } + + // Specifies the mechanism to be used to restore volume data. + // Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as + // NO_VOLUME_DATA_RESTORATION). + VolumeDataRestorePolicy volume_data_restore_policy = 1; + + // Defines the behavior for handling the situation where cluster-scoped + // resources being restored already exist in the target cluster. This MUST be + // set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if + // [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope] is not empty. + ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; + + // Defines the behavior for handling the situation where sets of namespaced + // resources being restored already exist in the target cluster. This MUST be + // set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED. + NamespacedResourceRestoreMode namespaced_resource_restore_mode = 3; + + // Identifies the cluster-scoped resources to restore from the Backup. + // Not specifying it means NO cluster resource will be restored. + ClusterResourceRestoreScope cluster_resource_restore_scope = 4; + + // Specifies the namespaced resources to restore from the Backup. + // Only one of the entries may be specified. If not specified, NO namespaced + // resources will be restored. + oneof namespaced_resource_restore_scope { + // Restore all namespaced resources in the Backup if set to "True". + // Specifying this field to "False" is an error. + bool all_namespaces = 5; + + // A list of selected Namespaces to restore from the Backup. The listed + // Namespaces and all resources contained in them will be restored. + Namespaces selected_namespaces = 6; + + // A list of selected ProtectedApplications to restore. The listed + // ProtectedApplications and all the resources to which they refer will be + // restored. + NamespacedNames selected_applications = 7; + } + + // A list of transformation rules to be applied against Kubernetes resources + // as they are selected for restoration from a Backup. Rules are executed in + // order defined - this order matters, as changes made by a rule may impact + // the filtering logic of subsequent rules. An empty list means no + // substitution will occur. + repeated SubstitutionRule substitution_rules = 8; +} diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore_plan.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore_plan.proto new file mode 100644 index 00000000000..5811332b05e --- /dev/null +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore_plan.proto @@ -0,0 +1,101 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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.gkebackup.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gkebackup/v1/restore.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.GkeBackup.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/gkebackup/v1;gkebackup"; +option java_multiple_files = true; +option java_outer_classname = "RestorePlanProto"; +option java_package = "com.google.cloud.gkebackup.v1"; +option php_namespace = "Google\\Cloud\\GkeBackup\\V1"; +option ruby_package = "Google::Cloud::GkeBackup::V1"; + +// The configuration of a potential series of Restore operations to be performed +// against Backups belong to a particular BackupPlan. +// Next id: 11 +message RestorePlan { + option (google.api.resource) = { + type: "gkebackup.googleapis.com/RestorePlan" + pattern: "projects/{project}/locations/{location}/restorePlans/{restore_plan}" + }; + + // Output only. The full name of the RestorePlan resource. + // Format: projects/*/locations/*/restorePlans/*. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated global unique identifier of + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this RestorePlan resource was + // created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this RestorePlan resource was last + // updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User specified descriptive string for this RestorePlan. + string description = 5; + + // Required. Immutable. A reference to the [BackupPlan][google.cloud.gkebackup.v1.BackupPlan] from which Backups may be used as the + // source for Restores created via this RestorePlan. + // Format: projects/*/locations/*/backupPlans/*. + string backup_plan = 6 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkebackup.googleapis.com/BackupPlan" + } + ]; + + // Required. Immutable. The target cluster into which Restores created via this RestorePlan + // will restore data. NOTE: the cluster's region must be the same as the + // RestorePlan. + // Valid formats: + // + // - projects/*/locations/*/clusters/* + // - projects/*/zones/*/clusters/* + string cluster = 7 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "container.googleapis.com/Cluster" + } + ]; + + // Required. Configuration of Restores created via this RestorePlan. + RestoreConfig restore_config = 8 [(google.api.field_behavior) = REQUIRED]; + + // A set of custom labels supplied by user. + map labels = 9; + + // Output only. `etag` is used for optimistic concurrency control as a way to help + // prevent simultaneous updates of a restore from overwriting each other. + // It is strongly suggested that systems make use of the `etag` in the + // read-modify-write cycle to perform restore updates in order to avoid + // race conditions: An `etag` is returned in the response to `GetRestorePlan`, + // and systems are expected to put that etag in the request to + // `UpdateRestorePlan` or `DeleteRestorePlan` to ensure that their change + // will be applied to the same version of the resource. + string etag = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/volume.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/volume.proto new file mode 100644 index 00000000000..87b633ce19c --- /dev/null +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/volume.proto @@ -0,0 +1,222 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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.gkebackup.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gkebackup/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.GkeBackup.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/gkebackup/v1;gkebackup"; +option java_multiple_files = true; +option java_outer_classname = "VolumeProto"; +option java_package = "com.google.cloud.gkebackup.v1"; +option php_namespace = "Google\\Cloud\\GkeBackup\\V1"; +option ruby_package = "Google::Cloud::GkeBackup::V1"; + +// Represents the backup of a specific persistent volume as a component of a +// Backup - both the record of the operation and a pointer to the underlying +// storage-specific artifacts. +// Next id: 14 +message VolumeBackup { + option (google.api.resource) = { + type: "gkebackup.googleapis.com/VolumeBackup" + pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}/backups/{backup}/volumeBackups/{volume_backup}" + }; + + // Identifies the format used for the volume backup. + enum VolumeBackupFormat { + // Default value, not specified. + VOLUME_BACKUP_FORMAT_UNSPECIFIED = 0; + + // Compute Engine Persistent Disk snapshot based volume backup. + GCE_PERSISTENT_DISK = 1; + } + + // The current state of a VolumeBackup + enum State { + // This is an illegal state and should not be encountered. + STATE_UNSPECIFIED = 0; + + // A volume for the backup was identified and backup process is about to + // start. + CREATING = 1; + + // The volume backup operation has begun and is in the initial "snapshot" + // phase of the process. Any defined ProtectedApplication "pre" hooks will + // be executed before entering this state and "post" hooks will be executed + // upon leaving this state. + SNAPSHOTTING = 2; + + // The snapshot phase of the volume backup operation has completed and + // the snapshot is now being uploaded to backup storage. + UPLOADING = 3; + + // The volume backup operation has completed successfully. + SUCCEEDED = 4; + + // The volume backup operation has failed. + FAILED = 5; + + // This VolumeBackup resource (and its associated artifacts) is in the + // process of being deleted. + DELETING = 6; + } + + // Output only. The full name of the VolumeBackup resource. + // Format: projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated global unique identifier of + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this VolumeBackup resource was + // created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this VolumeBackup resource was last + // updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A reference to the source Kubernetes PVC from which this VolumeBackup + // was created. + NamespacedName source_pvc = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A storage system-specific opaque handle to the underlying volume backup. + string volume_backup_handle = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The format used for the volume backup. + VolumeBackupFormat format = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The aggregate size of the underlying artifacts associated with this + // VolumeBackup in the backup storage. This may change over time when + // multiple backups of the same volume share the same backup storage + // location. In particular, this is likely to increase in size when + // the immediately preceding backup of the same volume is deleted. + int64 storage_bytes = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The minimum size of the disk to which this VolumeBackup can be restored. + int64 disk_size_bytes = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the associated underlying volume backup + // operation completed. + google.protobuf.Timestamp complete_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of this VolumeBackup. + State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A human readable message explaining why the VolumeBackup is in its current + // state. + string state_message = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. `etag` is used for optimistic concurrency control as a way to help + // prevent simultaneous updates of a volume backup from overwriting each + // other. It is strongly suggested that systems make use of the `etag` in the + // read-modify-write cycle to perform volume backup updates in order to avoid + // race conditions. + string etag = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents the operation of restoring a volume from a VolumeBackup. +// Next id: 13 +message VolumeRestore { + option (google.api.resource) = { + type: "gkebackup.googleapis.com/VolumeRestore" + pattern: "projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}/volumeRestores/{volume_restore}" + }; + + // Supported volume types. + enum VolumeType { + // Default + VOLUME_TYPE_UNSPECIFIED = 0; + + // Compute Engine Persistent Disk volume + GCE_PERSISTENT_DISK = 1; + } + + // The current state of a VolumeRestore + enum State { + // This is an illegal state and should not be encountered. + STATE_UNSPECIFIED = 0; + + // A volume for the restore was identified and restore process is about to + // start. + CREATING = 1; + + // The volume is currently being restored. + RESTORING = 2; + + // The volume has been successfully restored. + SUCCEEDED = 3; + + // The volume restoration process failed. + FAILED = 4; + + // This VolumeRestore resource is in the process of being deleted. + DELETING = 5; + } + + // Output only. Full name of the VolumeRestore resource. + // Format: projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated global unique identifier of + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this VolumeRestore resource was + // created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this VolumeRestore resource was last + // updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The full name of the VolumeBackup from which the volume will be restored. + // Format: projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*. + string volume_backup = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The reference to the target Kubernetes PVC to be restored. + NamespacedName target_pvc = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A storage system-specific opaque handler to the underlying volume created + // for the target PVC from the volume backup. + string volume_handle = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of volume provisioned + VolumeType volume_type = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the associated underlying volume + // restoration completed. + google.protobuf.Timestamp complete_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of this VolumeRestore. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A human readable message explaining why the VolumeRestore is in its + // current state. + string state_message = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. `etag` is used for optimistic concurrency control as a way to help + // prevent simultaneous updates of a volume restore from overwriting each + // other. It is strongly suggested that systems make use of the `etag` in the + // read-modify-write cycle to perform volume restore updates in order to avoid + // race conditions. + string etag = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-gkebackup/protos/protos.d.ts b/packages/google-cloud-gkebackup/protos/protos.d.ts new file mode 100644 index 00000000000..870442450a0 --- /dev/null +++ b/packages/google-cloud-gkebackup/protos/protos.d.ts @@ -0,0 +1,11991 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 gkebackup. */ + namespace gkebackup { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup uid */ + uid?: (string|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup manual */ + manual?: (boolean|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup deleteLockDays */ + deleteLockDays?: (number|null); + + /** Backup deleteLockExpireTime */ + deleteLockExpireTime?: (google.protobuf.ITimestamp|null); + + /** Backup retainDays */ + retainDays?: (number|null); + + /** Backup retainExpireTime */ + retainExpireTime?: (google.protobuf.ITimestamp|null); + + /** Backup encryptionKey */ + encryptionKey?: (google.cloud.gkebackup.v1.IEncryptionKey|null); + + /** Backup allNamespaces */ + allNamespaces?: (boolean|null); + + /** Backup selectedNamespaces */ + selectedNamespaces?: (google.cloud.gkebackup.v1.INamespaces|null); + + /** Backup selectedApplications */ + selectedApplications?: (google.cloud.gkebackup.v1.INamespacedNames|null); + + /** Backup containsVolumeData */ + containsVolumeData?: (boolean|null); + + /** Backup containsSecrets */ + containsSecrets?: (boolean|null); + + /** Backup clusterMetadata */ + clusterMetadata?: (google.cloud.gkebackup.v1.Backup.IClusterMetadata|null); + + /** Backup state */ + state?: (google.cloud.gkebackup.v1.Backup.State|keyof typeof google.cloud.gkebackup.v1.Backup.State|null); + + /** Backup stateReason */ + stateReason?: (string|null); + + /** Backup completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + + /** Backup resourceCount */ + resourceCount?: (number|null); + + /** Backup volumeCount */ + volumeCount?: (number|null); + + /** Backup sizeBytes */ + sizeBytes?: (number|Long|string|null); + + /** Backup etag */ + etag?: (string|null); + + /** Backup description */ + description?: (string|null); + + /** Backup podCount */ + podCount?: (number|null); + + /** Backup configBackupSizeBytes */ + configBackupSizeBytes?: (number|Long|string|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup uid. */ + public uid: string; + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup manual. */ + public manual: boolean; + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup deleteLockDays. */ + public deleteLockDays: number; + + /** Backup deleteLockExpireTime. */ + public deleteLockExpireTime?: (google.protobuf.ITimestamp|null); + + /** Backup retainDays. */ + public retainDays: number; + + /** Backup retainExpireTime. */ + public retainExpireTime?: (google.protobuf.ITimestamp|null); + + /** Backup encryptionKey. */ + public encryptionKey?: (google.cloud.gkebackup.v1.IEncryptionKey|null); + + /** Backup allNamespaces. */ + public allNamespaces?: (boolean|null); + + /** Backup selectedNamespaces. */ + public selectedNamespaces?: (google.cloud.gkebackup.v1.INamespaces|null); + + /** Backup selectedApplications. */ + public selectedApplications?: (google.cloud.gkebackup.v1.INamespacedNames|null); + + /** Backup containsVolumeData. */ + public containsVolumeData: boolean; + + /** Backup containsSecrets. */ + public containsSecrets: boolean; + + /** Backup clusterMetadata. */ + public clusterMetadata?: (google.cloud.gkebackup.v1.Backup.IClusterMetadata|null); + + /** Backup state. */ + public state: (google.cloud.gkebackup.v1.Backup.State|keyof typeof google.cloud.gkebackup.v1.Backup.State); + + /** Backup stateReason. */ + public stateReason: string; + + /** Backup completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** Backup resourceCount. */ + public resourceCount: number; + + /** Backup volumeCount. */ + public volumeCount: number; + + /** Backup sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** Backup etag. */ + public etag: string; + + /** Backup description. */ + public description: string; + + /** Backup podCount. */ + public podCount: number; + + /** Backup configBackupSizeBytes. */ + public configBackupSizeBytes: (number|Long|string); + + /** Backup backupScope. */ + public backupScope?: ("allNamespaces"|"selectedNamespaces"|"selectedApplications"); + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IBackup): google.cloud.gkebackup.v1.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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 { + + /** Properties of a ClusterMetadata. */ + interface IClusterMetadata { + + /** ClusterMetadata cluster */ + cluster?: (string|null); + + /** ClusterMetadata k8sVersion */ + k8sVersion?: (string|null); + + /** ClusterMetadata backupCrdVersions */ + backupCrdVersions?: ({ [k: string]: string }|null); + + /** ClusterMetadata gkeVersion */ + gkeVersion?: (string|null); + + /** ClusterMetadata anthosVersion */ + anthosVersion?: (string|null); + } + + /** Represents a ClusterMetadata. */ + class ClusterMetadata implements IClusterMetadata { + + /** + * Constructs a new ClusterMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.Backup.IClusterMetadata); + + /** ClusterMetadata cluster. */ + public cluster: string; + + /** ClusterMetadata k8sVersion. */ + public k8sVersion: string; + + /** ClusterMetadata backupCrdVersions. */ + public backupCrdVersions: { [k: string]: string }; + + /** ClusterMetadata gkeVersion. */ + public gkeVersion?: (string|null); + + /** ClusterMetadata anthosVersion. */ + public anthosVersion?: (string|null); + + /** ClusterMetadata platformVersion. */ + public platformVersion?: ("gkeVersion"|"anthosVersion"); + + /** + * Creates a new ClusterMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterMetadata instance + */ + public static create(properties?: google.cloud.gkebackup.v1.Backup.IClusterMetadata): google.cloud.gkebackup.v1.Backup.ClusterMetadata; + + /** + * Encodes the specified ClusterMetadata message. Does not implicitly {@link google.cloud.gkebackup.v1.Backup.ClusterMetadata.verify|verify} messages. + * @param message ClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.Backup.IClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterMetadata message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.Backup.ClusterMetadata.verify|verify} messages. + * @param message ClusterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.Backup.IClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.Backup.ClusterMetadata; + + /** + * Decodes a ClusterMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.Backup.ClusterMetadata; + + /** + * Verifies a ClusterMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.Backup.ClusterMetadata; + + /** + * Creates a plain object from a ClusterMetadata message. Also converts values to other types if specified. + * @param message ClusterMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.Backup.ClusterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + IN_PROGRESS = 2, + SUCCEEDED = 3, + FAILED = 4, + DELETING = 5 + } + } + + /** Properties of a Namespaces. */ + interface INamespaces { + + /** Namespaces namespaces */ + namespaces?: (string[]|null); + } + + /** Represents a Namespaces. */ + class Namespaces implements INamespaces { + + /** + * Constructs a new Namespaces. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.INamespaces); + + /** Namespaces namespaces. */ + public namespaces: string[]; + + /** + * Creates a new Namespaces instance using the specified properties. + * @param [properties] Properties to set + * @returns Namespaces instance + */ + public static create(properties?: google.cloud.gkebackup.v1.INamespaces): google.cloud.gkebackup.v1.Namespaces; + + /** + * Encodes the specified Namespaces message. Does not implicitly {@link google.cloud.gkebackup.v1.Namespaces.verify|verify} messages. + * @param message Namespaces message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.INamespaces, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Namespaces message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.Namespaces.verify|verify} messages. + * @param message Namespaces message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.INamespaces, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Namespaces message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Namespaces + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.Namespaces; + + /** + * Decodes a Namespaces message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Namespaces + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.Namespaces; + + /** + * Verifies a Namespaces message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Namespaces message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Namespaces + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.Namespaces; + + /** + * Creates a plain object from a Namespaces message. Also converts values to other types if specified. + * @param message Namespaces + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.Namespaces, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Namespaces to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Namespaces + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NamespacedName. */ + interface INamespacedName { + + /** NamespacedName namespace */ + namespace?: (string|null); + + /** NamespacedName name */ + name?: (string|null); + } + + /** Represents a NamespacedName. */ + class NamespacedName implements INamespacedName { + + /** + * Constructs a new NamespacedName. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.INamespacedName); + + /** NamespacedName namespace. */ + public namespace: string; + + /** NamespacedName name. */ + public name: string; + + /** + * Creates a new NamespacedName instance using the specified properties. + * @param [properties] Properties to set + * @returns NamespacedName instance + */ + public static create(properties?: google.cloud.gkebackup.v1.INamespacedName): google.cloud.gkebackup.v1.NamespacedName; + + /** + * Encodes the specified NamespacedName message. Does not implicitly {@link google.cloud.gkebackup.v1.NamespacedName.verify|verify} messages. + * @param message NamespacedName message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.INamespacedName, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamespacedName message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.NamespacedName.verify|verify} messages. + * @param message NamespacedName message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.INamespacedName, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamespacedName message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamespacedName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.NamespacedName; + + /** + * Decodes a NamespacedName message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamespacedName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.NamespacedName; + + /** + * Verifies a NamespacedName message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamespacedName message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamespacedName + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.NamespacedName; + + /** + * Creates a plain object from a NamespacedName message. Also converts values to other types if specified. + * @param message NamespacedName + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.NamespacedName, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamespacedName to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamespacedName + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NamespacedNames. */ + interface INamespacedNames { + + /** NamespacedNames namespacedNames */ + namespacedNames?: (google.cloud.gkebackup.v1.INamespacedName[]|null); + } + + /** Represents a NamespacedNames. */ + class NamespacedNames implements INamespacedNames { + + /** + * Constructs a new NamespacedNames. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.INamespacedNames); + + /** NamespacedNames namespacedNames. */ + public namespacedNames: google.cloud.gkebackup.v1.INamespacedName[]; + + /** + * Creates a new NamespacedNames instance using the specified properties. + * @param [properties] Properties to set + * @returns NamespacedNames instance + */ + public static create(properties?: google.cloud.gkebackup.v1.INamespacedNames): google.cloud.gkebackup.v1.NamespacedNames; + + /** + * Encodes the specified NamespacedNames message. Does not implicitly {@link google.cloud.gkebackup.v1.NamespacedNames.verify|verify} messages. + * @param message NamespacedNames message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.INamespacedNames, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamespacedNames message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.NamespacedNames.verify|verify} messages. + * @param message NamespacedNames message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.INamespacedNames, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamespacedNames message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamespacedNames + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.NamespacedNames; + + /** + * Decodes a NamespacedNames message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamespacedNames + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.NamespacedNames; + + /** + * Verifies a NamespacedNames message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamespacedNames message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamespacedNames + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.NamespacedNames; + + /** + * Creates a plain object from a NamespacedNames message. Also converts values to other types if specified. + * @param message NamespacedNames + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.NamespacedNames, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamespacedNames to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamespacedNames + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionKey. */ + interface IEncryptionKey { + + /** EncryptionKey gcpKmsEncryptionKey */ + gcpKmsEncryptionKey?: (string|null); + } + + /** Represents an EncryptionKey. */ + class EncryptionKey implements IEncryptionKey { + + /** + * Constructs a new EncryptionKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IEncryptionKey); + + /** EncryptionKey gcpKmsEncryptionKey. */ + public gcpKmsEncryptionKey: string; + + /** + * Creates a new EncryptionKey instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionKey instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IEncryptionKey): google.cloud.gkebackup.v1.EncryptionKey; + + /** + * Encodes the specified EncryptionKey message. Does not implicitly {@link google.cloud.gkebackup.v1.EncryptionKey.verify|verify} messages. + * @param message EncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionKey message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.EncryptionKey.verify|verify} messages. + * @param message EncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.EncryptionKey; + + /** + * Decodes an EncryptionKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.EncryptionKey; + + /** + * Verifies an EncryptionKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.EncryptionKey; + + /** + * Creates a plain object from an EncryptionKey message. Also converts values to other types if specified. + * @param message EncryptionKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.EncryptionKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionKey + * @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 uid */ + uid?: (string|null); + + /** BackupPlan createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan description */ + description?: (string|null); + + /** BackupPlan cluster */ + cluster?: (string|null); + + /** BackupPlan retentionPolicy */ + retentionPolicy?: (google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy|null); + + /** BackupPlan labels */ + labels?: ({ [k: string]: string }|null); + + /** BackupPlan backupSchedule */ + backupSchedule?: (google.cloud.gkebackup.v1.BackupPlan.ISchedule|null); + + /** BackupPlan etag */ + etag?: (string|null); + + /** BackupPlan deactivated */ + deactivated?: (boolean|null); + + /** BackupPlan backupConfig */ + backupConfig?: (google.cloud.gkebackup.v1.BackupPlan.IBackupConfig|null); + + /** BackupPlan protectedPodCount */ + protectedPodCount?: (number|null); + } + + /** Represents a BackupPlan. */ + class BackupPlan implements IBackupPlan { + + /** + * Constructs a new BackupPlan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IBackupPlan); + + /** BackupPlan name. */ + public name: string; + + /** BackupPlan uid. */ + public uid: string; + + /** BackupPlan createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan description. */ + public description: string; + + /** BackupPlan cluster. */ + public cluster: string; + + /** BackupPlan retentionPolicy. */ + public retentionPolicy?: (google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy|null); + + /** BackupPlan labels. */ + public labels: { [k: string]: string }; + + /** BackupPlan backupSchedule. */ + public backupSchedule?: (google.cloud.gkebackup.v1.BackupPlan.ISchedule|null); + + /** BackupPlan etag. */ + public etag: string; + + /** BackupPlan deactivated. */ + public deactivated: boolean; + + /** BackupPlan backupConfig. */ + public backupConfig?: (google.cloud.gkebackup.v1.BackupPlan.IBackupConfig|null); + + /** BackupPlan protectedPodCount. */ + public protectedPodCount: number; + + /** + * Creates a new BackupPlan instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupPlan instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IBackupPlan): google.cloud.gkebackup.v1.BackupPlan; + + /** + * Encodes the specified BackupPlan message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IBackupPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupPlan message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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 { + + /** Properties of a RetentionPolicy. */ + interface IRetentionPolicy { + + /** RetentionPolicy backupDeleteLockDays */ + backupDeleteLockDays?: (number|null); + + /** RetentionPolicy backupRetainDays */ + backupRetainDays?: (number|null); + + /** RetentionPolicy locked */ + locked?: (boolean|null); + } + + /** Represents a RetentionPolicy. */ + class RetentionPolicy implements IRetentionPolicy { + + /** + * Constructs a new RetentionPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy); + + /** RetentionPolicy backupDeleteLockDays. */ + public backupDeleteLockDays: number; + + /** RetentionPolicy backupRetainDays. */ + public backupRetainDays: number; + + /** RetentionPolicy locked. */ + public locked: boolean; + + /** + * Creates a new RetentionPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns RetentionPolicy instance + */ + public static create(properties?: google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy): google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy; + + /** + * Encodes the specified RetentionPolicy message. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.verify|verify} messages. + * @param message RetentionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetentionPolicy message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.verify|verify} messages. + * @param message RetentionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetentionPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy; + + /** + * Decodes a RetentionPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy; + + /** + * Verifies a RetentionPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetentionPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetentionPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy; + + /** + * Creates a plain object from a RetentionPolicy message. Also converts values to other types if specified. + * @param message RetentionPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetentionPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetentionPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Schedule. */ + interface ISchedule { + + /** Schedule cronSchedule */ + cronSchedule?: (string|null); + + /** Schedule paused */ + paused?: (boolean|null); + } + + /** Represents a Schedule. */ + class Schedule implements ISchedule { + + /** + * Constructs a new Schedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.BackupPlan.ISchedule); + + /** Schedule cronSchedule. */ + public cronSchedule: string; + + /** Schedule paused. */ + public paused: boolean; + + /** + * Creates a new Schedule instance using the specified properties. + * @param [properties] Properties to set + * @returns Schedule instance + */ + public static create(properties?: google.cloud.gkebackup.v1.BackupPlan.ISchedule): google.cloud.gkebackup.v1.BackupPlan.Schedule; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.BackupPlan.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.BackupPlan.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.BackupPlan.Schedule; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.BackupPlan.Schedule; + + /** + * Verifies a Schedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.BackupPlan.Schedule; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @param message Schedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.BackupPlan.Schedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupConfig. */ + interface IBackupConfig { + + /** BackupConfig allNamespaces */ + allNamespaces?: (boolean|null); + + /** BackupConfig selectedNamespaces */ + selectedNamespaces?: (google.cloud.gkebackup.v1.INamespaces|null); + + /** BackupConfig selectedApplications */ + selectedApplications?: (google.cloud.gkebackup.v1.INamespacedNames|null); + + /** BackupConfig includeVolumeData */ + includeVolumeData?: (boolean|null); + + /** BackupConfig includeSecrets */ + includeSecrets?: (boolean|null); + + /** BackupConfig encryptionKey */ + encryptionKey?: (google.cloud.gkebackup.v1.IEncryptionKey|null); + } + + /** Represents a BackupConfig. */ + class BackupConfig implements IBackupConfig { + + /** + * Constructs a new BackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.BackupPlan.IBackupConfig); + + /** BackupConfig allNamespaces. */ + public allNamespaces?: (boolean|null); + + /** BackupConfig selectedNamespaces. */ + public selectedNamespaces?: (google.cloud.gkebackup.v1.INamespaces|null); + + /** BackupConfig selectedApplications. */ + public selectedApplications?: (google.cloud.gkebackup.v1.INamespacedNames|null); + + /** BackupConfig includeVolumeData. */ + public includeVolumeData: boolean; + + /** BackupConfig includeSecrets. */ + public includeSecrets: boolean; + + /** BackupConfig encryptionKey. */ + public encryptionKey?: (google.cloud.gkebackup.v1.IEncryptionKey|null); + + /** BackupConfig backupScope. */ + public backupScope?: ("allNamespaces"|"selectedNamespaces"|"selectedApplications"); + + /** + * Creates a new BackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupConfig instance + */ + public static create(properties?: google.cloud.gkebackup.v1.BackupPlan.IBackupConfig): google.cloud.gkebackup.v1.BackupPlan.BackupConfig; + + /** + * Encodes the specified BackupConfig message. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.BackupConfig.verify|verify} messages. + * @param message BackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.BackupPlan.IBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupConfig message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.BackupConfig.verify|verify} messages. + * @param message BackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.BackupPlan.IBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.BackupPlan.BackupConfig; + + /** + * Decodes a BackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.BackupPlan.BackupConfig; + + /** + * Verifies a BackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.BackupPlan.BackupConfig; + + /** + * Creates a plain object from a BackupConfig message. Also converts values to other types if specified. + * @param message BackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.BackupPlan.BackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a BackupForGKE */ + class BackupForGKE extends $protobuf.rpc.Service { + + /** + * Constructs a new BackupForGKE 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 BackupForGKE 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): BackupForGKE; + + /** + * 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.gkebackup.v1.ICreateBackupPlanRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.CreateBackupPlanCallback): void; + + /** + * Calls CreateBackupPlan. + * @param request CreateBackupPlanRequest message or plain object + * @returns Promise + */ + public createBackupPlan(request: google.cloud.gkebackup.v1.ICreateBackupPlanRequest): 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.gkebackup.v1.IListBackupPlansRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.ListBackupPlansCallback): void; + + /** + * Calls ListBackupPlans. + * @param request ListBackupPlansRequest message or plain object + * @returns Promise + */ + public listBackupPlans(request: google.cloud.gkebackup.v1.IListBackupPlansRequest): 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.gkebackup.v1.IGetBackupPlanRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.GetBackupPlanCallback): void; + + /** + * Calls GetBackupPlan. + * @param request GetBackupPlanRequest message or plain object + * @returns Promise + */ + public getBackupPlan(request: google.cloud.gkebackup.v1.IGetBackupPlanRequest): 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.gkebackup.v1.IUpdateBackupPlanRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.UpdateBackupPlanCallback): void; + + /** + * Calls UpdateBackupPlan. + * @param request UpdateBackupPlanRequest message or plain object + * @returns Promise + */ + public updateBackupPlan(request: google.cloud.gkebackup.v1.IUpdateBackupPlanRequest): 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.gkebackup.v1.IDeleteBackupPlanRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.DeleteBackupPlanCallback): void; + + /** + * Calls DeleteBackupPlan. + * @param request DeleteBackupPlanRequest message or plain object + * @returns Promise + */ + public deleteBackupPlan(request: google.cloud.gkebackup.v1.IDeleteBackupPlanRequest): Promise; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackup(request: google.cloud.gkebackup.v1.ICreateBackupRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.CreateBackupCallback): void; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise + */ + public createBackup(request: google.cloud.gkebackup.v1.ICreateBackupRequest): 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.gkebackup.v1.IListBackupsRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.cloud.gkebackup.v1.IListBackupsRequest): 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.gkebackup.v1.IGetBackupRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.cloud.gkebackup.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.gkebackup.v1.IUpdateBackupRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.cloud.gkebackup.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.gkebackup.v1.IDeleteBackupRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.cloud.gkebackup.v1.IDeleteBackupRequest): Promise; + + /** + * Calls ListVolumeBackups. + * @param request ListVolumeBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListVolumeBackupsResponse + */ + public listVolumeBackups(request: google.cloud.gkebackup.v1.IListVolumeBackupsRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.ListVolumeBackupsCallback): void; + + /** + * Calls ListVolumeBackups. + * @param request ListVolumeBackupsRequest message or plain object + * @returns Promise + */ + public listVolumeBackups(request: google.cloud.gkebackup.v1.IListVolumeBackupsRequest): Promise; + + /** + * Calls GetVolumeBackup. + * @param request GetVolumeBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VolumeBackup + */ + public getVolumeBackup(request: google.cloud.gkebackup.v1.IGetVolumeBackupRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.GetVolumeBackupCallback): void; + + /** + * Calls GetVolumeBackup. + * @param request GetVolumeBackupRequest message or plain object + * @returns Promise + */ + public getVolumeBackup(request: google.cloud.gkebackup.v1.IGetVolumeBackupRequest): Promise; + + /** + * Calls CreateRestorePlan. + * @param request CreateRestorePlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createRestorePlan(request: google.cloud.gkebackup.v1.ICreateRestorePlanRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.CreateRestorePlanCallback): void; + + /** + * Calls CreateRestorePlan. + * @param request CreateRestorePlanRequest message or plain object + * @returns Promise + */ + public createRestorePlan(request: google.cloud.gkebackup.v1.ICreateRestorePlanRequest): Promise; + + /** + * Calls ListRestorePlans. + * @param request ListRestorePlansRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRestorePlansResponse + */ + public listRestorePlans(request: google.cloud.gkebackup.v1.IListRestorePlansRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.ListRestorePlansCallback): void; + + /** + * Calls ListRestorePlans. + * @param request ListRestorePlansRequest message or plain object + * @returns Promise + */ + public listRestorePlans(request: google.cloud.gkebackup.v1.IListRestorePlansRequest): Promise; + + /** + * Calls GetRestorePlan. + * @param request GetRestorePlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RestorePlan + */ + public getRestorePlan(request: google.cloud.gkebackup.v1.IGetRestorePlanRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.GetRestorePlanCallback): void; + + /** + * Calls GetRestorePlan. + * @param request GetRestorePlanRequest message or plain object + * @returns Promise + */ + public getRestorePlan(request: google.cloud.gkebackup.v1.IGetRestorePlanRequest): Promise; + + /** + * Calls UpdateRestorePlan. + * @param request UpdateRestorePlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateRestorePlan(request: google.cloud.gkebackup.v1.IUpdateRestorePlanRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.UpdateRestorePlanCallback): void; + + /** + * Calls UpdateRestorePlan. + * @param request UpdateRestorePlanRequest message or plain object + * @returns Promise + */ + public updateRestorePlan(request: google.cloud.gkebackup.v1.IUpdateRestorePlanRequest): Promise; + + /** + * Calls DeleteRestorePlan. + * @param request DeleteRestorePlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteRestorePlan(request: google.cloud.gkebackup.v1.IDeleteRestorePlanRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.DeleteRestorePlanCallback): void; + + /** + * Calls DeleteRestorePlan. + * @param request DeleteRestorePlanRequest message or plain object + * @returns Promise + */ + public deleteRestorePlan(request: google.cloud.gkebackup.v1.IDeleteRestorePlanRequest): Promise; + + /** + * Calls CreateRestore. + * @param request CreateRestoreRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createRestore(request: google.cloud.gkebackup.v1.ICreateRestoreRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.CreateRestoreCallback): void; + + /** + * Calls CreateRestore. + * @param request CreateRestoreRequest message or plain object + * @returns Promise + */ + public createRestore(request: google.cloud.gkebackup.v1.ICreateRestoreRequest): Promise; + + /** + * Calls ListRestores. + * @param request ListRestoresRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRestoresResponse + */ + public listRestores(request: google.cloud.gkebackup.v1.IListRestoresRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.ListRestoresCallback): void; + + /** + * Calls ListRestores. + * @param request ListRestoresRequest message or plain object + * @returns Promise + */ + public listRestores(request: google.cloud.gkebackup.v1.IListRestoresRequest): Promise; + + /** + * Calls GetRestore. + * @param request GetRestoreRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Restore + */ + public getRestore(request: google.cloud.gkebackup.v1.IGetRestoreRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.GetRestoreCallback): void; + + /** + * Calls GetRestore. + * @param request GetRestoreRequest message or plain object + * @returns Promise + */ + public getRestore(request: google.cloud.gkebackup.v1.IGetRestoreRequest): Promise; + + /** + * Calls UpdateRestore. + * @param request UpdateRestoreRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateRestore(request: google.cloud.gkebackup.v1.IUpdateRestoreRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.UpdateRestoreCallback): void; + + /** + * Calls UpdateRestore. + * @param request UpdateRestoreRequest message or plain object + * @returns Promise + */ + public updateRestore(request: google.cloud.gkebackup.v1.IUpdateRestoreRequest): Promise; + + /** + * Calls DeleteRestore. + * @param request DeleteRestoreRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteRestore(request: google.cloud.gkebackup.v1.IDeleteRestoreRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.DeleteRestoreCallback): void; + + /** + * Calls DeleteRestore. + * @param request DeleteRestoreRequest message or plain object + * @returns Promise + */ + public deleteRestore(request: google.cloud.gkebackup.v1.IDeleteRestoreRequest): Promise; + + /** + * Calls ListVolumeRestores. + * @param request ListVolumeRestoresRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListVolumeRestoresResponse + */ + public listVolumeRestores(request: google.cloud.gkebackup.v1.IListVolumeRestoresRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.ListVolumeRestoresCallback): void; + + /** + * Calls ListVolumeRestores. + * @param request ListVolumeRestoresRequest message or plain object + * @returns Promise + */ + public listVolumeRestores(request: google.cloud.gkebackup.v1.IListVolumeRestoresRequest): Promise; + + /** + * Calls GetVolumeRestore. + * @param request GetVolumeRestoreRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VolumeRestore + */ + public getVolumeRestore(request: google.cloud.gkebackup.v1.IGetVolumeRestoreRequest, callback: google.cloud.gkebackup.v1.BackupForGKE.GetVolumeRestoreCallback): void; + + /** + * Calls GetVolumeRestore. + * @param request GetVolumeRestoreRequest message or plain object + * @returns Promise + */ + public getVolumeRestore(request: google.cloud.gkebackup.v1.IGetVolumeRestoreRequest): Promise; + } + + namespace BackupForGKE { + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|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.gkebackup.v1.BackupForGKE|listBackupPlans}. + * @param error Error, if any + * @param [response] ListBackupPlansResponse + */ + type ListBackupPlansCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.ListBackupPlansResponse) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getBackupPlan}. + * @param error Error, if any + * @param [response] BackupPlan + */ + type GetBackupPlanCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.BackupPlan) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|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.gkebackup.v1.BackupForGKE|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.gkebackup.v1.BackupForGKE|createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.Backup) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|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.gkebackup.v1.BackupForGKE|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.gkebackup.v1.BackupForGKE|listVolumeBackups}. + * @param error Error, if any + * @param [response] ListVolumeBackupsResponse + */ + type ListVolumeBackupsCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.ListVolumeBackupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getVolumeBackup}. + * @param error Error, if any + * @param [response] VolumeBackup + */ + type GetVolumeBackupCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.VolumeBackup) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|createRestorePlan}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateRestorePlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|listRestorePlans}. + * @param error Error, if any + * @param [response] ListRestorePlansResponse + */ + type ListRestorePlansCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.ListRestorePlansResponse) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getRestorePlan}. + * @param error Error, if any + * @param [response] RestorePlan + */ + type GetRestorePlanCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.RestorePlan) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|updateRestorePlan}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateRestorePlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|deleteRestorePlan}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteRestorePlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|createRestore}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateRestoreCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|listRestores}. + * @param error Error, if any + * @param [response] ListRestoresResponse + */ + type ListRestoresCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.ListRestoresResponse) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getRestore}. + * @param error Error, if any + * @param [response] Restore + */ + type GetRestoreCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.Restore) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|updateRestore}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateRestoreCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|deleteRestore}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteRestoreCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|listVolumeRestores}. + * @param error Error, if any + * @param [response] ListVolumeRestoresResponse + */ + type ListVolumeRestoresCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.ListVolumeRestoresResponse) => void; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getVolumeRestore}. + * @param error Error, if any + * @param [response] VolumeRestore + */ + type GetVolumeRestoreCallback = (error: (Error|null), response?: google.cloud.gkebackup.v1.VolumeRestore) => void; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IOperationMetadata): google.cloud.gkebackup.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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 CreateBackupPlanRequest. */ + interface ICreateBackupPlanRequest { + + /** CreateBackupPlanRequest parent */ + parent?: (string|null); + + /** CreateBackupPlanRequest backupPlan */ + backupPlan?: (google.cloud.gkebackup.v1.IBackupPlan|null); + + /** CreateBackupPlanRequest backupPlanId */ + backupPlanId?: (string|null); + } + + /** Represents a CreateBackupPlanRequest. */ + class CreateBackupPlanRequest implements ICreateBackupPlanRequest { + + /** + * Constructs a new CreateBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.ICreateBackupPlanRequest); + + /** CreateBackupPlanRequest parent. */ + public parent: string; + + /** CreateBackupPlanRequest backupPlan. */ + public backupPlan?: (google.cloud.gkebackup.v1.IBackupPlan|null); + + /** CreateBackupPlanRequest backupPlanId. */ + public backupPlanId: string; + + /** + * Creates a new CreateBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupPlanRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.ICreateBackupPlanRequest): google.cloud.gkebackup.v1.CreateBackupPlanRequest; + + /** + * Encodes the specified CreateBackupPlanRequest message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.ICreateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.v1.IListBackupPlansRequest): google.cloud.gkebackup.v1.ListBackupPlansRequest; + + /** + * Encodes the specified ListBackupPlansRequest message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IListBackupPlansRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlansRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.v1.IListBackupPlansResponse); + + /** ListBackupPlansResponse backupPlans. */ + public backupPlans: google.cloud.gkebackup.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.gkebackup.v1.IListBackupPlansResponse): google.cloud.gkebackup.v1.ListBackupPlansResponse; + + /** + * Encodes the specified ListBackupPlansResponse message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IListBackupPlansResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlansResponse message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.v1.IGetBackupPlanRequest): google.cloud.gkebackup.v1.GetBackupPlanRequest; + + /** + * Encodes the specified GetBackupPlanRequest message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IGetBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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 an UpdateBackupPlanRequest. */ + interface IUpdateBackupPlanRequest { + + /** UpdateBackupPlanRequest backupPlan */ + backupPlan?: (google.cloud.gkebackup.v1.IBackupPlan|null); + + /** UpdateBackupPlanRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBackupPlanRequest. */ + class UpdateBackupPlanRequest implements IUpdateBackupPlanRequest { + + /** + * Constructs a new UpdateBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IUpdateBackupPlanRequest); + + /** UpdateBackupPlanRequest backupPlan. */ + public backupPlan?: (google.cloud.gkebackup.v1.IBackupPlan|null); + + /** UpdateBackupPlanRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupPlanRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IUpdateBackupPlanRequest): google.cloud.gkebackup.v1.UpdateBackupPlanRequest; + + /** + * Encodes the specified UpdateBackupPlanRequest message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IUpdateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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 DeleteBackupPlanRequest. */ + interface IDeleteBackupPlanRequest { + + /** DeleteBackupPlanRequest name */ + name?: (string|null); + + /** DeleteBackupPlanRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteBackupPlanRequest. */ + class DeleteBackupPlanRequest implements IDeleteBackupPlanRequest { + + /** + * Constructs a new DeleteBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IDeleteBackupPlanRequest); + + /** DeleteBackupPlanRequest name. */ + public name: string; + + /** DeleteBackupPlanRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupPlanRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IDeleteBackupPlanRequest): google.cloud.gkebackup.v1.DeleteBackupPlanRequest; + + /** + * Encodes the specified DeleteBackupPlanRequest message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IDeleteBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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 a CreateBackupRequest. */ + interface ICreateBackupRequest { + + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.cloud.gkebackup.v1.IBackup|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + } + + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { + + /** + * Constructs a new CreateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.ICreateBackupRequest); + + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.cloud.gkebackup.v1.IBackup|null); + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.ICreateBackupRequest): google.cloud.gkebackup.v1.CreateBackupRequest; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.CreateBackupRequest; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.CreateBackupRequest; + + /** + * Verifies a CreateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.CreateBackupRequest; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupRequest + * @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); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.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; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IListBackupsRequest): google.cloud.gkebackup.v1.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.v1.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.cloud.gkebackup.v1.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IListBackupsResponse): google.cloud.gkebackup.v1.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IGetBackupRequest): google.cloud.gkebackup.v1.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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 backup */ + backup?: (google.cloud.gkebackup.v1.IBackup|null); + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IUpdateBackupRequest); + + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.gkebackup.v1.IBackup|null); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IUpdateBackupRequest): google.cloud.gkebackup.v1.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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 etag */ + etag?: (string|null); + + /** DeleteBackupRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** DeleteBackupRequest etag. */ + public etag: string; + + /** DeleteBackupRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IDeleteBackupRequest): google.cloud.gkebackup.v1.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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 ListVolumeBackupsRequest. */ + interface IListVolumeBackupsRequest { + + /** ListVolumeBackupsRequest parent */ + parent?: (string|null); + + /** ListVolumeBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListVolumeBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListVolumeBackupsRequest filter */ + filter?: (string|null); + + /** ListVolumeBackupsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListVolumeBackupsRequest. */ + class ListVolumeBackupsRequest implements IListVolumeBackupsRequest { + + /** + * Constructs a new ListVolumeBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IListVolumeBackupsRequest); + + /** ListVolumeBackupsRequest parent. */ + public parent: string; + + /** ListVolumeBackupsRequest pageSize. */ + public pageSize: number; + + /** ListVolumeBackupsRequest pageToken. */ + public pageToken: string; + + /** ListVolumeBackupsRequest filter. */ + public filter: string; + + /** ListVolumeBackupsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListVolumeBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVolumeBackupsRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IListVolumeBackupsRequest): google.cloud.gkebackup.v1.ListVolumeBackupsRequest; + + /** + * Encodes the specified ListVolumeBackupsRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeBackupsRequest.verify|verify} messages. + * @param message ListVolumeBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IListVolumeBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVolumeBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeBackupsRequest.verify|verify} messages. + * @param message ListVolumeBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IListVolumeBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVolumeBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVolumeBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.ListVolumeBackupsRequest; + + /** + * Decodes a ListVolumeBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVolumeBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.ListVolumeBackupsRequest; + + /** + * Verifies a ListVolumeBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVolumeBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVolumeBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.ListVolumeBackupsRequest; + + /** + * Creates a plain object from a ListVolumeBackupsRequest message. Also converts values to other types if specified. + * @param message ListVolumeBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.ListVolumeBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVolumeBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVolumeBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVolumeBackupsResponse. */ + interface IListVolumeBackupsResponse { + + /** ListVolumeBackupsResponse volumeBackups */ + volumeBackups?: (google.cloud.gkebackup.v1.IVolumeBackup[]|null); + + /** ListVolumeBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListVolumeBackupsResponse. */ + class ListVolumeBackupsResponse implements IListVolumeBackupsResponse { + + /** + * Constructs a new ListVolumeBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IListVolumeBackupsResponse); + + /** ListVolumeBackupsResponse volumeBackups. */ + public volumeBackups: google.cloud.gkebackup.v1.IVolumeBackup[]; + + /** ListVolumeBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListVolumeBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVolumeBackupsResponse instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IListVolumeBackupsResponse): google.cloud.gkebackup.v1.ListVolumeBackupsResponse; + + /** + * Encodes the specified ListVolumeBackupsResponse message. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeBackupsResponse.verify|verify} messages. + * @param message ListVolumeBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IListVolumeBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVolumeBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeBackupsResponse.verify|verify} messages. + * @param message ListVolumeBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IListVolumeBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVolumeBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVolumeBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.ListVolumeBackupsResponse; + + /** + * Decodes a ListVolumeBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVolumeBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.ListVolumeBackupsResponse; + + /** + * Verifies a ListVolumeBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVolumeBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVolumeBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.ListVolumeBackupsResponse; + + /** + * Creates a plain object from a ListVolumeBackupsResponse message. Also converts values to other types if specified. + * @param message ListVolumeBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.ListVolumeBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVolumeBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVolumeBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetVolumeBackupRequest. */ + interface IGetVolumeBackupRequest { + + /** GetVolumeBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetVolumeBackupRequest. */ + class GetVolumeBackupRequest implements IGetVolumeBackupRequest { + + /** + * Constructs a new GetVolumeBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IGetVolumeBackupRequest); + + /** GetVolumeBackupRequest name. */ + public name: string; + + /** + * Creates a new GetVolumeBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVolumeBackupRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IGetVolumeBackupRequest): google.cloud.gkebackup.v1.GetVolumeBackupRequest; + + /** + * Encodes the specified GetVolumeBackupRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.GetVolumeBackupRequest.verify|verify} messages. + * @param message GetVolumeBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IGetVolumeBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVolumeBackupRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.GetVolumeBackupRequest.verify|verify} messages. + * @param message GetVolumeBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IGetVolumeBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVolumeBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVolumeBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.GetVolumeBackupRequest; + + /** + * Decodes a GetVolumeBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVolumeBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.GetVolumeBackupRequest; + + /** + * Verifies a GetVolumeBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetVolumeBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVolumeBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.GetVolumeBackupRequest; + + /** + * Creates a plain object from a GetVolumeBackupRequest message. Also converts values to other types if specified. + * @param message GetVolumeBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.GetVolumeBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVolumeBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetVolumeBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateRestorePlanRequest. */ + interface ICreateRestorePlanRequest { + + /** CreateRestorePlanRequest parent */ + parent?: (string|null); + + /** CreateRestorePlanRequest restorePlan */ + restorePlan?: (google.cloud.gkebackup.v1.IRestorePlan|null); + + /** CreateRestorePlanRequest restorePlanId */ + restorePlanId?: (string|null); + } + + /** Represents a CreateRestorePlanRequest. */ + class CreateRestorePlanRequest implements ICreateRestorePlanRequest { + + /** + * Constructs a new CreateRestorePlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.ICreateRestorePlanRequest); + + /** CreateRestorePlanRequest parent. */ + public parent: string; + + /** CreateRestorePlanRequest restorePlan. */ + public restorePlan?: (google.cloud.gkebackup.v1.IRestorePlan|null); + + /** CreateRestorePlanRequest restorePlanId. */ + public restorePlanId: string; + + /** + * Creates a new CreateRestorePlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRestorePlanRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.ICreateRestorePlanRequest): google.cloud.gkebackup.v1.CreateRestorePlanRequest; + + /** + * Encodes the specified CreateRestorePlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.CreateRestorePlanRequest.verify|verify} messages. + * @param message CreateRestorePlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.ICreateRestorePlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRestorePlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.CreateRestorePlanRequest.verify|verify} messages. + * @param message CreateRestorePlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.ICreateRestorePlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRestorePlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.CreateRestorePlanRequest; + + /** + * Decodes a CreateRestorePlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.CreateRestorePlanRequest; + + /** + * Verifies a CreateRestorePlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateRestorePlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRestorePlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.CreateRestorePlanRequest; + + /** + * Creates a plain object from a CreateRestorePlanRequest message. Also converts values to other types if specified. + * @param message CreateRestorePlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.CreateRestorePlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRestorePlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRestorePlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRestorePlansRequest. */ + interface IListRestorePlansRequest { + + /** ListRestorePlansRequest parent */ + parent?: (string|null); + + /** ListRestorePlansRequest pageSize */ + pageSize?: (number|null); + + /** ListRestorePlansRequest pageToken */ + pageToken?: (string|null); + + /** ListRestorePlansRequest filter */ + filter?: (string|null); + + /** ListRestorePlansRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListRestorePlansRequest. */ + class ListRestorePlansRequest implements IListRestorePlansRequest { + + /** + * Constructs a new ListRestorePlansRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IListRestorePlansRequest); + + /** ListRestorePlansRequest parent. */ + public parent: string; + + /** ListRestorePlansRequest pageSize. */ + public pageSize: number; + + /** ListRestorePlansRequest pageToken. */ + public pageToken: string; + + /** ListRestorePlansRequest filter. */ + public filter: string; + + /** ListRestorePlansRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListRestorePlansRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRestorePlansRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IListRestorePlansRequest): google.cloud.gkebackup.v1.ListRestorePlansRequest; + + /** + * Encodes the specified ListRestorePlansRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestorePlansRequest.verify|verify} messages. + * @param message ListRestorePlansRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IListRestorePlansRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRestorePlansRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestorePlansRequest.verify|verify} messages. + * @param message ListRestorePlansRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IListRestorePlansRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRestorePlansRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRestorePlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.ListRestorePlansRequest; + + /** + * Decodes a ListRestorePlansRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRestorePlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.ListRestorePlansRequest; + + /** + * Verifies a ListRestorePlansRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRestorePlansRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRestorePlansRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.ListRestorePlansRequest; + + /** + * Creates a plain object from a ListRestorePlansRequest message. Also converts values to other types if specified. + * @param message ListRestorePlansRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.ListRestorePlansRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRestorePlansRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRestorePlansRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRestorePlansResponse. */ + interface IListRestorePlansResponse { + + /** ListRestorePlansResponse restorePlans */ + restorePlans?: (google.cloud.gkebackup.v1.IRestorePlan[]|null); + + /** ListRestorePlansResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListRestorePlansResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListRestorePlansResponse. */ + class ListRestorePlansResponse implements IListRestorePlansResponse { + + /** + * Constructs a new ListRestorePlansResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IListRestorePlansResponse); + + /** ListRestorePlansResponse restorePlans. */ + public restorePlans: google.cloud.gkebackup.v1.IRestorePlan[]; + + /** ListRestorePlansResponse nextPageToken. */ + public nextPageToken: string; + + /** ListRestorePlansResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListRestorePlansResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRestorePlansResponse instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IListRestorePlansResponse): google.cloud.gkebackup.v1.ListRestorePlansResponse; + + /** + * Encodes the specified ListRestorePlansResponse message. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestorePlansResponse.verify|verify} messages. + * @param message ListRestorePlansResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IListRestorePlansResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRestorePlansResponse message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestorePlansResponse.verify|verify} messages. + * @param message ListRestorePlansResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IListRestorePlansResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRestorePlansResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRestorePlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.ListRestorePlansResponse; + + /** + * Decodes a ListRestorePlansResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRestorePlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.ListRestorePlansResponse; + + /** + * Verifies a ListRestorePlansResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRestorePlansResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRestorePlansResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.ListRestorePlansResponse; + + /** + * Creates a plain object from a ListRestorePlansResponse message. Also converts values to other types if specified. + * @param message ListRestorePlansResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.ListRestorePlansResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRestorePlansResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRestorePlansResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRestorePlanRequest. */ + interface IGetRestorePlanRequest { + + /** GetRestorePlanRequest name */ + name?: (string|null); + } + + /** Represents a GetRestorePlanRequest. */ + class GetRestorePlanRequest implements IGetRestorePlanRequest { + + /** + * Constructs a new GetRestorePlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IGetRestorePlanRequest); + + /** GetRestorePlanRequest name. */ + public name: string; + + /** + * Creates a new GetRestorePlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRestorePlanRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IGetRestorePlanRequest): google.cloud.gkebackup.v1.GetRestorePlanRequest; + + /** + * Encodes the specified GetRestorePlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.GetRestorePlanRequest.verify|verify} messages. + * @param message GetRestorePlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IGetRestorePlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRestorePlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.GetRestorePlanRequest.verify|verify} messages. + * @param message GetRestorePlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IGetRestorePlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRestorePlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.GetRestorePlanRequest; + + /** + * Decodes a GetRestorePlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.GetRestorePlanRequest; + + /** + * Verifies a GetRestorePlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRestorePlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRestorePlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.GetRestorePlanRequest; + + /** + * Creates a plain object from a GetRestorePlanRequest message. Also converts values to other types if specified. + * @param message GetRestorePlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.GetRestorePlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRestorePlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRestorePlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateRestorePlanRequest. */ + interface IUpdateRestorePlanRequest { + + /** UpdateRestorePlanRequest restorePlan */ + restorePlan?: (google.cloud.gkebackup.v1.IRestorePlan|null); + + /** UpdateRestorePlanRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateRestorePlanRequest. */ + class UpdateRestorePlanRequest implements IUpdateRestorePlanRequest { + + /** + * Constructs a new UpdateRestorePlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IUpdateRestorePlanRequest); + + /** UpdateRestorePlanRequest restorePlan. */ + public restorePlan?: (google.cloud.gkebackup.v1.IRestorePlan|null); + + /** UpdateRestorePlanRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateRestorePlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRestorePlanRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IUpdateRestorePlanRequest): google.cloud.gkebackup.v1.UpdateRestorePlanRequest; + + /** + * Encodes the specified UpdateRestorePlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateRestorePlanRequest.verify|verify} messages. + * @param message UpdateRestorePlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IUpdateRestorePlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRestorePlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateRestorePlanRequest.verify|verify} messages. + * @param message UpdateRestorePlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IUpdateRestorePlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRestorePlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.UpdateRestorePlanRequest; + + /** + * Decodes an UpdateRestorePlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.UpdateRestorePlanRequest; + + /** + * Verifies an UpdateRestorePlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRestorePlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRestorePlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.UpdateRestorePlanRequest; + + /** + * Creates a plain object from an UpdateRestorePlanRequest message. Also converts values to other types if specified. + * @param message UpdateRestorePlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.UpdateRestorePlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRestorePlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateRestorePlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRestorePlanRequest. */ + interface IDeleteRestorePlanRequest { + + /** DeleteRestorePlanRequest name */ + name?: (string|null); + + /** DeleteRestorePlanRequest etag */ + etag?: (string|null); + + /** DeleteRestorePlanRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteRestorePlanRequest. */ + class DeleteRestorePlanRequest implements IDeleteRestorePlanRequest { + + /** + * Constructs a new DeleteRestorePlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IDeleteRestorePlanRequest); + + /** DeleteRestorePlanRequest name. */ + public name: string; + + /** DeleteRestorePlanRequest etag. */ + public etag: string; + + /** DeleteRestorePlanRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteRestorePlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRestorePlanRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IDeleteRestorePlanRequest): google.cloud.gkebackup.v1.DeleteRestorePlanRequest; + + /** + * Encodes the specified DeleteRestorePlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteRestorePlanRequest.verify|verify} messages. + * @param message DeleteRestorePlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IDeleteRestorePlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRestorePlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteRestorePlanRequest.verify|verify} messages. + * @param message DeleteRestorePlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IDeleteRestorePlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRestorePlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.DeleteRestorePlanRequest; + + /** + * Decodes a DeleteRestorePlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.DeleteRestorePlanRequest; + + /** + * Verifies a DeleteRestorePlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRestorePlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRestorePlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.DeleteRestorePlanRequest; + + /** + * Creates a plain object from a DeleteRestorePlanRequest message. Also converts values to other types if specified. + * @param message DeleteRestorePlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.DeleteRestorePlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRestorePlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRestorePlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateRestoreRequest. */ + interface ICreateRestoreRequest { + + /** CreateRestoreRequest parent */ + parent?: (string|null); + + /** CreateRestoreRequest restore */ + restore?: (google.cloud.gkebackup.v1.IRestore|null); + + /** CreateRestoreRequest restoreId */ + restoreId?: (string|null); + } + + /** Represents a CreateRestoreRequest. */ + class CreateRestoreRequest implements ICreateRestoreRequest { + + /** + * Constructs a new CreateRestoreRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.ICreateRestoreRequest); + + /** CreateRestoreRequest parent. */ + public parent: string; + + /** CreateRestoreRequest restore. */ + public restore?: (google.cloud.gkebackup.v1.IRestore|null); + + /** CreateRestoreRequest restoreId. */ + public restoreId: string; + + /** + * Creates a new CreateRestoreRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRestoreRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.ICreateRestoreRequest): google.cloud.gkebackup.v1.CreateRestoreRequest; + + /** + * Encodes the specified CreateRestoreRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.CreateRestoreRequest.verify|verify} messages. + * @param message CreateRestoreRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.ICreateRestoreRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRestoreRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.CreateRestoreRequest.verify|verify} messages. + * @param message CreateRestoreRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.ICreateRestoreRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRestoreRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.CreateRestoreRequest; + + /** + * Decodes a CreateRestoreRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.CreateRestoreRequest; + + /** + * Verifies a CreateRestoreRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateRestoreRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRestoreRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.CreateRestoreRequest; + + /** + * Creates a plain object from a CreateRestoreRequest message. Also converts values to other types if specified. + * @param message CreateRestoreRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.CreateRestoreRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRestoreRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRestoreRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRestoresRequest. */ + interface IListRestoresRequest { + + /** ListRestoresRequest parent */ + parent?: (string|null); + + /** ListRestoresRequest pageSize */ + pageSize?: (number|null); + + /** ListRestoresRequest pageToken */ + pageToken?: (string|null); + + /** ListRestoresRequest filter */ + filter?: (string|null); + + /** ListRestoresRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListRestoresRequest. */ + class ListRestoresRequest implements IListRestoresRequest { + + /** + * Constructs a new ListRestoresRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IListRestoresRequest); + + /** ListRestoresRequest parent. */ + public parent: string; + + /** ListRestoresRequest pageSize. */ + public pageSize: number; + + /** ListRestoresRequest pageToken. */ + public pageToken: string; + + /** ListRestoresRequest filter. */ + public filter: string; + + /** ListRestoresRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListRestoresRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRestoresRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IListRestoresRequest): google.cloud.gkebackup.v1.ListRestoresRequest; + + /** + * Encodes the specified ListRestoresRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestoresRequest.verify|verify} messages. + * @param message ListRestoresRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IListRestoresRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRestoresRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestoresRequest.verify|verify} messages. + * @param message ListRestoresRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IListRestoresRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRestoresRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRestoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.ListRestoresRequest; + + /** + * Decodes a ListRestoresRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRestoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.ListRestoresRequest; + + /** + * Verifies a ListRestoresRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRestoresRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRestoresRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.ListRestoresRequest; + + /** + * Creates a plain object from a ListRestoresRequest message. Also converts values to other types if specified. + * @param message ListRestoresRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.ListRestoresRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRestoresRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRestoresRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRestoresResponse. */ + interface IListRestoresResponse { + + /** ListRestoresResponse restores */ + restores?: (google.cloud.gkebackup.v1.IRestore[]|null); + + /** ListRestoresResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListRestoresResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListRestoresResponse. */ + class ListRestoresResponse implements IListRestoresResponse { + + /** + * Constructs a new ListRestoresResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IListRestoresResponse); + + /** ListRestoresResponse restores. */ + public restores: google.cloud.gkebackup.v1.IRestore[]; + + /** ListRestoresResponse nextPageToken. */ + public nextPageToken: string; + + /** ListRestoresResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListRestoresResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRestoresResponse instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IListRestoresResponse): google.cloud.gkebackup.v1.ListRestoresResponse; + + /** + * Encodes the specified ListRestoresResponse message. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestoresResponse.verify|verify} messages. + * @param message ListRestoresResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IListRestoresResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRestoresResponse message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestoresResponse.verify|verify} messages. + * @param message ListRestoresResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IListRestoresResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRestoresResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRestoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.ListRestoresResponse; + + /** + * Decodes a ListRestoresResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRestoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.ListRestoresResponse; + + /** + * Verifies a ListRestoresResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRestoresResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRestoresResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.ListRestoresResponse; + + /** + * Creates a plain object from a ListRestoresResponse message. Also converts values to other types if specified. + * @param message ListRestoresResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.ListRestoresResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRestoresResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRestoresResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRestoreRequest. */ + interface IGetRestoreRequest { + + /** GetRestoreRequest name */ + name?: (string|null); + } + + /** Represents a GetRestoreRequest. */ + class GetRestoreRequest implements IGetRestoreRequest { + + /** + * Constructs a new GetRestoreRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IGetRestoreRequest); + + /** GetRestoreRequest name. */ + public name: string; + + /** + * Creates a new GetRestoreRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRestoreRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IGetRestoreRequest): google.cloud.gkebackup.v1.GetRestoreRequest; + + /** + * Encodes the specified GetRestoreRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.GetRestoreRequest.verify|verify} messages. + * @param message GetRestoreRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IGetRestoreRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRestoreRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.GetRestoreRequest.verify|verify} messages. + * @param message GetRestoreRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IGetRestoreRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRestoreRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.GetRestoreRequest; + + /** + * Decodes a GetRestoreRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.GetRestoreRequest; + + /** + * Verifies a GetRestoreRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRestoreRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRestoreRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.GetRestoreRequest; + + /** + * Creates a plain object from a GetRestoreRequest message. Also converts values to other types if specified. + * @param message GetRestoreRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.GetRestoreRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRestoreRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRestoreRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateRestoreRequest. */ + interface IUpdateRestoreRequest { + + /** UpdateRestoreRequest restore */ + restore?: (google.cloud.gkebackup.v1.IRestore|null); + + /** UpdateRestoreRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateRestoreRequest. */ + class UpdateRestoreRequest implements IUpdateRestoreRequest { + + /** + * Constructs a new UpdateRestoreRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IUpdateRestoreRequest); + + /** UpdateRestoreRequest restore. */ + public restore?: (google.cloud.gkebackup.v1.IRestore|null); + + /** UpdateRestoreRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateRestoreRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRestoreRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IUpdateRestoreRequest): google.cloud.gkebackup.v1.UpdateRestoreRequest; + + /** + * Encodes the specified UpdateRestoreRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateRestoreRequest.verify|verify} messages. + * @param message UpdateRestoreRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IUpdateRestoreRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRestoreRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateRestoreRequest.verify|verify} messages. + * @param message UpdateRestoreRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IUpdateRestoreRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRestoreRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.UpdateRestoreRequest; + + /** + * Decodes an UpdateRestoreRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.UpdateRestoreRequest; + + /** + * Verifies an UpdateRestoreRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRestoreRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRestoreRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.UpdateRestoreRequest; + + /** + * Creates a plain object from an UpdateRestoreRequest message. Also converts values to other types if specified. + * @param message UpdateRestoreRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.UpdateRestoreRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRestoreRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateRestoreRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRestoreRequest. */ + interface IDeleteRestoreRequest { + + /** DeleteRestoreRequest name */ + name?: (string|null); + + /** DeleteRestoreRequest etag */ + etag?: (string|null); + + /** DeleteRestoreRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteRestoreRequest. */ + class DeleteRestoreRequest implements IDeleteRestoreRequest { + + /** + * Constructs a new DeleteRestoreRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IDeleteRestoreRequest); + + /** DeleteRestoreRequest name. */ + public name: string; + + /** DeleteRestoreRequest etag. */ + public etag: string; + + /** DeleteRestoreRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteRestoreRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRestoreRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IDeleteRestoreRequest): google.cloud.gkebackup.v1.DeleteRestoreRequest; + + /** + * Encodes the specified DeleteRestoreRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteRestoreRequest.verify|verify} messages. + * @param message DeleteRestoreRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IDeleteRestoreRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRestoreRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteRestoreRequest.verify|verify} messages. + * @param message DeleteRestoreRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IDeleteRestoreRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRestoreRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.DeleteRestoreRequest; + + /** + * Decodes a DeleteRestoreRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.DeleteRestoreRequest; + + /** + * Verifies a DeleteRestoreRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRestoreRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRestoreRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.DeleteRestoreRequest; + + /** + * Creates a plain object from a DeleteRestoreRequest message. Also converts values to other types if specified. + * @param message DeleteRestoreRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.DeleteRestoreRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRestoreRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRestoreRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVolumeRestoresRequest. */ + interface IListVolumeRestoresRequest { + + /** ListVolumeRestoresRequest parent */ + parent?: (string|null); + + /** ListVolumeRestoresRequest pageSize */ + pageSize?: (number|null); + + /** ListVolumeRestoresRequest pageToken */ + pageToken?: (string|null); + + /** ListVolumeRestoresRequest filter */ + filter?: (string|null); + + /** ListVolumeRestoresRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListVolumeRestoresRequest. */ + class ListVolumeRestoresRequest implements IListVolumeRestoresRequest { + + /** + * Constructs a new ListVolumeRestoresRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IListVolumeRestoresRequest); + + /** ListVolumeRestoresRequest parent. */ + public parent: string; + + /** ListVolumeRestoresRequest pageSize. */ + public pageSize: number; + + /** ListVolumeRestoresRequest pageToken. */ + public pageToken: string; + + /** ListVolumeRestoresRequest filter. */ + public filter: string; + + /** ListVolumeRestoresRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListVolumeRestoresRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVolumeRestoresRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IListVolumeRestoresRequest): google.cloud.gkebackup.v1.ListVolumeRestoresRequest; + + /** + * Encodes the specified ListVolumeRestoresRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeRestoresRequest.verify|verify} messages. + * @param message ListVolumeRestoresRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IListVolumeRestoresRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVolumeRestoresRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeRestoresRequest.verify|verify} messages. + * @param message ListVolumeRestoresRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IListVolumeRestoresRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVolumeRestoresRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVolumeRestoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.ListVolumeRestoresRequest; + + /** + * Decodes a ListVolumeRestoresRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVolumeRestoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.ListVolumeRestoresRequest; + + /** + * Verifies a ListVolumeRestoresRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVolumeRestoresRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVolumeRestoresRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.ListVolumeRestoresRequest; + + /** + * Creates a plain object from a ListVolumeRestoresRequest message. Also converts values to other types if specified. + * @param message ListVolumeRestoresRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.ListVolumeRestoresRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVolumeRestoresRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVolumeRestoresRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVolumeRestoresResponse. */ + interface IListVolumeRestoresResponse { + + /** ListVolumeRestoresResponse volumeRestores */ + volumeRestores?: (google.cloud.gkebackup.v1.IVolumeRestore[]|null); + + /** ListVolumeRestoresResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListVolumeRestoresResponse. */ + class ListVolumeRestoresResponse implements IListVolumeRestoresResponse { + + /** + * Constructs a new ListVolumeRestoresResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IListVolumeRestoresResponse); + + /** ListVolumeRestoresResponse volumeRestores. */ + public volumeRestores: google.cloud.gkebackup.v1.IVolumeRestore[]; + + /** ListVolumeRestoresResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListVolumeRestoresResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVolumeRestoresResponse instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IListVolumeRestoresResponse): google.cloud.gkebackup.v1.ListVolumeRestoresResponse; + + /** + * Encodes the specified ListVolumeRestoresResponse message. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeRestoresResponse.verify|verify} messages. + * @param message ListVolumeRestoresResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IListVolumeRestoresResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVolumeRestoresResponse message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeRestoresResponse.verify|verify} messages. + * @param message ListVolumeRestoresResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IListVolumeRestoresResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVolumeRestoresResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVolumeRestoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.ListVolumeRestoresResponse; + + /** + * Decodes a ListVolumeRestoresResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVolumeRestoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.ListVolumeRestoresResponse; + + /** + * Verifies a ListVolumeRestoresResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVolumeRestoresResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVolumeRestoresResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.ListVolumeRestoresResponse; + + /** + * Creates a plain object from a ListVolumeRestoresResponse message. Also converts values to other types if specified. + * @param message ListVolumeRestoresResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.ListVolumeRestoresResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVolumeRestoresResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVolumeRestoresResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetVolumeRestoreRequest. */ + interface IGetVolumeRestoreRequest { + + /** GetVolumeRestoreRequest name */ + name?: (string|null); + } + + /** Represents a GetVolumeRestoreRequest. */ + class GetVolumeRestoreRequest implements IGetVolumeRestoreRequest { + + /** + * Constructs a new GetVolumeRestoreRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IGetVolumeRestoreRequest); + + /** GetVolumeRestoreRequest name. */ + public name: string; + + /** + * Creates a new GetVolumeRestoreRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVolumeRestoreRequest instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IGetVolumeRestoreRequest): google.cloud.gkebackup.v1.GetVolumeRestoreRequest; + + /** + * Encodes the specified GetVolumeRestoreRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.GetVolumeRestoreRequest.verify|verify} messages. + * @param message GetVolumeRestoreRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IGetVolumeRestoreRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVolumeRestoreRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.GetVolumeRestoreRequest.verify|verify} messages. + * @param message GetVolumeRestoreRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IGetVolumeRestoreRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVolumeRestoreRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVolumeRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.GetVolumeRestoreRequest; + + /** + * Decodes a GetVolumeRestoreRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVolumeRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.GetVolumeRestoreRequest; + + /** + * Verifies a GetVolumeRestoreRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetVolumeRestoreRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVolumeRestoreRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.GetVolumeRestoreRequest; + + /** + * Creates a plain object from a GetVolumeRestoreRequest message. Also converts values to other types if specified. + * @param message GetVolumeRestoreRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.GetVolumeRestoreRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVolumeRestoreRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetVolumeRestoreRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Restore. */ + interface IRestore { + + /** Restore name */ + name?: (string|null); + + /** Restore uid */ + uid?: (string|null); + + /** Restore createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Restore updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Restore description */ + description?: (string|null); + + /** Restore backup */ + backup?: (string|null); + + /** Restore cluster */ + cluster?: (string|null); + + /** Restore restoreConfig */ + restoreConfig?: (google.cloud.gkebackup.v1.IRestoreConfig|null); + + /** Restore labels */ + labels?: ({ [k: string]: string }|null); + + /** Restore state */ + state?: (google.cloud.gkebackup.v1.Restore.State|keyof typeof google.cloud.gkebackup.v1.Restore.State|null); + + /** Restore stateReason */ + stateReason?: (string|null); + + /** Restore completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + + /** Restore resourcesRestoredCount */ + resourcesRestoredCount?: (number|null); + + /** Restore resourcesExcludedCount */ + resourcesExcludedCount?: (number|null); + + /** Restore resourcesFailedCount */ + resourcesFailedCount?: (number|null); + + /** Restore volumesRestoredCount */ + volumesRestoredCount?: (number|null); + + /** Restore etag */ + etag?: (string|null); + } + + /** Represents a Restore. */ + class Restore implements IRestore { + + /** + * Constructs a new Restore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IRestore); + + /** Restore name. */ + public name: string; + + /** Restore uid. */ + public uid: string; + + /** Restore createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Restore updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Restore description. */ + public description: string; + + /** Restore backup. */ + public backup: string; + + /** Restore cluster. */ + public cluster: string; + + /** Restore restoreConfig. */ + public restoreConfig?: (google.cloud.gkebackup.v1.IRestoreConfig|null); + + /** Restore labels. */ + public labels: { [k: string]: string }; + + /** Restore state. */ + public state: (google.cloud.gkebackup.v1.Restore.State|keyof typeof google.cloud.gkebackup.v1.Restore.State); + + /** Restore stateReason. */ + public stateReason: string; + + /** Restore completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** Restore resourcesRestoredCount. */ + public resourcesRestoredCount: number; + + /** Restore resourcesExcludedCount. */ + public resourcesExcludedCount: number; + + /** Restore resourcesFailedCount. */ + public resourcesFailedCount: number; + + /** Restore volumesRestoredCount. */ + public volumesRestoredCount: number; + + /** Restore etag. */ + public etag: string; + + /** + * Creates a new Restore instance using the specified properties. + * @param [properties] Properties to set + * @returns Restore instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IRestore): google.cloud.gkebackup.v1.Restore; + + /** + * Encodes the specified Restore message. Does not implicitly {@link google.cloud.gkebackup.v1.Restore.verify|verify} messages. + * @param message Restore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IRestore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Restore message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.Restore.verify|verify} messages. + * @param message Restore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IRestore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Restore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Restore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.Restore; + + /** + * Decodes a Restore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Restore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.Restore; + + /** + * Verifies a Restore message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Restore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Restore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.Restore; + + /** + * Creates a plain object from a Restore message. Also converts values to other types if specified. + * @param message Restore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.Restore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Restore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Restore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Restore { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + IN_PROGRESS = 2, + SUCCEEDED = 3, + FAILED = 4, + DELETING = 5 + } + } + + /** Properties of a RestoreConfig. */ + interface IRestoreConfig { + + /** RestoreConfig volumeDataRestorePolicy */ + volumeDataRestorePolicy?: (google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy|keyof typeof google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy|null); + + /** RestoreConfig clusterResourceConflictPolicy */ + clusterResourceConflictPolicy?: (google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy|keyof typeof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy|null); + + /** RestoreConfig namespacedResourceRestoreMode */ + namespacedResourceRestoreMode?: (google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode|keyof typeof google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode|null); + + /** RestoreConfig clusterResourceRestoreScope */ + clusterResourceRestoreScope?: (google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope|null); + + /** RestoreConfig allNamespaces */ + allNamespaces?: (boolean|null); + + /** RestoreConfig selectedNamespaces */ + selectedNamespaces?: (google.cloud.gkebackup.v1.INamespaces|null); + + /** RestoreConfig selectedApplications */ + selectedApplications?: (google.cloud.gkebackup.v1.INamespacedNames|null); + + /** RestoreConfig substitutionRules */ + substitutionRules?: (google.cloud.gkebackup.v1.RestoreConfig.ISubstitutionRule[]|null); + } + + /** Represents a RestoreConfig. */ + class RestoreConfig implements IRestoreConfig { + + /** + * Constructs a new RestoreConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IRestoreConfig); + + /** RestoreConfig volumeDataRestorePolicy. */ + public volumeDataRestorePolicy: (google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy|keyof typeof google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy); + + /** RestoreConfig clusterResourceConflictPolicy. */ + public clusterResourceConflictPolicy: (google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy|keyof typeof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy); + + /** RestoreConfig namespacedResourceRestoreMode. */ + public namespacedResourceRestoreMode: (google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode|keyof typeof google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode); + + /** RestoreConfig clusterResourceRestoreScope. */ + public clusterResourceRestoreScope?: (google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope|null); + + /** RestoreConfig allNamespaces. */ + public allNamespaces?: (boolean|null); + + /** RestoreConfig selectedNamespaces. */ + public selectedNamespaces?: (google.cloud.gkebackup.v1.INamespaces|null); + + /** RestoreConfig selectedApplications. */ + public selectedApplications?: (google.cloud.gkebackup.v1.INamespacedNames|null); + + /** RestoreConfig substitutionRules. */ + public substitutionRules: google.cloud.gkebackup.v1.RestoreConfig.ISubstitutionRule[]; + + /** RestoreConfig namespacedResourceRestoreScope. */ + public namespacedResourceRestoreScope?: ("allNamespaces"|"selectedNamespaces"|"selectedApplications"); + + /** + * Creates a new RestoreConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreConfig instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IRestoreConfig): google.cloud.gkebackup.v1.RestoreConfig; + + /** + * Encodes the specified RestoreConfig message. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.verify|verify} messages. + * @param message RestoreConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IRestoreConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreConfig message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.verify|verify} messages. + * @param message RestoreConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IRestoreConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.RestoreConfig; + + /** + * Decodes a RestoreConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.RestoreConfig; + + /** + * Verifies a RestoreConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.RestoreConfig; + + /** + * Creates a plain object from a RestoreConfig message. Also converts values to other types if specified. + * @param message RestoreConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.RestoreConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RestoreConfig { + + /** VolumeDataRestorePolicy enum. */ + enum VolumeDataRestorePolicy { + VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED = 0, + RESTORE_VOLUME_DATA_FROM_BACKUP = 1, + REUSE_VOLUME_HANDLE_FROM_BACKUP = 2, + NO_VOLUME_DATA_RESTORATION = 3 + } + + /** ClusterResourceConflictPolicy enum. */ + enum ClusterResourceConflictPolicy { + CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED = 0, + USE_EXISTING_VERSION = 1, + USE_BACKUP_VERSION = 2 + } + + /** NamespacedResourceRestoreMode enum. */ + enum NamespacedResourceRestoreMode { + NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED = 0, + DELETE_AND_RESTORE = 1, + FAIL_ON_CONFLICT = 2 + } + + /** Properties of a GroupKind. */ + interface IGroupKind { + + /** GroupKind resourceGroup */ + resourceGroup?: (string|null); + + /** GroupKind resourceKind */ + resourceKind?: (string|null); + } + + /** Represents a GroupKind. */ + class GroupKind implements IGroupKind { + + /** + * Constructs a new GroupKind. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.RestoreConfig.IGroupKind); + + /** GroupKind resourceGroup. */ + public resourceGroup: string; + + /** GroupKind resourceKind. */ + public resourceKind: string; + + /** + * Creates a new GroupKind instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupKind instance + */ + public static create(properties?: google.cloud.gkebackup.v1.RestoreConfig.IGroupKind): google.cloud.gkebackup.v1.RestoreConfig.GroupKind; + + /** + * Encodes the specified GroupKind message. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.GroupKind.verify|verify} messages. + * @param message GroupKind message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.RestoreConfig.IGroupKind, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupKind message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.GroupKind.verify|verify} messages. + * @param message GroupKind message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.RestoreConfig.IGroupKind, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupKind message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupKind + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.RestoreConfig.GroupKind; + + /** + * Decodes a GroupKind message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupKind + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.RestoreConfig.GroupKind; + + /** + * Verifies a GroupKind message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupKind message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupKind + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.RestoreConfig.GroupKind; + + /** + * Creates a plain object from a GroupKind message. Also converts values to other types if specified. + * @param message GroupKind + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.RestoreConfig.GroupKind, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupKind to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupKind + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterResourceRestoreScope. */ + interface IClusterResourceRestoreScope { + + /** ClusterResourceRestoreScope selectedGroupKinds */ + selectedGroupKinds?: (google.cloud.gkebackup.v1.RestoreConfig.IGroupKind[]|null); + } + + /** Represents a ClusterResourceRestoreScope. */ + class ClusterResourceRestoreScope implements IClusterResourceRestoreScope { + + /** + * Constructs a new ClusterResourceRestoreScope. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope); + + /** ClusterResourceRestoreScope selectedGroupKinds. */ + public selectedGroupKinds: google.cloud.gkebackup.v1.RestoreConfig.IGroupKind[]; + + /** + * Creates a new ClusterResourceRestoreScope instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterResourceRestoreScope instance + */ + public static create(properties?: google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope): google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope; + + /** + * Encodes the specified ClusterResourceRestoreScope message. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.verify|verify} messages. + * @param message ClusterResourceRestoreScope message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterResourceRestoreScope message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.verify|verify} messages. + * @param message ClusterResourceRestoreScope message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterResourceRestoreScope message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterResourceRestoreScope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope; + + /** + * Decodes a ClusterResourceRestoreScope message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterResourceRestoreScope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope; + + /** + * Verifies a ClusterResourceRestoreScope message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterResourceRestoreScope message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterResourceRestoreScope + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope; + + /** + * Creates a plain object from a ClusterResourceRestoreScope message. Also converts values to other types if specified. + * @param message ClusterResourceRestoreScope + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterResourceRestoreScope to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterResourceRestoreScope + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubstitutionRule. */ + interface ISubstitutionRule { + + /** SubstitutionRule targetNamespaces */ + targetNamespaces?: (string[]|null); + + /** SubstitutionRule targetGroupKinds */ + targetGroupKinds?: (google.cloud.gkebackup.v1.RestoreConfig.IGroupKind[]|null); + + /** SubstitutionRule targetJsonPath */ + targetJsonPath?: (string|null); + + /** SubstitutionRule originalValuePattern */ + originalValuePattern?: (string|null); + + /** SubstitutionRule newValue */ + newValue?: (string|null); + } + + /** Represents a SubstitutionRule. */ + class SubstitutionRule implements ISubstitutionRule { + + /** + * Constructs a new SubstitutionRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.RestoreConfig.ISubstitutionRule); + + /** SubstitutionRule targetNamespaces. */ + public targetNamespaces: string[]; + + /** SubstitutionRule targetGroupKinds. */ + public targetGroupKinds: google.cloud.gkebackup.v1.RestoreConfig.IGroupKind[]; + + /** SubstitutionRule targetJsonPath. */ + public targetJsonPath: string; + + /** SubstitutionRule originalValuePattern. */ + public originalValuePattern: string; + + /** SubstitutionRule newValue. */ + public newValue: string; + + /** + * Creates a new SubstitutionRule instance using the specified properties. + * @param [properties] Properties to set + * @returns SubstitutionRule instance + */ + public static create(properties?: google.cloud.gkebackup.v1.RestoreConfig.ISubstitutionRule): google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule; + + /** + * Encodes the specified SubstitutionRule message. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.verify|verify} messages. + * @param message SubstitutionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.RestoreConfig.ISubstitutionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubstitutionRule message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.verify|verify} messages. + * @param message SubstitutionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.RestoreConfig.ISubstitutionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubstitutionRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubstitutionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule; + + /** + * Decodes a SubstitutionRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubstitutionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule; + + /** + * Verifies a SubstitutionRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubstitutionRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubstitutionRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule; + + /** + * Creates a plain object from a SubstitutionRule message. Also converts values to other types if specified. + * @param message SubstitutionRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubstitutionRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubstitutionRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RestorePlan. */ + interface IRestorePlan { + + /** RestorePlan name */ + name?: (string|null); + + /** RestorePlan uid */ + uid?: (string|null); + + /** RestorePlan createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** RestorePlan updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** RestorePlan description */ + description?: (string|null); + + /** RestorePlan backupPlan */ + backupPlan?: (string|null); + + /** RestorePlan cluster */ + cluster?: (string|null); + + /** RestorePlan restoreConfig */ + restoreConfig?: (google.cloud.gkebackup.v1.IRestoreConfig|null); + + /** RestorePlan labels */ + labels?: ({ [k: string]: string }|null); + + /** RestorePlan etag */ + etag?: (string|null); + } + + /** Represents a RestorePlan. */ + class RestorePlan implements IRestorePlan { + + /** + * Constructs a new RestorePlan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IRestorePlan); + + /** RestorePlan name. */ + public name: string; + + /** RestorePlan uid. */ + public uid: string; + + /** RestorePlan createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** RestorePlan updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** RestorePlan description. */ + public description: string; + + /** RestorePlan backupPlan. */ + public backupPlan: string; + + /** RestorePlan cluster. */ + public cluster: string; + + /** RestorePlan restoreConfig. */ + public restoreConfig?: (google.cloud.gkebackup.v1.IRestoreConfig|null); + + /** RestorePlan labels. */ + public labels: { [k: string]: string }; + + /** RestorePlan etag. */ + public etag: string; + + /** + * Creates a new RestorePlan instance using the specified properties. + * @param [properties] Properties to set + * @returns RestorePlan instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IRestorePlan): google.cloud.gkebackup.v1.RestorePlan; + + /** + * Encodes the specified RestorePlan message. Does not implicitly {@link google.cloud.gkebackup.v1.RestorePlan.verify|verify} messages. + * @param message RestorePlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IRestorePlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestorePlan message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.RestorePlan.verify|verify} messages. + * @param message RestorePlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IRestorePlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestorePlan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestorePlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.RestorePlan; + + /** + * Decodes a RestorePlan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestorePlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.RestorePlan; + + /** + * Verifies a RestorePlan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestorePlan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestorePlan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.RestorePlan; + + /** + * Creates a plain object from a RestorePlan message. Also converts values to other types if specified. + * @param message RestorePlan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.RestorePlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestorePlan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestorePlan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VolumeBackup. */ + interface IVolumeBackup { + + /** VolumeBackup name */ + name?: (string|null); + + /** VolumeBackup uid */ + uid?: (string|null); + + /** VolumeBackup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** VolumeBackup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** VolumeBackup sourcePvc */ + sourcePvc?: (google.cloud.gkebackup.v1.INamespacedName|null); + + /** VolumeBackup volumeBackupHandle */ + volumeBackupHandle?: (string|null); + + /** VolumeBackup format */ + format?: (google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat|keyof typeof google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat|null); + + /** VolumeBackup storageBytes */ + storageBytes?: (number|Long|string|null); + + /** VolumeBackup diskSizeBytes */ + diskSizeBytes?: (number|Long|string|null); + + /** VolumeBackup completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + + /** VolumeBackup state */ + state?: (google.cloud.gkebackup.v1.VolumeBackup.State|keyof typeof google.cloud.gkebackup.v1.VolumeBackup.State|null); + + /** VolumeBackup stateMessage */ + stateMessage?: (string|null); + + /** VolumeBackup etag */ + etag?: (string|null); + } + + /** Represents a VolumeBackup. */ + class VolumeBackup implements IVolumeBackup { + + /** + * Constructs a new VolumeBackup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IVolumeBackup); + + /** VolumeBackup name. */ + public name: string; + + /** VolumeBackup uid. */ + public uid: string; + + /** VolumeBackup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** VolumeBackup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** VolumeBackup sourcePvc. */ + public sourcePvc?: (google.cloud.gkebackup.v1.INamespacedName|null); + + /** VolumeBackup volumeBackupHandle. */ + public volumeBackupHandle: string; + + /** VolumeBackup format. */ + public format: (google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat|keyof typeof google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat); + + /** VolumeBackup storageBytes. */ + public storageBytes: (number|Long|string); + + /** VolumeBackup diskSizeBytes. */ + public diskSizeBytes: (number|Long|string); + + /** VolumeBackup completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** VolumeBackup state. */ + public state: (google.cloud.gkebackup.v1.VolumeBackup.State|keyof typeof google.cloud.gkebackup.v1.VolumeBackup.State); + + /** VolumeBackup stateMessage. */ + public stateMessage: string; + + /** VolumeBackup etag. */ + public etag: string; + + /** + * Creates a new VolumeBackup instance using the specified properties. + * @param [properties] Properties to set + * @returns VolumeBackup instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IVolumeBackup): google.cloud.gkebackup.v1.VolumeBackup; + + /** + * Encodes the specified VolumeBackup message. Does not implicitly {@link google.cloud.gkebackup.v1.VolumeBackup.verify|verify} messages. + * @param message VolumeBackup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IVolumeBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VolumeBackup message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.VolumeBackup.verify|verify} messages. + * @param message VolumeBackup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IVolumeBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VolumeBackup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VolumeBackup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.VolumeBackup; + + /** + * Decodes a VolumeBackup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VolumeBackup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.VolumeBackup; + + /** + * Verifies a VolumeBackup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VolumeBackup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VolumeBackup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.VolumeBackup; + + /** + * Creates a plain object from a VolumeBackup message. Also converts values to other types if specified. + * @param message VolumeBackup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.VolumeBackup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VolumeBackup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VolumeBackup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VolumeBackup { + + /** VolumeBackupFormat enum. */ + enum VolumeBackupFormat { + VOLUME_BACKUP_FORMAT_UNSPECIFIED = 0, + GCE_PERSISTENT_DISK = 1 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + SNAPSHOTTING = 2, + UPLOADING = 3, + SUCCEEDED = 4, + FAILED = 5, + DELETING = 6 + } + } + + /** Properties of a VolumeRestore. */ + interface IVolumeRestore { + + /** VolumeRestore name */ + name?: (string|null); + + /** VolumeRestore uid */ + uid?: (string|null); + + /** VolumeRestore createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** VolumeRestore updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** VolumeRestore volumeBackup */ + volumeBackup?: (string|null); + + /** VolumeRestore targetPvc */ + targetPvc?: (google.cloud.gkebackup.v1.INamespacedName|null); + + /** VolumeRestore volumeHandle */ + volumeHandle?: (string|null); + + /** VolumeRestore volumeType */ + volumeType?: (google.cloud.gkebackup.v1.VolumeRestore.VolumeType|keyof typeof google.cloud.gkebackup.v1.VolumeRestore.VolumeType|null); + + /** VolumeRestore completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + + /** VolumeRestore state */ + state?: (google.cloud.gkebackup.v1.VolumeRestore.State|keyof typeof google.cloud.gkebackup.v1.VolumeRestore.State|null); + + /** VolumeRestore stateMessage */ + stateMessage?: (string|null); + + /** VolumeRestore etag */ + etag?: (string|null); + } + + /** Represents a VolumeRestore. */ + class VolumeRestore implements IVolumeRestore { + + /** + * Constructs a new VolumeRestore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkebackup.v1.IVolumeRestore); + + /** VolumeRestore name. */ + public name: string; + + /** VolumeRestore uid. */ + public uid: string; + + /** VolumeRestore createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** VolumeRestore updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** VolumeRestore volumeBackup. */ + public volumeBackup: string; + + /** VolumeRestore targetPvc. */ + public targetPvc?: (google.cloud.gkebackup.v1.INamespacedName|null); + + /** VolumeRestore volumeHandle. */ + public volumeHandle: string; + + /** VolumeRestore volumeType. */ + public volumeType: (google.cloud.gkebackup.v1.VolumeRestore.VolumeType|keyof typeof google.cloud.gkebackup.v1.VolumeRestore.VolumeType); + + /** VolumeRestore completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** VolumeRestore state. */ + public state: (google.cloud.gkebackup.v1.VolumeRestore.State|keyof typeof google.cloud.gkebackup.v1.VolumeRestore.State); + + /** VolumeRestore stateMessage. */ + public stateMessage: string; + + /** VolumeRestore etag. */ + public etag: string; + + /** + * Creates a new VolumeRestore instance using the specified properties. + * @param [properties] Properties to set + * @returns VolumeRestore instance + */ + public static create(properties?: google.cloud.gkebackup.v1.IVolumeRestore): google.cloud.gkebackup.v1.VolumeRestore; + + /** + * Encodes the specified VolumeRestore message. Does not implicitly {@link google.cloud.gkebackup.v1.VolumeRestore.verify|verify} messages. + * @param message VolumeRestore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkebackup.v1.IVolumeRestore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VolumeRestore message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.VolumeRestore.verify|verify} messages. + * @param message VolumeRestore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkebackup.v1.IVolumeRestore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VolumeRestore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VolumeRestore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkebackup.v1.VolumeRestore; + + /** + * Decodes a VolumeRestore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VolumeRestore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkebackup.v1.VolumeRestore; + + /** + * Verifies a VolumeRestore message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VolumeRestore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VolumeRestore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkebackup.v1.VolumeRestore; + + /** + * Creates a plain object from a VolumeRestore message. Also converts values to other types if specified. + * @param message VolumeRestore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkebackup.v1.VolumeRestore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VolumeRestore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VolumeRestore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VolumeRestore { + + /** VolumeType enum. */ + enum VolumeType { + VOLUME_TYPE_UNSPECIFIED = 0, + GCE_PERSISTENT_DISK = 1 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + RESTORING = 2, + SUCCEEDED = 3, + FAILED = 4, + DELETING = 5 + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** 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 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a 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; + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a 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 Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-gkebackup/protos/protos.js b/packages/google-cloud-gkebackup/protos/protos.js new file mode 100644 index 00000000000..bdd9fb3634e --- /dev/null +++ b/packages/google-cloud-gkebackup/protos/protos.js @@ -0,0 +1,30759 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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_gke_backup_protos || ($protobuf.roots._google_cloud_gke_backup_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.gkebackup = (function() { + + /** + * Namespace gkebackup. + * @memberof google.cloud + * @namespace + */ + var gkebackup = {}; + + gkebackup.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.gkebackup + * @namespace + */ + var v1 = {}; + + v1.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.cloud.gkebackup.v1 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [uid] Backup uid + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime + * @property {boolean|null} [manual] Backup manual + * @property {Object.|null} [labels] Backup labels + * @property {number|null} [deleteLockDays] Backup deleteLockDays + * @property {google.protobuf.ITimestamp|null} [deleteLockExpireTime] Backup deleteLockExpireTime + * @property {number|null} [retainDays] Backup retainDays + * @property {google.protobuf.ITimestamp|null} [retainExpireTime] Backup retainExpireTime + * @property {google.cloud.gkebackup.v1.IEncryptionKey|null} [encryptionKey] Backup encryptionKey + * @property {boolean|null} [allNamespaces] Backup allNamespaces + * @property {google.cloud.gkebackup.v1.INamespaces|null} [selectedNamespaces] Backup selectedNamespaces + * @property {google.cloud.gkebackup.v1.INamespacedNames|null} [selectedApplications] Backup selectedApplications + * @property {boolean|null} [containsVolumeData] Backup containsVolumeData + * @property {boolean|null} [containsSecrets] Backup containsSecrets + * @property {google.cloud.gkebackup.v1.Backup.IClusterMetadata|null} [clusterMetadata] Backup clusterMetadata + * @property {google.cloud.gkebackup.v1.Backup.State|null} [state] Backup state + * @property {string|null} [stateReason] Backup stateReason + * @property {google.protobuf.ITimestamp|null} [completeTime] Backup completeTime + * @property {number|null} [resourceCount] Backup resourceCount + * @property {number|null} [volumeCount] Backup volumeCount + * @property {number|Long|null} [sizeBytes] Backup sizeBytes + * @property {string|null} [etag] Backup etag + * @property {string|null} [description] Backup description + * @property {number|null} [podCount] Backup podCount + * @property {number|Long|null} [configBackupSizeBytes] Backup configBackupSizeBytes + */ + + /** + * Constructs a new Backup. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.cloud.gkebackup.v1.IBackup=} [properties] Properties to set + */ + function Backup(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]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup uid. + * @member {string} uid + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.uid = ""; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.updateTime = null; + + /** + * Backup manual. + * @member {boolean} manual + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.manual = false; + + /** + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.labels = $util.emptyObject; + + /** + * Backup deleteLockDays. + * @member {number} deleteLockDays + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.deleteLockDays = 0; + + /** + * Backup deleteLockExpireTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteLockExpireTime + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.deleteLockExpireTime = null; + + /** + * Backup retainDays. + * @member {number} retainDays + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.retainDays = 0; + + /** + * Backup retainExpireTime. + * @member {google.protobuf.ITimestamp|null|undefined} retainExpireTime + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.retainExpireTime = null; + + /** + * Backup encryptionKey. + * @member {google.cloud.gkebackup.v1.IEncryptionKey|null|undefined} encryptionKey + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.encryptionKey = null; + + /** + * Backup allNamespaces. + * @member {boolean|null|undefined} allNamespaces + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.allNamespaces = null; + + /** + * Backup selectedNamespaces. + * @member {google.cloud.gkebackup.v1.INamespaces|null|undefined} selectedNamespaces + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.selectedNamespaces = null; + + /** + * Backup selectedApplications. + * @member {google.cloud.gkebackup.v1.INamespacedNames|null|undefined} selectedApplications + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.selectedApplications = null; + + /** + * Backup containsVolumeData. + * @member {boolean} containsVolumeData + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.containsVolumeData = false; + + /** + * Backup containsSecrets. + * @member {boolean} containsSecrets + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.containsSecrets = false; + + /** + * Backup clusterMetadata. + * @member {google.cloud.gkebackup.v1.Backup.IClusterMetadata|null|undefined} clusterMetadata + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.clusterMetadata = null; + + /** + * Backup state. + * @member {google.cloud.gkebackup.v1.Backup.State} state + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup stateReason. + * @member {string} stateReason + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.stateReason = ""; + + /** + * Backup completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.completeTime = null; + + /** + * Backup resourceCount. + * @member {number} resourceCount + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.resourceCount = 0; + + /** + * Backup volumeCount. + * @member {number} volumeCount + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.volumeCount = 0; + + /** + * Backup sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup etag. + * @member {string} etag + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.etag = ""; + + /** + * Backup description. + * @member {string} description + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.description = ""; + + /** + * Backup podCount. + * @member {number} podCount + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.podCount = 0; + + /** + * Backup configBackupSizeBytes. + * @member {number|Long} configBackupSizeBytes + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Backup.prototype.configBackupSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Backup backupScope. + * @member {"allNamespaces"|"selectedNamespaces"|"selectedApplications"|undefined} backupScope + * @memberof google.cloud.gkebackup.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "backupScope", { + get: $util.oneOfGetter($oneOfFields = ["allNamespaces", "selectedNamespaces", "selectedApplications"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.Backup + * @static + * @param {google.cloud.gkebackup.v1.IBackup=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.gkebackup.v1.Backup.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.Backup + * @static + * @param {google.cloud.gkebackup.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.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.manual != null && Object.hasOwnProperty.call(message, "manual")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.manual); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.deleteLockDays != null && Object.hasOwnProperty.call(message, "deleteLockDays")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.deleteLockDays); + if (message.deleteLockExpireTime != null && Object.hasOwnProperty.call(message, "deleteLockExpireTime")) + $root.google.protobuf.Timestamp.encode(message.deleteLockExpireTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.retainDays != null && Object.hasOwnProperty.call(message, "retainDays")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.retainDays); + if (message.retainExpireTime != null && Object.hasOwnProperty.call(message, "retainExpireTime")) + $root.google.protobuf.Timestamp.encode(message.retainExpireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + $root.google.cloud.gkebackup.v1.EncryptionKey.encode(message.encryptionKey, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.allNamespaces != null && Object.hasOwnProperty.call(message, "allNamespaces")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.allNamespaces); + if (message.selectedNamespaces != null && Object.hasOwnProperty.call(message, "selectedNamespaces")) + $root.google.cloud.gkebackup.v1.Namespaces.encode(message.selectedNamespaces, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.selectedApplications != null && Object.hasOwnProperty.call(message, "selectedApplications")) + $root.google.cloud.gkebackup.v1.NamespacedNames.encode(message.selectedApplications, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.containsVolumeData != null && Object.hasOwnProperty.call(message, "containsVolumeData")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.containsVolumeData); + if (message.containsSecrets != null && Object.hasOwnProperty.call(message, "containsSecrets")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.containsSecrets); + if (message.clusterMetadata != null && Object.hasOwnProperty.call(message, "clusterMetadata")) + $root.google.cloud.gkebackup.v1.Backup.ClusterMetadata.encode(message.clusterMetadata, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.state); + if (message.stateReason != null && Object.hasOwnProperty.call(message, "stateReason")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.stateReason); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.resourceCount != null && Object.hasOwnProperty.call(message, "resourceCount")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.resourceCount); + if (message.volumeCount != null && Object.hasOwnProperty.call(message, "volumeCount")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.volumeCount); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 23, wireType 0 =*/184).int64(message.sizeBytes); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.etag); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.description); + if (message.podCount != null && Object.hasOwnProperty.call(message, "podCount")) + writer.uint32(/* id 26, wireType 0 =*/208).int32(message.podCount); + if (message.configBackupSizeBytes != null && Object.hasOwnProperty.call(message, "configBackupSizeBytes")) + writer.uint32(/* id 27, wireType 0 =*/216).int64(message.configBackupSizeBytes); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.Backup + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.Backup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.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: { + message.manual = reader.bool(); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.deleteLockDays = reader.int32(); + break; + } + case 8: { + message.deleteLockExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.retainDays = reader.int32(); + break; + } + case 10: { + message.retainExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.encryptionKey = $root.google.cloud.gkebackup.v1.EncryptionKey.decode(reader, reader.uint32()); + break; + } + case 12: { + message.allNamespaces = reader.bool(); + break; + } + case 13: { + message.selectedNamespaces = $root.google.cloud.gkebackup.v1.Namespaces.decode(reader, reader.uint32()); + break; + } + case 14: { + message.selectedApplications = $root.google.cloud.gkebackup.v1.NamespacedNames.decode(reader, reader.uint32()); + break; + } + case 15: { + message.containsVolumeData = reader.bool(); + break; + } + case 16: { + message.containsSecrets = reader.bool(); + break; + } + case 17: { + message.clusterMetadata = $root.google.cloud.gkebackup.v1.Backup.ClusterMetadata.decode(reader, reader.uint32()); + break; + } + case 18: { + message.state = reader.int32(); + break; + } + case 19: { + message.stateReason = reader.string(); + break; + } + case 20: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 21: { + message.resourceCount = reader.int32(); + break; + } + case 22: { + message.volumeCount = reader.int32(); + break; + } + case 23: { + message.sizeBytes = reader.int64(); + break; + } + case 24: { + message.etag = reader.string(); + break; + } + case 25: { + message.description = reader.string(); + break; + } + case 26: { + message.podCount = reader.int32(); + break; + } + case 27: { + message.configBackupSizeBytes = reader.int64(); + 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.gkebackup.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.manual != null && message.hasOwnProperty("manual")) + if (typeof message.manual !== "boolean") + return "manual: boolean 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.deleteLockDays != null && message.hasOwnProperty("deleteLockDays")) + if (!$util.isInteger(message.deleteLockDays)) + return "deleteLockDays: integer expected"; + if (message.deleteLockExpireTime != null && message.hasOwnProperty("deleteLockExpireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteLockExpireTime); + if (error) + return "deleteLockExpireTime." + error; + } + if (message.retainDays != null && message.hasOwnProperty("retainDays")) + if (!$util.isInteger(message.retainDays)) + return "retainDays: integer expected"; + if (message.retainExpireTime != null && message.hasOwnProperty("retainExpireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.retainExpireTime); + if (error) + return "retainExpireTime." + error; + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) { + var error = $root.google.cloud.gkebackup.v1.EncryptionKey.verify(message.encryptionKey); + if (error) + return "encryptionKey." + error; + } + if (message.allNamespaces != null && message.hasOwnProperty("allNamespaces")) { + properties.backupScope = 1; + if (typeof message.allNamespaces !== "boolean") + return "allNamespaces: boolean expected"; + } + if (message.selectedNamespaces != null && message.hasOwnProperty("selectedNamespaces")) { + if (properties.backupScope === 1) + return "backupScope: multiple values"; + properties.backupScope = 1; + { + var error = $root.google.cloud.gkebackup.v1.Namespaces.verify(message.selectedNamespaces); + if (error) + return "selectedNamespaces." + error; + } + } + if (message.selectedApplications != null && message.hasOwnProperty("selectedApplications")) { + if (properties.backupScope === 1) + return "backupScope: multiple values"; + properties.backupScope = 1; + { + var error = $root.google.cloud.gkebackup.v1.NamespacedNames.verify(message.selectedApplications); + if (error) + return "selectedApplications." + error; + } + } + if (message.containsVolumeData != null && message.hasOwnProperty("containsVolumeData")) + if (typeof message.containsVolumeData !== "boolean") + return "containsVolumeData: boolean expected"; + if (message.containsSecrets != null && message.hasOwnProperty("containsSecrets")) + if (typeof message.containsSecrets !== "boolean") + return "containsSecrets: boolean expected"; + if (message.clusterMetadata != null && message.hasOwnProperty("clusterMetadata")) { + var error = $root.google.cloud.gkebackup.v1.Backup.ClusterMetadata.verify(message.clusterMetadata); + if (error) + return "clusterMetadata." + 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.stateReason != null && message.hasOwnProperty("stateReason")) + if (!$util.isString(message.stateReason)) + return "stateReason: string expected"; + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; + } + if (message.resourceCount != null && message.hasOwnProperty("resourceCount")) + if (!$util.isInteger(message.resourceCount)) + return "resourceCount: integer expected"; + if (message.volumeCount != null && message.hasOwnProperty("volumeCount")) + if (!$util.isInteger(message.volumeCount)) + return "volumeCount: integer expected"; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.podCount != null && message.hasOwnProperty("podCount")) + if (!$util.isInteger(message.podCount)) + return "podCount: integer expected"; + if (message.configBackupSizeBytes != null && message.hasOwnProperty("configBackupSizeBytes")) + if (!$util.isInteger(message.configBackupSizeBytes) && !(message.configBackupSizeBytes && $util.isInteger(message.configBackupSizeBytes.low) && $util.isInteger(message.configBackupSizeBytes.high))) + return "configBackupSizeBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.Backup) + return object; + var message = new $root.google.cloud.gkebackup.v1.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gkebackup.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.gkebackup.v1.Backup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.manual != null) + message.manual = Boolean(object.manual); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gkebackup.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.deleteLockDays != null) + message.deleteLockDays = object.deleteLockDays | 0; + if (object.deleteLockExpireTime != null) { + if (typeof object.deleteLockExpireTime !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Backup.deleteLockExpireTime: object expected"); + message.deleteLockExpireTime = $root.google.protobuf.Timestamp.fromObject(object.deleteLockExpireTime); + } + if (object.retainDays != null) + message.retainDays = object.retainDays | 0; + if (object.retainExpireTime != null) { + if (typeof object.retainExpireTime !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Backup.retainExpireTime: object expected"); + message.retainExpireTime = $root.google.protobuf.Timestamp.fromObject(object.retainExpireTime); + } + if (object.encryptionKey != null) { + if (typeof object.encryptionKey !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Backup.encryptionKey: object expected"); + message.encryptionKey = $root.google.cloud.gkebackup.v1.EncryptionKey.fromObject(object.encryptionKey); + } + if (object.allNamespaces != null) + message.allNamespaces = Boolean(object.allNamespaces); + if (object.selectedNamespaces != null) { + if (typeof object.selectedNamespaces !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Backup.selectedNamespaces: object expected"); + message.selectedNamespaces = $root.google.cloud.gkebackup.v1.Namespaces.fromObject(object.selectedNamespaces); + } + if (object.selectedApplications != null) { + if (typeof object.selectedApplications !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Backup.selectedApplications: object expected"); + message.selectedApplications = $root.google.cloud.gkebackup.v1.NamespacedNames.fromObject(object.selectedApplications); + } + if (object.containsVolumeData != null) + message.containsVolumeData = Boolean(object.containsVolumeData); + if (object.containsSecrets != null) + message.containsSecrets = Boolean(object.containsSecrets); + if (object.clusterMetadata != null) { + if (typeof object.clusterMetadata !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Backup.clusterMetadata: object expected"); + message.clusterMetadata = $root.google.cloud.gkebackup.v1.Backup.ClusterMetadata.fromObject(object.clusterMetadata); + } + 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 "IN_PROGRESS": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + } + if (object.stateReason != null) + message.stateReason = String(object.stateReason); + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Backup.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); + } + if (object.resourceCount != null) + message.resourceCount = object.resourceCount | 0; + if (object.volumeCount != null) + message.volumeCount = object.volumeCount | 0; + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.description != null) + message.description = String(object.description); + if (object.podCount != null) + message.podCount = object.podCount | 0; + if (object.configBackupSizeBytes != null) + if ($util.Long) + (message.configBackupSizeBytes = $util.Long.fromValue(object.configBackupSizeBytes)).unsigned = false; + else if (typeof object.configBackupSizeBytes === "string") + message.configBackupSizeBytes = parseInt(object.configBackupSizeBytes, 10); + else if (typeof object.configBackupSizeBytes === "number") + message.configBackupSizeBytes = object.configBackupSizeBytes; + else if (typeof object.configBackupSizeBytes === "object") + message.configBackupSizeBytes = new $util.LongBits(object.configBackupSizeBytes.low >>> 0, object.configBackupSizeBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.Backup + * @static + * @param {google.cloud.gkebackup.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.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.manual = false; + object.deleteLockDays = 0; + object.deleteLockExpireTime = null; + object.retainDays = 0; + object.retainExpireTime = null; + object.encryptionKey = null; + object.containsVolumeData = false; + object.containsSecrets = false; + object.clusterMetadata = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateReason = ""; + object.completeTime = null; + object.resourceCount = 0; + object.volumeCount = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.etag = ""; + object.description = ""; + object.podCount = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.configBackupSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.configBackupSizeBytes = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.manual != null && message.hasOwnProperty("manual")) + object.manual = message.manual; + 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.deleteLockDays != null && message.hasOwnProperty("deleteLockDays")) + object.deleteLockDays = message.deleteLockDays; + if (message.deleteLockExpireTime != null && message.hasOwnProperty("deleteLockExpireTime")) + object.deleteLockExpireTime = $root.google.protobuf.Timestamp.toObject(message.deleteLockExpireTime, options); + if (message.retainDays != null && message.hasOwnProperty("retainDays")) + object.retainDays = message.retainDays; + if (message.retainExpireTime != null && message.hasOwnProperty("retainExpireTime")) + object.retainExpireTime = $root.google.protobuf.Timestamp.toObject(message.retainExpireTime, options); + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + object.encryptionKey = $root.google.cloud.gkebackup.v1.EncryptionKey.toObject(message.encryptionKey, options); + if (message.allNamespaces != null && message.hasOwnProperty("allNamespaces")) { + object.allNamespaces = message.allNamespaces; + if (options.oneofs) + object.backupScope = "allNamespaces"; + } + if (message.selectedNamespaces != null && message.hasOwnProperty("selectedNamespaces")) { + object.selectedNamespaces = $root.google.cloud.gkebackup.v1.Namespaces.toObject(message.selectedNamespaces, options); + if (options.oneofs) + object.backupScope = "selectedNamespaces"; + } + if (message.selectedApplications != null && message.hasOwnProperty("selectedApplications")) { + object.selectedApplications = $root.google.cloud.gkebackup.v1.NamespacedNames.toObject(message.selectedApplications, options); + if (options.oneofs) + object.backupScope = "selectedApplications"; + } + if (message.containsVolumeData != null && message.hasOwnProperty("containsVolumeData")) + object.containsVolumeData = message.containsVolumeData; + if (message.containsSecrets != null && message.hasOwnProperty("containsSecrets")) + object.containsSecrets = message.containsSecrets; + if (message.clusterMetadata != null && message.hasOwnProperty("clusterMetadata")) + object.clusterMetadata = $root.google.cloud.gkebackup.v1.Backup.ClusterMetadata.toObject(message.clusterMetadata, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.gkebackup.v1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.gkebackup.v1.Backup.State[message.state] : message.state; + if (message.stateReason != null && message.hasOwnProperty("stateReason")) + object.stateReason = message.stateReason; + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + if (message.resourceCount != null && message.hasOwnProperty("resourceCount")) + object.resourceCount = message.resourceCount; + if (message.volumeCount != null && message.hasOwnProperty("volumeCount")) + object.volumeCount = message.volumeCount; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.podCount != null && message.hasOwnProperty("podCount")) + object.podCount = message.podCount; + if (message.configBackupSizeBytes != null && message.hasOwnProperty("configBackupSizeBytes")) + if (typeof message.configBackupSizeBytes === "number") + object.configBackupSizeBytes = options.longs === String ? String(message.configBackupSizeBytes) : message.configBackupSizeBytes; + else + object.configBackupSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.configBackupSizeBytes) : options.longs === Number ? new $util.LongBits(message.configBackupSizeBytes.low >>> 0, message.configBackupSizeBytes.high >>> 0).toNumber() : message.configBackupSizeBytes; + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.Backup"; + }; + + Backup.ClusterMetadata = (function() { + + /** + * Properties of a ClusterMetadata. + * @memberof google.cloud.gkebackup.v1.Backup + * @interface IClusterMetadata + * @property {string|null} [cluster] ClusterMetadata cluster + * @property {string|null} [k8sVersion] ClusterMetadata k8sVersion + * @property {Object.|null} [backupCrdVersions] ClusterMetadata backupCrdVersions + * @property {string|null} [gkeVersion] ClusterMetadata gkeVersion + * @property {string|null} [anthosVersion] ClusterMetadata anthosVersion + */ + + /** + * Constructs a new ClusterMetadata. + * @memberof google.cloud.gkebackup.v1.Backup + * @classdesc Represents a ClusterMetadata. + * @implements IClusterMetadata + * @constructor + * @param {google.cloud.gkebackup.v1.Backup.IClusterMetadata=} [properties] Properties to set + */ + function ClusterMetadata(properties) { + this.backupCrdVersions = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterMetadata cluster. + * @member {string} cluster + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @instance + */ + ClusterMetadata.prototype.cluster = ""; + + /** + * ClusterMetadata k8sVersion. + * @member {string} k8sVersion + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @instance + */ + ClusterMetadata.prototype.k8sVersion = ""; + + /** + * ClusterMetadata backupCrdVersions. + * @member {Object.} backupCrdVersions + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @instance + */ + ClusterMetadata.prototype.backupCrdVersions = $util.emptyObject; + + /** + * ClusterMetadata gkeVersion. + * @member {string|null|undefined} gkeVersion + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @instance + */ + ClusterMetadata.prototype.gkeVersion = null; + + /** + * ClusterMetadata anthosVersion. + * @member {string|null|undefined} anthosVersion + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @instance + */ + ClusterMetadata.prototype.anthosVersion = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ClusterMetadata platformVersion. + * @member {"gkeVersion"|"anthosVersion"|undefined} platformVersion + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @instance + */ + Object.defineProperty(ClusterMetadata.prototype, "platformVersion", { + get: $util.oneOfGetter($oneOfFields = ["gkeVersion", "anthosVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ClusterMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @static + * @param {google.cloud.gkebackup.v1.Backup.IClusterMetadata=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.Backup.ClusterMetadata} ClusterMetadata instance + */ + ClusterMetadata.create = function create(properties) { + return new ClusterMetadata(properties); + }; + + /** + * Encodes the specified ClusterMetadata message. Does not implicitly {@link google.cloud.gkebackup.v1.Backup.ClusterMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @static + * @param {google.cloud.gkebackup.v1.Backup.IClusterMetadata} message ClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + if (message.k8sVersion != null && Object.hasOwnProperty.call(message, "k8sVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.k8sVersion); + if (message.backupCrdVersions != null && Object.hasOwnProperty.call(message, "backupCrdVersions")) + for (var keys = Object.keys(message.backupCrdVersions), 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.backupCrdVersions[keys[i]]).ldelim(); + if (message.gkeVersion != null && Object.hasOwnProperty.call(message, "gkeVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gkeVersion); + if (message.anthosVersion != null && Object.hasOwnProperty.call(message, "anthosVersion")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.anthosVersion); + return writer; + }; + + /** + * Encodes the specified ClusterMetadata message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.Backup.ClusterMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @static + * @param {google.cloud.gkebackup.v1.Backup.IClusterMetadata} message ClusterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.Backup.ClusterMetadata} ClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.Backup.ClusterMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + message.k8sVersion = reader.string(); + break; + } + case 3: { + if (message.backupCrdVersions === $util.emptyObject) + message.backupCrdVersions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.backupCrdVersions[key] = value; + break; + } + case 4: { + message.gkeVersion = reader.string(); + break; + } + case 5: { + message.anthosVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.Backup.ClusterMetadata} ClusterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterMetadata message. + * @function verify + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.k8sVersion != null && message.hasOwnProperty("k8sVersion")) + if (!$util.isString(message.k8sVersion)) + return "k8sVersion: string expected"; + if (message.backupCrdVersions != null && message.hasOwnProperty("backupCrdVersions")) { + if (!$util.isObject(message.backupCrdVersions)) + return "backupCrdVersions: object expected"; + var key = Object.keys(message.backupCrdVersions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.backupCrdVersions[key[i]])) + return "backupCrdVersions: string{k:string} expected"; + } + if (message.gkeVersion != null && message.hasOwnProperty("gkeVersion")) { + properties.platformVersion = 1; + if (!$util.isString(message.gkeVersion)) + return "gkeVersion: string expected"; + } + if (message.anthosVersion != null && message.hasOwnProperty("anthosVersion")) { + if (properties.platformVersion === 1) + return "platformVersion: multiple values"; + properties.platformVersion = 1; + if (!$util.isString(message.anthosVersion)) + return "anthosVersion: string expected"; + } + return null; + }; + + /** + * Creates a ClusterMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.Backup.ClusterMetadata} ClusterMetadata + */ + ClusterMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.Backup.ClusterMetadata) + return object; + var message = new $root.google.cloud.gkebackup.v1.Backup.ClusterMetadata(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.k8sVersion != null) + message.k8sVersion = String(object.k8sVersion); + if (object.backupCrdVersions) { + if (typeof object.backupCrdVersions !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Backup.ClusterMetadata.backupCrdVersions: object expected"); + message.backupCrdVersions = {}; + for (var keys = Object.keys(object.backupCrdVersions), i = 0; i < keys.length; ++i) + message.backupCrdVersions[keys[i]] = String(object.backupCrdVersions[keys[i]]); + } + if (object.gkeVersion != null) + message.gkeVersion = String(object.gkeVersion); + if (object.anthosVersion != null) + message.anthosVersion = String(object.anthosVersion); + return message; + }; + + /** + * Creates a plain object from a ClusterMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @static + * @param {google.cloud.gkebackup.v1.Backup.ClusterMetadata} message ClusterMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.backupCrdVersions = {}; + if (options.defaults) { + object.cluster = ""; + object.k8sVersion = ""; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.k8sVersion != null && message.hasOwnProperty("k8sVersion")) + object.k8sVersion = message.k8sVersion; + var keys2; + if (message.backupCrdVersions && (keys2 = Object.keys(message.backupCrdVersions)).length) { + object.backupCrdVersions = {}; + for (var j = 0; j < keys2.length; ++j) + object.backupCrdVersions[keys2[j]] = message.backupCrdVersions[keys2[j]]; + } + if (message.gkeVersion != null && message.hasOwnProperty("gkeVersion")) { + object.gkeVersion = message.gkeVersion; + if (options.oneofs) + object.platformVersion = "gkeVersion"; + } + if (message.anthosVersion != null && message.hasOwnProperty("anthosVersion")) { + object.anthosVersion = message.anthosVersion; + if (options.oneofs) + object.platformVersion = "anthosVersion"; + } + return object; + }; + + /** + * Converts this ClusterMetadata to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @instance + * @returns {Object.} JSON object + */ + ClusterMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterMetadata + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.Backup.ClusterMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.Backup.ClusterMetadata"; + }; + + return ClusterMetadata; + })(); + + /** + * State enum. + * @name google.cloud.gkebackup.v1.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} IN_PROGRESS=2 IN_PROGRESS value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} DELETING=5 DELETING value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "IN_PROGRESS"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "DELETING"] = 5; + return values; + })(); + + return Backup; + })(); + + v1.Namespaces = (function() { + + /** + * Properties of a Namespaces. + * @memberof google.cloud.gkebackup.v1 + * @interface INamespaces + * @property {Array.|null} [namespaces] Namespaces namespaces + */ + + /** + * Constructs a new Namespaces. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a Namespaces. + * @implements INamespaces + * @constructor + * @param {google.cloud.gkebackup.v1.INamespaces=} [properties] Properties to set + */ + function Namespaces(properties) { + this.namespaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Namespaces namespaces. + * @member {Array.} namespaces + * @memberof google.cloud.gkebackup.v1.Namespaces + * @instance + */ + Namespaces.prototype.namespaces = $util.emptyArray; + + /** + * Creates a new Namespaces instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.Namespaces + * @static + * @param {google.cloud.gkebackup.v1.INamespaces=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.Namespaces} Namespaces instance + */ + Namespaces.create = function create(properties) { + return new Namespaces(properties); + }; + + /** + * Encodes the specified Namespaces message. Does not implicitly {@link google.cloud.gkebackup.v1.Namespaces.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.Namespaces + * @static + * @param {google.cloud.gkebackup.v1.INamespaces} message Namespaces message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Namespaces.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.namespaces != null && message.namespaces.length) + for (var i = 0; i < message.namespaces.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namespaces[i]); + return writer; + }; + + /** + * Encodes the specified Namespaces message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.Namespaces.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.Namespaces + * @static + * @param {google.cloud.gkebackup.v1.INamespaces} message Namespaces message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Namespaces.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Namespaces message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.Namespaces + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.Namespaces} Namespaces + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Namespaces.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.Namespaces(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.namespaces && message.namespaces.length)) + message.namespaces = []; + message.namespaces.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Namespaces message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.Namespaces + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.Namespaces} Namespaces + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Namespaces.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Namespaces message. + * @function verify + * @memberof google.cloud.gkebackup.v1.Namespaces + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Namespaces.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.namespaces != null && message.hasOwnProperty("namespaces")) { + if (!Array.isArray(message.namespaces)) + return "namespaces: array expected"; + for (var i = 0; i < message.namespaces.length; ++i) + if (!$util.isString(message.namespaces[i])) + return "namespaces: string[] expected"; + } + return null; + }; + + /** + * Creates a Namespaces message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.Namespaces + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.Namespaces} Namespaces + */ + Namespaces.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.Namespaces) + return object; + var message = new $root.google.cloud.gkebackup.v1.Namespaces(); + if (object.namespaces) { + if (!Array.isArray(object.namespaces)) + throw TypeError(".google.cloud.gkebackup.v1.Namespaces.namespaces: array expected"); + message.namespaces = []; + for (var i = 0; i < object.namespaces.length; ++i) + message.namespaces[i] = String(object.namespaces[i]); + } + return message; + }; + + /** + * Creates a plain object from a Namespaces message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.Namespaces + * @static + * @param {google.cloud.gkebackup.v1.Namespaces} message Namespaces + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Namespaces.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.namespaces = []; + if (message.namespaces && message.namespaces.length) { + object.namespaces = []; + for (var j = 0; j < message.namespaces.length; ++j) + object.namespaces[j] = message.namespaces[j]; + } + return object; + }; + + /** + * Converts this Namespaces to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.Namespaces + * @instance + * @returns {Object.} JSON object + */ + Namespaces.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Namespaces + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.Namespaces + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Namespaces.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.Namespaces"; + }; + + return Namespaces; + })(); + + v1.NamespacedName = (function() { + + /** + * Properties of a NamespacedName. + * @memberof google.cloud.gkebackup.v1 + * @interface INamespacedName + * @property {string|null} [namespace] NamespacedName namespace + * @property {string|null} [name] NamespacedName name + */ + + /** + * Constructs a new NamespacedName. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a NamespacedName. + * @implements INamespacedName + * @constructor + * @param {google.cloud.gkebackup.v1.INamespacedName=} [properties] Properties to set + */ + function NamespacedName(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamespacedName namespace. + * @member {string} namespace + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @instance + */ + NamespacedName.prototype.namespace = ""; + + /** + * NamespacedName name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @instance + */ + NamespacedName.prototype.name = ""; + + /** + * Creates a new NamespacedName instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @static + * @param {google.cloud.gkebackup.v1.INamespacedName=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.NamespacedName} NamespacedName instance + */ + NamespacedName.create = function create(properties) { + return new NamespacedName(properties); + }; + + /** + * Encodes the specified NamespacedName message. Does not implicitly {@link google.cloud.gkebackup.v1.NamespacedName.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @static + * @param {google.cloud.gkebackup.v1.INamespacedName} message NamespacedName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamespacedName.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namespace); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified NamespacedName message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.NamespacedName.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @static + * @param {google.cloud.gkebackup.v1.INamespacedName} message NamespacedName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamespacedName.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamespacedName message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.NamespacedName} NamespacedName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamespacedName.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.NamespacedName(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namespace = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NamespacedName message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.NamespacedName} NamespacedName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamespacedName.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamespacedName message. + * @function verify + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamespacedName.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.namespace != null && message.hasOwnProperty("namespace")) + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a NamespacedName message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.NamespacedName} NamespacedName + */ + NamespacedName.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.NamespacedName) + return object; + var message = new $root.google.cloud.gkebackup.v1.NamespacedName(); + if (object.namespace != null) + message.namespace = String(object.namespace); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a NamespacedName message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @static + * @param {google.cloud.gkebackup.v1.NamespacedName} message NamespacedName + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamespacedName.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namespace = ""; + object.name = ""; + } + if (message.namespace != null && message.hasOwnProperty("namespace")) + object.namespace = message.namespace; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this NamespacedName to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @instance + * @returns {Object.} JSON object + */ + NamespacedName.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamespacedName + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.NamespacedName + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamespacedName.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.NamespacedName"; + }; + + return NamespacedName; + })(); + + v1.NamespacedNames = (function() { + + /** + * Properties of a NamespacedNames. + * @memberof google.cloud.gkebackup.v1 + * @interface INamespacedNames + * @property {Array.|null} [namespacedNames] NamespacedNames namespacedNames + */ + + /** + * Constructs a new NamespacedNames. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a NamespacedNames. + * @implements INamespacedNames + * @constructor + * @param {google.cloud.gkebackup.v1.INamespacedNames=} [properties] Properties to set + */ + function NamespacedNames(properties) { + this.namespacedNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamespacedNames namespacedNames. + * @member {Array.} namespacedNames + * @memberof google.cloud.gkebackup.v1.NamespacedNames + * @instance + */ + NamespacedNames.prototype.namespacedNames = $util.emptyArray; + + /** + * Creates a new NamespacedNames instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.NamespacedNames + * @static + * @param {google.cloud.gkebackup.v1.INamespacedNames=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.NamespacedNames} NamespacedNames instance + */ + NamespacedNames.create = function create(properties) { + return new NamespacedNames(properties); + }; + + /** + * Encodes the specified NamespacedNames message. Does not implicitly {@link google.cloud.gkebackup.v1.NamespacedNames.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.NamespacedNames + * @static + * @param {google.cloud.gkebackup.v1.INamespacedNames} message NamespacedNames message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamespacedNames.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.namespacedNames != null && message.namespacedNames.length) + for (var i = 0; i < message.namespacedNames.length; ++i) + $root.google.cloud.gkebackup.v1.NamespacedName.encode(message.namespacedNames[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NamespacedNames message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.NamespacedNames.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.NamespacedNames + * @static + * @param {google.cloud.gkebackup.v1.INamespacedNames} message NamespacedNames message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamespacedNames.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamespacedNames message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.NamespacedNames + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.NamespacedNames} NamespacedNames + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamespacedNames.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.NamespacedNames(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.namespacedNames && message.namespacedNames.length)) + message.namespacedNames = []; + message.namespacedNames.push($root.google.cloud.gkebackup.v1.NamespacedName.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NamespacedNames message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.NamespacedNames + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.NamespacedNames} NamespacedNames + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamespacedNames.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamespacedNames message. + * @function verify + * @memberof google.cloud.gkebackup.v1.NamespacedNames + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamespacedNames.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.namespacedNames != null && message.hasOwnProperty("namespacedNames")) { + if (!Array.isArray(message.namespacedNames)) + return "namespacedNames: array expected"; + for (var i = 0; i < message.namespacedNames.length; ++i) { + var error = $root.google.cloud.gkebackup.v1.NamespacedName.verify(message.namespacedNames[i]); + if (error) + return "namespacedNames." + error; + } + } + return null; + }; + + /** + * Creates a NamespacedNames message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.NamespacedNames + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.NamespacedNames} NamespacedNames + */ + NamespacedNames.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.NamespacedNames) + return object; + var message = new $root.google.cloud.gkebackup.v1.NamespacedNames(); + if (object.namespacedNames) { + if (!Array.isArray(object.namespacedNames)) + throw TypeError(".google.cloud.gkebackup.v1.NamespacedNames.namespacedNames: array expected"); + message.namespacedNames = []; + for (var i = 0; i < object.namespacedNames.length; ++i) { + if (typeof object.namespacedNames[i] !== "object") + throw TypeError(".google.cloud.gkebackup.v1.NamespacedNames.namespacedNames: object expected"); + message.namespacedNames[i] = $root.google.cloud.gkebackup.v1.NamespacedName.fromObject(object.namespacedNames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NamespacedNames message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.NamespacedNames + * @static + * @param {google.cloud.gkebackup.v1.NamespacedNames} message NamespacedNames + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamespacedNames.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.namespacedNames = []; + if (message.namespacedNames && message.namespacedNames.length) { + object.namespacedNames = []; + for (var j = 0; j < message.namespacedNames.length; ++j) + object.namespacedNames[j] = $root.google.cloud.gkebackup.v1.NamespacedName.toObject(message.namespacedNames[j], options); + } + return object; + }; + + /** + * Converts this NamespacedNames to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.NamespacedNames + * @instance + * @returns {Object.} JSON object + */ + NamespacedNames.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamespacedNames + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.NamespacedNames + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamespacedNames.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.NamespacedNames"; + }; + + return NamespacedNames; + })(); + + v1.EncryptionKey = (function() { + + /** + * Properties of an EncryptionKey. + * @memberof google.cloud.gkebackup.v1 + * @interface IEncryptionKey + * @property {string|null} [gcpKmsEncryptionKey] EncryptionKey gcpKmsEncryptionKey + */ + + /** + * Constructs a new EncryptionKey. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents an EncryptionKey. + * @implements IEncryptionKey + * @constructor + * @param {google.cloud.gkebackup.v1.IEncryptionKey=} [properties] Properties to set + */ + function EncryptionKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionKey gcpKmsEncryptionKey. + * @member {string} gcpKmsEncryptionKey + * @memberof google.cloud.gkebackup.v1.EncryptionKey + * @instance + */ + EncryptionKey.prototype.gcpKmsEncryptionKey = ""; + + /** + * Creates a new EncryptionKey instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.EncryptionKey + * @static + * @param {google.cloud.gkebackup.v1.IEncryptionKey=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.EncryptionKey} EncryptionKey instance + */ + EncryptionKey.create = function create(properties) { + return new EncryptionKey(properties); + }; + + /** + * Encodes the specified EncryptionKey message. Does not implicitly {@link google.cloud.gkebackup.v1.EncryptionKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.EncryptionKey + * @static + * @param {google.cloud.gkebackup.v1.IEncryptionKey} message EncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpKmsEncryptionKey != null && Object.hasOwnProperty.call(message, "gcpKmsEncryptionKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpKmsEncryptionKey); + return writer; + }; + + /** + * Encodes the specified EncryptionKey message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.EncryptionKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.EncryptionKey + * @static + * @param {google.cloud.gkebackup.v1.IEncryptionKey} message EncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.EncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.EncryptionKey} EncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.EncryptionKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcpKmsEncryptionKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.EncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.EncryptionKey} EncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionKey message. + * @function verify + * @memberof google.cloud.gkebackup.v1.EncryptionKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcpKmsEncryptionKey != null && message.hasOwnProperty("gcpKmsEncryptionKey")) + if (!$util.isString(message.gcpKmsEncryptionKey)) + return "gcpKmsEncryptionKey: string expected"; + return null; + }; + + /** + * Creates an EncryptionKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.EncryptionKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.EncryptionKey} EncryptionKey + */ + EncryptionKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.EncryptionKey) + return object; + var message = new $root.google.cloud.gkebackup.v1.EncryptionKey(); + if (object.gcpKmsEncryptionKey != null) + message.gcpKmsEncryptionKey = String(object.gcpKmsEncryptionKey); + return message; + }; + + /** + * Creates a plain object from an EncryptionKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.EncryptionKey + * @static + * @param {google.cloud.gkebackup.v1.EncryptionKey} message EncryptionKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcpKmsEncryptionKey = ""; + if (message.gcpKmsEncryptionKey != null && message.hasOwnProperty("gcpKmsEncryptionKey")) + object.gcpKmsEncryptionKey = message.gcpKmsEncryptionKey; + return object; + }; + + /** + * Converts this EncryptionKey to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.EncryptionKey + * @instance + * @returns {Object.} JSON object + */ + EncryptionKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionKey + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.EncryptionKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.EncryptionKey"; + }; + + return EncryptionKey; + })(); + + v1.BackupPlan = (function() { + + /** + * Properties of a BackupPlan. + * @memberof google.cloud.gkebackup.v1 + * @interface IBackupPlan + * @property {string|null} [name] BackupPlan name + * @property {string|null} [uid] BackupPlan uid + * @property {google.protobuf.ITimestamp|null} [createTime] BackupPlan createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupPlan updateTime + * @property {string|null} [description] BackupPlan description + * @property {string|null} [cluster] BackupPlan cluster + * @property {google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy|null} [retentionPolicy] BackupPlan retentionPolicy + * @property {Object.|null} [labels] BackupPlan labels + * @property {google.cloud.gkebackup.v1.BackupPlan.ISchedule|null} [backupSchedule] BackupPlan backupSchedule + * @property {string|null} [etag] BackupPlan etag + * @property {boolean|null} [deactivated] BackupPlan deactivated + * @property {google.cloud.gkebackup.v1.BackupPlan.IBackupConfig|null} [backupConfig] BackupPlan backupConfig + * @property {number|null} [protectedPodCount] BackupPlan protectedPodCount + */ + + /** + * Constructs a new BackupPlan. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a BackupPlan. + * @implements IBackupPlan + * @constructor + * @param {google.cloud.gkebackup.v1.IBackupPlan=} [properties] Properties to set + */ + function BackupPlan(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]]; + } + + /** + * BackupPlan name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.name = ""; + + /** + * BackupPlan uid. + * @member {string} uid + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.uid = ""; + + /** + * BackupPlan createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.createTime = null; + + /** + * BackupPlan updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.updateTime = null; + + /** + * BackupPlan description. + * @member {string} description + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.description = ""; + + /** + * BackupPlan cluster. + * @member {string} cluster + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.cluster = ""; + + /** + * BackupPlan retentionPolicy. + * @member {google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy|null|undefined} retentionPolicy + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.retentionPolicy = null; + + /** + * BackupPlan labels. + * @member {Object.} labels + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.labels = $util.emptyObject; + + /** + * BackupPlan backupSchedule. + * @member {google.cloud.gkebackup.v1.BackupPlan.ISchedule|null|undefined} backupSchedule + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.backupSchedule = null; + + /** + * BackupPlan etag. + * @member {string} etag + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.etag = ""; + + /** + * BackupPlan deactivated. + * @member {boolean} deactivated + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.deactivated = false; + + /** + * BackupPlan backupConfig. + * @member {google.cloud.gkebackup.v1.BackupPlan.IBackupConfig|null|undefined} backupConfig + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.backupConfig = null; + + /** + * BackupPlan protectedPodCount. + * @member {number} protectedPodCount + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.protectedPodCount = 0; + + /** + * Creates a new BackupPlan instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @static + * @param {google.cloud.gkebackup.v1.IBackupPlan=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.BackupPlan} BackupPlan instance + */ + BackupPlan.create = function create(properties) { + return new BackupPlan(properties); + }; + + /** + * Encodes the specified BackupPlan message. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @static + * @param {google.cloud.gkebackup.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.cluster); + if (message.retentionPolicy != null && Object.hasOwnProperty.call(message, "retentionPolicy")) + $root.google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.encode(message.retentionPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) + $root.google.cloud.gkebackup.v1.BackupPlan.Schedule.encode(message.backupSchedule, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); + if (message.deactivated != null && Object.hasOwnProperty.call(message, "deactivated")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deactivated); + if (message.backupConfig != null && Object.hasOwnProperty.call(message, "backupConfig")) + $root.google.cloud.gkebackup.v1.BackupPlan.BackupConfig.encode(message.backupConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.protectedPodCount != null && Object.hasOwnProperty.call(message, "protectedPodCount")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.protectedPodCount); + return writer; + }; + + /** + * Encodes the specified BackupPlan message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.BackupPlan(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.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: { + message.description = reader.string(); + break; + } + case 6: { + message.cluster = reader.string(); + break; + } + case 7: { + message.retentionPolicy = $root.google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + message.backupSchedule = $root.google.cloud.gkebackup.v1.BackupPlan.Schedule.decode(reader, reader.uint32()); + break; + } + case 10: { + message.etag = reader.string(); + break; + } + case 11: { + message.deactivated = reader.bool(); + break; + } + case 12: { + message.backupConfig = $root.google.cloud.gkebackup.v1.BackupPlan.BackupConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.protectedPodCount = reader.int32(); + 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.gkebackup.v1.BackupPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.retentionPolicy != null && message.hasOwnProperty("retentionPolicy")) { + var error = $root.google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.verify(message.retentionPolicy); + if (error) + return "retentionPolicy." + 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.backupSchedule != null && message.hasOwnProperty("backupSchedule")) { + var error = $root.google.cloud.gkebackup.v1.BackupPlan.Schedule.verify(message.backupSchedule); + if (error) + return "backupSchedule." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deactivated != null && message.hasOwnProperty("deactivated")) + if (typeof message.deactivated !== "boolean") + return "deactivated: boolean expected"; + if (message.backupConfig != null && message.hasOwnProperty("backupConfig")) { + var error = $root.google.cloud.gkebackup.v1.BackupPlan.BackupConfig.verify(message.backupConfig); + if (error) + return "backupConfig." + error; + } + if (message.protectedPodCount != null && message.hasOwnProperty("protectedPodCount")) + if (!$util.isInteger(message.protectedPodCount)) + return "protectedPodCount: integer expected"; + return null; + }; + + /** + * Creates a BackupPlan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.BackupPlan} BackupPlan + */ + BackupPlan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.BackupPlan) + return object; + var message = new $root.google.cloud.gkebackup.v1.BackupPlan(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gkebackup.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.gkebackup.v1.BackupPlan.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.retentionPolicy != null) { + if (typeof object.retentionPolicy !== "object") + throw TypeError(".google.cloud.gkebackup.v1.BackupPlan.retentionPolicy: object expected"); + message.retentionPolicy = $root.google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.fromObject(object.retentionPolicy); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gkebackup.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.backupSchedule != null) { + if (typeof object.backupSchedule !== "object") + throw TypeError(".google.cloud.gkebackup.v1.BackupPlan.backupSchedule: object expected"); + message.backupSchedule = $root.google.cloud.gkebackup.v1.BackupPlan.Schedule.fromObject(object.backupSchedule); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.deactivated != null) + message.deactivated = Boolean(object.deactivated); + if (object.backupConfig != null) { + if (typeof object.backupConfig !== "object") + throw TypeError(".google.cloud.gkebackup.v1.BackupPlan.backupConfig: object expected"); + message.backupConfig = $root.google.cloud.gkebackup.v1.BackupPlan.BackupConfig.fromObject(object.backupConfig); + } + if (object.protectedPodCount != null) + message.protectedPodCount = object.protectedPodCount | 0; + return message; + }; + + /** + * Creates a plain object from a BackupPlan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @static + * @param {google.cloud.gkebackup.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.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.cluster = ""; + object.retentionPolicy = null; + object.backupSchedule = null; + object.etag = ""; + object.deactivated = false; + object.backupConfig = null; + object.protectedPodCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.retentionPolicy != null && message.hasOwnProperty("retentionPolicy")) + object.retentionPolicy = $root.google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.toObject(message.retentionPolicy, 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.backupSchedule != null && message.hasOwnProperty("backupSchedule")) + object.backupSchedule = $root.google.cloud.gkebackup.v1.BackupPlan.Schedule.toObject(message.backupSchedule, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deactivated != null && message.hasOwnProperty("deactivated")) + object.deactivated = message.deactivated; + if (message.backupConfig != null && message.hasOwnProperty("backupConfig")) + object.backupConfig = $root.google.cloud.gkebackup.v1.BackupPlan.BackupConfig.toObject(message.backupConfig, options); + if (message.protectedPodCount != null && message.hasOwnProperty("protectedPodCount")) + object.protectedPodCount = message.protectedPodCount; + return object; + }; + + /** + * Converts this BackupPlan to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.BackupPlan"; + }; + + BackupPlan.RetentionPolicy = (function() { + + /** + * Properties of a RetentionPolicy. + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @interface IRetentionPolicy + * @property {number|null} [backupDeleteLockDays] RetentionPolicy backupDeleteLockDays + * @property {number|null} [backupRetainDays] RetentionPolicy backupRetainDays + * @property {boolean|null} [locked] RetentionPolicy locked + */ + + /** + * Constructs a new RetentionPolicy. + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @classdesc Represents a RetentionPolicy. + * @implements IRetentionPolicy + * @constructor + * @param {google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy=} [properties] Properties to set + */ + function RetentionPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetentionPolicy backupDeleteLockDays. + * @member {number} backupDeleteLockDays + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @instance + */ + RetentionPolicy.prototype.backupDeleteLockDays = 0; + + /** + * RetentionPolicy backupRetainDays. + * @member {number} backupRetainDays + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @instance + */ + RetentionPolicy.prototype.backupRetainDays = 0; + + /** + * RetentionPolicy locked. + * @member {boolean} locked + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @instance + */ + RetentionPolicy.prototype.locked = false; + + /** + * Creates a new RetentionPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy} RetentionPolicy instance + */ + RetentionPolicy.create = function create(properties) { + return new RetentionPolicy(properties); + }; + + /** + * Encodes the specified RetentionPolicy message. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy} message RetentionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetentionPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupDeleteLockDays != null && Object.hasOwnProperty.call(message, "backupDeleteLockDays")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.backupDeleteLockDays); + if (message.backupRetainDays != null && Object.hasOwnProperty.call(message, "backupRetainDays")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.backupRetainDays); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.locked); + return writer; + }; + + /** + * Encodes the specified RetentionPolicy message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.IRetentionPolicy} message RetentionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetentionPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetentionPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy} RetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetentionPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backupDeleteLockDays = reader.int32(); + break; + } + case 2: { + message.backupRetainDays = reader.int32(); + break; + } + case 3: { + message.locked = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetentionPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy} RetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetentionPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetentionPolicy message. + * @function verify + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetentionPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupDeleteLockDays != null && message.hasOwnProperty("backupDeleteLockDays")) + if (!$util.isInteger(message.backupDeleteLockDays)) + return "backupDeleteLockDays: integer expected"; + if (message.backupRetainDays != null && message.hasOwnProperty("backupRetainDays")) + if (!$util.isInteger(message.backupRetainDays)) + return "backupRetainDays: integer expected"; + if (message.locked != null && message.hasOwnProperty("locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + return null; + }; + + /** + * Creates a RetentionPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy} RetentionPolicy + */ + RetentionPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy) + return object; + var message = new $root.google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy(); + if (object.backupDeleteLockDays != null) + message.backupDeleteLockDays = object.backupDeleteLockDays | 0; + if (object.backupRetainDays != null) + message.backupRetainDays = object.backupRetainDays | 0; + if (object.locked != null) + message.locked = Boolean(object.locked); + return message; + }; + + /** + * Creates a plain object from a RetentionPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy} message RetentionPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetentionPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupDeleteLockDays = 0; + object.backupRetainDays = 0; + object.locked = false; + } + if (message.backupDeleteLockDays != null && message.hasOwnProperty("backupDeleteLockDays")) + object.backupDeleteLockDays = message.backupDeleteLockDays; + if (message.backupRetainDays != null && message.hasOwnProperty("backupRetainDays")) + object.backupRetainDays = message.backupRetainDays; + if (message.locked != null && message.hasOwnProperty("locked")) + object.locked = message.locked; + return object; + }; + + /** + * Converts this RetentionPolicy to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @instance + * @returns {Object.} JSON object + */ + RetentionPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetentionPolicy + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetentionPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy"; + }; + + return RetentionPolicy; + })(); + + BackupPlan.Schedule = (function() { + + /** + * Properties of a Schedule. + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @interface ISchedule + * @property {string|null} [cronSchedule] Schedule cronSchedule + * @property {boolean|null} [paused] Schedule paused + */ + + /** + * Constructs a new Schedule. + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @classdesc Represents a Schedule. + * @implements ISchedule + * @constructor + * @param {google.cloud.gkebackup.v1.BackupPlan.ISchedule=} [properties] Properties to set + */ + function Schedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Schedule cronSchedule. + * @member {string} cronSchedule + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @instance + */ + Schedule.prototype.cronSchedule = ""; + + /** + * Schedule paused. + * @member {boolean} paused + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @instance + */ + Schedule.prototype.paused = false; + + /** + * Creates a new Schedule instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.ISchedule=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.BackupPlan.Schedule} Schedule instance + */ + Schedule.create = function create(properties) { + return new Schedule(properties); + }; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.Schedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cronSchedule != null && Object.hasOwnProperty.call(message, "cronSchedule")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cronSchedule); + if (message.paused != null && Object.hasOwnProperty.call(message, "paused")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.paused); + return writer; + }; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.Schedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.BackupPlan.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.BackupPlan.Schedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cronSchedule = reader.string(); + break; + } + case 2: { + message.paused = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.BackupPlan.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schedule message. + * @function verify + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cronSchedule != null && message.hasOwnProperty("cronSchedule")) + if (!$util.isString(message.cronSchedule)) + return "cronSchedule: string expected"; + if (message.paused != null && message.hasOwnProperty("paused")) + if (typeof message.paused !== "boolean") + return "paused: boolean expected"; + return null; + }; + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.BackupPlan.Schedule} Schedule + */ + Schedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.BackupPlan.Schedule) + return object; + var message = new $root.google.cloud.gkebackup.v1.BackupPlan.Schedule(); + if (object.cronSchedule != null) + message.cronSchedule = String(object.cronSchedule); + if (object.paused != null) + message.paused = Boolean(object.paused); + return message; + }; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.Schedule} message Schedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cronSchedule = ""; + object.paused = false; + } + if (message.cronSchedule != null && message.hasOwnProperty("cronSchedule")) + object.cronSchedule = message.cronSchedule; + if (message.paused != null && message.hasOwnProperty("paused")) + object.paused = message.paused; + return object; + }; + + /** + * Converts this Schedule to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @instance + * @returns {Object.} JSON object + */ + Schedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schedule + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.BackupPlan.Schedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.BackupPlan.Schedule"; + }; + + return Schedule; + })(); + + BackupPlan.BackupConfig = (function() { + + /** + * Properties of a BackupConfig. + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @interface IBackupConfig + * @property {boolean|null} [allNamespaces] BackupConfig allNamespaces + * @property {google.cloud.gkebackup.v1.INamespaces|null} [selectedNamespaces] BackupConfig selectedNamespaces + * @property {google.cloud.gkebackup.v1.INamespacedNames|null} [selectedApplications] BackupConfig selectedApplications + * @property {boolean|null} [includeVolumeData] BackupConfig includeVolumeData + * @property {boolean|null} [includeSecrets] BackupConfig includeSecrets + * @property {google.cloud.gkebackup.v1.IEncryptionKey|null} [encryptionKey] BackupConfig encryptionKey + */ + + /** + * Constructs a new BackupConfig. + * @memberof google.cloud.gkebackup.v1.BackupPlan + * @classdesc Represents a BackupConfig. + * @implements IBackupConfig + * @constructor + * @param {google.cloud.gkebackup.v1.BackupPlan.IBackupConfig=} [properties] Properties to set + */ + function BackupConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupConfig allNamespaces. + * @member {boolean|null|undefined} allNamespaces + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @instance + */ + BackupConfig.prototype.allNamespaces = null; + + /** + * BackupConfig selectedNamespaces. + * @member {google.cloud.gkebackup.v1.INamespaces|null|undefined} selectedNamespaces + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @instance + */ + BackupConfig.prototype.selectedNamespaces = null; + + /** + * BackupConfig selectedApplications. + * @member {google.cloud.gkebackup.v1.INamespacedNames|null|undefined} selectedApplications + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @instance + */ + BackupConfig.prototype.selectedApplications = null; + + /** + * BackupConfig includeVolumeData. + * @member {boolean} includeVolumeData + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @instance + */ + BackupConfig.prototype.includeVolumeData = false; + + /** + * BackupConfig includeSecrets. + * @member {boolean} includeSecrets + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @instance + */ + BackupConfig.prototype.includeSecrets = false; + + /** + * BackupConfig encryptionKey. + * @member {google.cloud.gkebackup.v1.IEncryptionKey|null|undefined} encryptionKey + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @instance + */ + BackupConfig.prototype.encryptionKey = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupConfig backupScope. + * @member {"allNamespaces"|"selectedNamespaces"|"selectedApplications"|undefined} backupScope + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @instance + */ + Object.defineProperty(BackupConfig.prototype, "backupScope", { + get: $util.oneOfGetter($oneOfFields = ["allNamespaces", "selectedNamespaces", "selectedApplications"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.IBackupConfig=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.BackupPlan.BackupConfig} BackupConfig instance + */ + BackupConfig.create = function create(properties) { + return new BackupConfig(properties); + }; + + /** + * Encodes the specified BackupConfig message. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.BackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.IBackupConfig} message BackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allNamespaces != null && Object.hasOwnProperty.call(message, "allNamespaces")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allNamespaces); + if (message.selectedNamespaces != null && Object.hasOwnProperty.call(message, "selectedNamespaces")) + $root.google.cloud.gkebackup.v1.Namespaces.encode(message.selectedNamespaces, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.selectedApplications != null && Object.hasOwnProperty.call(message, "selectedApplications")) + $root.google.cloud.gkebackup.v1.NamespacedNames.encode(message.selectedApplications, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.includeVolumeData != null && Object.hasOwnProperty.call(message, "includeVolumeData")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.includeVolumeData); + if (message.includeSecrets != null && Object.hasOwnProperty.call(message, "includeSecrets")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.includeSecrets); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + $root.google.cloud.gkebackup.v1.EncryptionKey.encode(message.encryptionKey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupConfig message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.BackupPlan.BackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.IBackupConfig} message BackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.BackupPlan.BackupConfig} BackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.BackupPlan.BackupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.allNamespaces = reader.bool(); + break; + } + case 2: { + message.selectedNamespaces = $root.google.cloud.gkebackup.v1.Namespaces.decode(reader, reader.uint32()); + break; + } + case 3: { + message.selectedApplications = $root.google.cloud.gkebackup.v1.NamespacedNames.decode(reader, reader.uint32()); + break; + } + case 4: { + message.includeVolumeData = reader.bool(); + break; + } + case 5: { + message.includeSecrets = reader.bool(); + break; + } + case 6: { + message.encryptionKey = $root.google.cloud.gkebackup.v1.EncryptionKey.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.BackupPlan.BackupConfig} BackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupConfig message. + * @function verify + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allNamespaces != null && message.hasOwnProperty("allNamespaces")) { + properties.backupScope = 1; + if (typeof message.allNamespaces !== "boolean") + return "allNamespaces: boolean expected"; + } + if (message.selectedNamespaces != null && message.hasOwnProperty("selectedNamespaces")) { + if (properties.backupScope === 1) + return "backupScope: multiple values"; + properties.backupScope = 1; + { + var error = $root.google.cloud.gkebackup.v1.Namespaces.verify(message.selectedNamespaces); + if (error) + return "selectedNamespaces." + error; + } + } + if (message.selectedApplications != null && message.hasOwnProperty("selectedApplications")) { + if (properties.backupScope === 1) + return "backupScope: multiple values"; + properties.backupScope = 1; + { + var error = $root.google.cloud.gkebackup.v1.NamespacedNames.verify(message.selectedApplications); + if (error) + return "selectedApplications." + error; + } + } + if (message.includeVolumeData != null && message.hasOwnProperty("includeVolumeData")) + if (typeof message.includeVolumeData !== "boolean") + return "includeVolumeData: boolean expected"; + if (message.includeSecrets != null && message.hasOwnProperty("includeSecrets")) + if (typeof message.includeSecrets !== "boolean") + return "includeSecrets: boolean expected"; + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) { + var error = $root.google.cloud.gkebackup.v1.EncryptionKey.verify(message.encryptionKey); + if (error) + return "encryptionKey." + error; + } + return null; + }; + + /** + * Creates a BackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.BackupPlan.BackupConfig} BackupConfig + */ + BackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.BackupPlan.BackupConfig) + return object; + var message = new $root.google.cloud.gkebackup.v1.BackupPlan.BackupConfig(); + if (object.allNamespaces != null) + message.allNamespaces = Boolean(object.allNamespaces); + if (object.selectedNamespaces != null) { + if (typeof object.selectedNamespaces !== "object") + throw TypeError(".google.cloud.gkebackup.v1.BackupPlan.BackupConfig.selectedNamespaces: object expected"); + message.selectedNamespaces = $root.google.cloud.gkebackup.v1.Namespaces.fromObject(object.selectedNamespaces); + } + if (object.selectedApplications != null) { + if (typeof object.selectedApplications !== "object") + throw TypeError(".google.cloud.gkebackup.v1.BackupPlan.BackupConfig.selectedApplications: object expected"); + message.selectedApplications = $root.google.cloud.gkebackup.v1.NamespacedNames.fromObject(object.selectedApplications); + } + if (object.includeVolumeData != null) + message.includeVolumeData = Boolean(object.includeVolumeData); + if (object.includeSecrets != null) + message.includeSecrets = Boolean(object.includeSecrets); + if (object.encryptionKey != null) { + if (typeof object.encryptionKey !== "object") + throw TypeError(".google.cloud.gkebackup.v1.BackupPlan.BackupConfig.encryptionKey: object expected"); + message.encryptionKey = $root.google.cloud.gkebackup.v1.EncryptionKey.fromObject(object.encryptionKey); + } + return message; + }; + + /** + * Creates a plain object from a BackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @static + * @param {google.cloud.gkebackup.v1.BackupPlan.BackupConfig} message BackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.includeVolumeData = false; + object.includeSecrets = false; + object.encryptionKey = null; + } + if (message.allNamespaces != null && message.hasOwnProperty("allNamespaces")) { + object.allNamespaces = message.allNamespaces; + if (options.oneofs) + object.backupScope = "allNamespaces"; + } + if (message.selectedNamespaces != null && message.hasOwnProperty("selectedNamespaces")) { + object.selectedNamespaces = $root.google.cloud.gkebackup.v1.Namespaces.toObject(message.selectedNamespaces, options); + if (options.oneofs) + object.backupScope = "selectedNamespaces"; + } + if (message.selectedApplications != null && message.hasOwnProperty("selectedApplications")) { + object.selectedApplications = $root.google.cloud.gkebackup.v1.NamespacedNames.toObject(message.selectedApplications, options); + if (options.oneofs) + object.backupScope = "selectedApplications"; + } + if (message.includeVolumeData != null && message.hasOwnProperty("includeVolumeData")) + object.includeVolumeData = message.includeVolumeData; + if (message.includeSecrets != null && message.hasOwnProperty("includeSecrets")) + object.includeSecrets = message.includeSecrets; + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + object.encryptionKey = $root.google.cloud.gkebackup.v1.EncryptionKey.toObject(message.encryptionKey, options); + return object; + }; + + /** + * Converts this BackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @instance + * @returns {Object.} JSON object + */ + BackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupConfig + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.BackupPlan.BackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.BackupPlan.BackupConfig"; + }; + + return BackupConfig; + })(); + + return BackupPlan; + })(); + + v1.BackupForGKE = (function() { + + /** + * Constructs a new BackupForGKE service. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a BackupForGKE + * @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 BackupForGKE(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BackupForGKE.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BackupForGKE; + + /** + * Creates new BackupForGKE service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @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 {BackupForGKE} RPC service. Useful where requests and/or responses are streamed. + */ + BackupForGKE.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|createBackupPlan}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef CreateBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackupPlan. + * @function createBackupPlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.ICreateBackupPlanRequest} request CreateBackupPlanRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.CreateBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.createBackupPlan = function createBackupPlan(request, callback) { + return this.rpcCall(createBackupPlan, $root.google.cloud.gkebackup.v1.CreateBackupPlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackupPlan" }); + + /** + * Calls CreateBackupPlan. + * @function createBackupPlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.ICreateBackupPlanRequest} request CreateBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|listBackupPlans}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef ListBackupPlansCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.ListBackupPlansResponse} [response] ListBackupPlansResponse + */ + + /** + * Calls ListBackupPlans. + * @function listBackupPlans + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListBackupPlansRequest} request ListBackupPlansRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.ListBackupPlansCallback} callback Node-style callback called with the error, if any, and ListBackupPlansResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.listBackupPlans = function listBackupPlans(request, callback) { + return this.rpcCall(listBackupPlans, $root.google.cloud.gkebackup.v1.ListBackupPlansRequest, $root.google.cloud.gkebackup.v1.ListBackupPlansResponse, request, callback); + }, "name", { value: "ListBackupPlans" }); + + /** + * Calls ListBackupPlans. + * @function listBackupPlans + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListBackupPlansRequest} request ListBackupPlansRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getBackupPlan}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef GetBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.BackupPlan} [response] BackupPlan + */ + + /** + * Calls GetBackupPlan. + * @function getBackupPlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetBackupPlanRequest} request GetBackupPlanRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.GetBackupPlanCallback} callback Node-style callback called with the error, if any, and BackupPlan + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.getBackupPlan = function getBackupPlan(request, callback) { + return this.rpcCall(getBackupPlan, $root.google.cloud.gkebackup.v1.GetBackupPlanRequest, $root.google.cloud.gkebackup.v1.BackupPlan, request, callback); + }, "name", { value: "GetBackupPlan" }); + + /** + * Calls GetBackupPlan. + * @function getBackupPlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetBackupPlanRequest} request GetBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|updateBackupPlan}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef UpdateBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackupPlan. + * @function updateBackupPlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IUpdateBackupPlanRequest} request UpdateBackupPlanRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.UpdateBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.updateBackupPlan = function updateBackupPlan(request, callback) { + return this.rpcCall(updateBackupPlan, $root.google.cloud.gkebackup.v1.UpdateBackupPlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackupPlan" }); + + /** + * Calls UpdateBackupPlan. + * @function updateBackupPlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IUpdateBackupPlanRequest} request UpdateBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|deleteBackupPlan}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef DeleteBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackupPlan. + * @function deleteBackupPlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IDeleteBackupPlanRequest} request DeleteBackupPlanRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.DeleteBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.deleteBackupPlan = function deleteBackupPlan(request, callback) { + return this.rpcCall(deleteBackupPlan, $root.google.cloud.gkebackup.v1.DeleteBackupPlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackupPlan" }); + + /** + * Calls DeleteBackupPlan. + * @function deleteBackupPlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IDeleteBackupPlanRequest} request DeleteBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|createBackup}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.cloud.gkebackup.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|listBackups}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.gkebackup.v1.ListBackupsRequest, $root.google.cloud.gkebackup.v1.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getBackup}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.gkebackup.v1.GetBackupRequest, $root.google.cloud.gkebackup.v1.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|updateBackup}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.gkebackup.v1.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|deleteBackup}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.gkebackup.v1.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|listVolumeBackups}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef ListVolumeBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.ListVolumeBackupsResponse} [response] ListVolumeBackupsResponse + */ + + /** + * Calls ListVolumeBackups. + * @function listVolumeBackups + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListVolumeBackupsRequest} request ListVolumeBackupsRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.ListVolumeBackupsCallback} callback Node-style callback called with the error, if any, and ListVolumeBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.listVolumeBackups = function listVolumeBackups(request, callback) { + return this.rpcCall(listVolumeBackups, $root.google.cloud.gkebackup.v1.ListVolumeBackupsRequest, $root.google.cloud.gkebackup.v1.ListVolumeBackupsResponse, request, callback); + }, "name", { value: "ListVolumeBackups" }); + + /** + * Calls ListVolumeBackups. + * @function listVolumeBackups + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListVolumeBackupsRequest} request ListVolumeBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getVolumeBackup}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef GetVolumeBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.VolumeBackup} [response] VolumeBackup + */ + + /** + * Calls GetVolumeBackup. + * @function getVolumeBackup + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetVolumeBackupRequest} request GetVolumeBackupRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.GetVolumeBackupCallback} callback Node-style callback called with the error, if any, and VolumeBackup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.getVolumeBackup = function getVolumeBackup(request, callback) { + return this.rpcCall(getVolumeBackup, $root.google.cloud.gkebackup.v1.GetVolumeBackupRequest, $root.google.cloud.gkebackup.v1.VolumeBackup, request, callback); + }, "name", { value: "GetVolumeBackup" }); + + /** + * Calls GetVolumeBackup. + * @function getVolumeBackup + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetVolumeBackupRequest} request GetVolumeBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|createRestorePlan}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef CreateRestorePlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateRestorePlan. + * @function createRestorePlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.ICreateRestorePlanRequest} request CreateRestorePlanRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.CreateRestorePlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.createRestorePlan = function createRestorePlan(request, callback) { + return this.rpcCall(createRestorePlan, $root.google.cloud.gkebackup.v1.CreateRestorePlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateRestorePlan" }); + + /** + * Calls CreateRestorePlan. + * @function createRestorePlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.ICreateRestorePlanRequest} request CreateRestorePlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|listRestorePlans}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef ListRestorePlansCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.ListRestorePlansResponse} [response] ListRestorePlansResponse + */ + + /** + * Calls ListRestorePlans. + * @function listRestorePlans + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListRestorePlansRequest} request ListRestorePlansRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.ListRestorePlansCallback} callback Node-style callback called with the error, if any, and ListRestorePlansResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.listRestorePlans = function listRestorePlans(request, callback) { + return this.rpcCall(listRestorePlans, $root.google.cloud.gkebackup.v1.ListRestorePlansRequest, $root.google.cloud.gkebackup.v1.ListRestorePlansResponse, request, callback); + }, "name", { value: "ListRestorePlans" }); + + /** + * Calls ListRestorePlans. + * @function listRestorePlans + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListRestorePlansRequest} request ListRestorePlansRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getRestorePlan}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef GetRestorePlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.RestorePlan} [response] RestorePlan + */ + + /** + * Calls GetRestorePlan. + * @function getRestorePlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetRestorePlanRequest} request GetRestorePlanRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.GetRestorePlanCallback} callback Node-style callback called with the error, if any, and RestorePlan + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.getRestorePlan = function getRestorePlan(request, callback) { + return this.rpcCall(getRestorePlan, $root.google.cloud.gkebackup.v1.GetRestorePlanRequest, $root.google.cloud.gkebackup.v1.RestorePlan, request, callback); + }, "name", { value: "GetRestorePlan" }); + + /** + * Calls GetRestorePlan. + * @function getRestorePlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetRestorePlanRequest} request GetRestorePlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|updateRestorePlan}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef UpdateRestorePlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateRestorePlan. + * @function updateRestorePlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IUpdateRestorePlanRequest} request UpdateRestorePlanRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.UpdateRestorePlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.updateRestorePlan = function updateRestorePlan(request, callback) { + return this.rpcCall(updateRestorePlan, $root.google.cloud.gkebackup.v1.UpdateRestorePlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateRestorePlan" }); + + /** + * Calls UpdateRestorePlan. + * @function updateRestorePlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IUpdateRestorePlanRequest} request UpdateRestorePlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|deleteRestorePlan}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef DeleteRestorePlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteRestorePlan. + * @function deleteRestorePlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IDeleteRestorePlanRequest} request DeleteRestorePlanRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.DeleteRestorePlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.deleteRestorePlan = function deleteRestorePlan(request, callback) { + return this.rpcCall(deleteRestorePlan, $root.google.cloud.gkebackup.v1.DeleteRestorePlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteRestorePlan" }); + + /** + * Calls DeleteRestorePlan. + * @function deleteRestorePlan + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IDeleteRestorePlanRequest} request DeleteRestorePlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|createRestore}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef CreateRestoreCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateRestore. + * @function createRestore + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.ICreateRestoreRequest} request CreateRestoreRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.CreateRestoreCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.createRestore = function createRestore(request, callback) { + return this.rpcCall(createRestore, $root.google.cloud.gkebackup.v1.CreateRestoreRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateRestore" }); + + /** + * Calls CreateRestore. + * @function createRestore + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.ICreateRestoreRequest} request CreateRestoreRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|listRestores}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef ListRestoresCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.ListRestoresResponse} [response] ListRestoresResponse + */ + + /** + * Calls ListRestores. + * @function listRestores + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListRestoresRequest} request ListRestoresRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.ListRestoresCallback} callback Node-style callback called with the error, if any, and ListRestoresResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.listRestores = function listRestores(request, callback) { + return this.rpcCall(listRestores, $root.google.cloud.gkebackup.v1.ListRestoresRequest, $root.google.cloud.gkebackup.v1.ListRestoresResponse, request, callback); + }, "name", { value: "ListRestores" }); + + /** + * Calls ListRestores. + * @function listRestores + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListRestoresRequest} request ListRestoresRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getRestore}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef GetRestoreCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.Restore} [response] Restore + */ + + /** + * Calls GetRestore. + * @function getRestore + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetRestoreRequest} request GetRestoreRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.GetRestoreCallback} callback Node-style callback called with the error, if any, and Restore + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.getRestore = function getRestore(request, callback) { + return this.rpcCall(getRestore, $root.google.cloud.gkebackup.v1.GetRestoreRequest, $root.google.cloud.gkebackup.v1.Restore, request, callback); + }, "name", { value: "GetRestore" }); + + /** + * Calls GetRestore. + * @function getRestore + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetRestoreRequest} request GetRestoreRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|updateRestore}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef UpdateRestoreCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateRestore. + * @function updateRestore + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IUpdateRestoreRequest} request UpdateRestoreRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.UpdateRestoreCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.updateRestore = function updateRestore(request, callback) { + return this.rpcCall(updateRestore, $root.google.cloud.gkebackup.v1.UpdateRestoreRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateRestore" }); + + /** + * Calls UpdateRestore. + * @function updateRestore + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IUpdateRestoreRequest} request UpdateRestoreRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|deleteRestore}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef DeleteRestoreCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteRestore. + * @function deleteRestore + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IDeleteRestoreRequest} request DeleteRestoreRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.DeleteRestoreCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.deleteRestore = function deleteRestore(request, callback) { + return this.rpcCall(deleteRestore, $root.google.cloud.gkebackup.v1.DeleteRestoreRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteRestore" }); + + /** + * Calls DeleteRestore. + * @function deleteRestore + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IDeleteRestoreRequest} request DeleteRestoreRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|listVolumeRestores}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef ListVolumeRestoresCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.ListVolumeRestoresResponse} [response] ListVolumeRestoresResponse + */ + + /** + * Calls ListVolumeRestores. + * @function listVolumeRestores + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListVolumeRestoresRequest} request ListVolumeRestoresRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.ListVolumeRestoresCallback} callback Node-style callback called with the error, if any, and ListVolumeRestoresResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.listVolumeRestores = function listVolumeRestores(request, callback) { + return this.rpcCall(listVolumeRestores, $root.google.cloud.gkebackup.v1.ListVolumeRestoresRequest, $root.google.cloud.gkebackup.v1.ListVolumeRestoresResponse, request, callback); + }, "name", { value: "ListVolumeRestores" }); + + /** + * Calls ListVolumeRestores. + * @function listVolumeRestores + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IListVolumeRestoresRequest} request ListVolumeRestoresRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkebackup.v1.BackupForGKE|getVolumeRestore}. + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @typedef GetVolumeRestoreCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gkebackup.v1.VolumeRestore} [response] VolumeRestore + */ + + /** + * Calls GetVolumeRestore. + * @function getVolumeRestore + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetVolumeRestoreRequest} request GetVolumeRestoreRequest message or plain object + * @param {google.cloud.gkebackup.v1.BackupForGKE.GetVolumeRestoreCallback} callback Node-style callback called with the error, if any, and VolumeRestore + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupForGKE.prototype.getVolumeRestore = function getVolumeRestore(request, callback) { + return this.rpcCall(getVolumeRestore, $root.google.cloud.gkebackup.v1.GetVolumeRestoreRequest, $root.google.cloud.gkebackup.v1.VolumeRestore, request, callback); + }, "name", { value: "GetVolumeRestore" }); + + /** + * Calls GetVolumeRestore. + * @function getVolumeRestore + * @memberof google.cloud.gkebackup.v1.BackupForGKE + * @instance + * @param {google.cloud.gkebackup.v1.IGetVolumeRestoreRequest} request GetVolumeRestoreRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BackupForGKE; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.gkebackup.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.gkebackup.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @static + * @param {google.cloud.gkebackup.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.gkebackup.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @static + * @param {google.cloud.gkebackup.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.gkebackup.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gkebackup.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.gkebackup.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.OperationMetadata + * @static + * @param {google.cloud.gkebackup.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.CreateBackupPlanRequest = (function() { + + /** + * Properties of a CreateBackupPlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface ICreateBackupPlanRequest + * @property {string|null} [parent] CreateBackupPlanRequest parent + * @property {google.cloud.gkebackup.v1.IBackupPlan|null} [backupPlan] CreateBackupPlanRequest backupPlan + * @property {string|null} [backupPlanId] CreateBackupPlanRequest backupPlanId + */ + + /** + * Constructs a new CreateBackupPlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a CreateBackupPlanRequest. + * @implements ICreateBackupPlanRequest + * @constructor + * @param {google.cloud.gkebackup.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.gkebackup.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.parent = ""; + + /** + * CreateBackupPlanRequest backupPlan. + * @member {google.cloud.gkebackup.v1.IBackupPlan|null|undefined} backupPlan + * @memberof google.cloud.gkebackup.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.backupPlan = null; + + /** + * CreateBackupPlanRequest backupPlanId. + * @member {string} backupPlanId + * @memberof google.cloud.gkebackup.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.backupPlanId = ""; + + /** + * Creates a new CreateBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.v1.ICreateBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.CreateBackupPlanRequest} CreateBackupPlanRequest instance + */ + CreateBackupPlanRequest.create = function create(properties) { + return new CreateBackupPlanRequest(properties); + }; + + /** + * Encodes the specified CreateBackupPlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.CreateBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + $root.google.cloud.gkebackup.v1.BackupPlan.encode(message.backupPlan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.backupPlanId != null && Object.hasOwnProperty.call(message, "backupPlanId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupPlanId); + return writer; + }; + + /** + * Encodes the specified CreateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.CreateBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.CreateBackupPlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupPlan = $root.google.cloud.gkebackup.v1.BackupPlan.decode(reader, reader.uint32()); + break; + } + case 3: { + message.backupPlanId = 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.gkebackup.v1.CreateBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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.backupPlan != null && message.hasOwnProperty("backupPlan")) { + var error = $root.google.cloud.gkebackup.v1.BackupPlan.verify(message.backupPlan); + if (error) + return "backupPlan." + error; + } + if (message.backupPlanId != null && message.hasOwnProperty("backupPlanId")) + if (!$util.isString(message.backupPlanId)) + return "backupPlanId: 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.gkebackup.v1.CreateBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.CreateBackupPlanRequest} CreateBackupPlanRequest + */ + CreateBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.CreateBackupPlanRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.CreateBackupPlanRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupPlan != null) { + if (typeof object.backupPlan !== "object") + throw TypeError(".google.cloud.gkebackup.v1.CreateBackupPlanRequest.backupPlan: object expected"); + message.backupPlan = $root.google.cloud.gkebackup.v1.BackupPlan.fromObject(object.backupPlan); + } + if (object.backupPlanId != null) + message.backupPlanId = String(object.backupPlanId); + return message; + }; + + /** + * Creates a plain object from a CreateBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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.backupPlan = null; + object.backupPlanId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = $root.google.cloud.gkebackup.v1.BackupPlan.toObject(message.backupPlan, options); + if (message.backupPlanId != null && message.hasOwnProperty("backupPlanId")) + object.backupPlanId = message.backupPlanId; + return object; + }; + + /** + * Converts this CreateBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.CreateBackupPlanRequest"; + }; + + return CreateBackupPlanRequest; + })(); + + v1.ListBackupPlansRequest = (function() { + + /** + * Properties of a ListBackupPlansRequest. + * @memberof google.cloud.gkebackup.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.gkebackup.v1 + * @classdesc Represents a ListBackupPlansRequest. + * @implements IListBackupPlansRequest + * @constructor + * @param {google.cloud.gkebackup.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.gkebackup.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.parent = ""; + + /** + * ListBackupPlansRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gkebackup.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.pageSize = 0; + + /** + * ListBackupPlansRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gkebackup.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.pageToken = ""; + + /** + * ListBackupPlansRequest filter. + * @member {string} filter + * @memberof google.cloud.gkebackup.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.filter = ""; + + /** + * ListBackupPlansRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gkebackup.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBackupPlansRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.gkebackup.v1.IListBackupPlansRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListBackupPlansRequest} ListBackupPlansRequest instance + */ + ListBackupPlansRequest.create = function create(properties) { + return new ListBackupPlansRequest(properties); + }; + + /** + * Encodes the specified ListBackupPlansRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.ListBackupPlansRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.v1.ListBackupPlansRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListBackupPlansRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + 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.gkebackup.v1.ListBackupPlansRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.ListBackupPlansRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListBackupPlansRequest} ListBackupPlansRequest + */ + ListBackupPlansRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListBackupPlansRequest) + return object; + var message = new $root.google.cloud.gkebackup.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.gkebackup.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.v1.ListBackupPlansRequest"; + }; + + return ListBackupPlansRequest; + })(); + + v1.ListBackupPlansResponse = (function() { + + /** + * Properties of a ListBackupPlansResponse. + * @memberof google.cloud.gkebackup.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.gkebackup.v1 + * @classdesc Represents a ListBackupPlansResponse. + * @implements IListBackupPlansResponse + * @constructor + * @param {google.cloud.gkebackup.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.gkebackup.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.backupPlans = $util.emptyArray; + + /** + * ListBackupPlansResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gkebackup.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.nextPageToken = ""; + + /** + * ListBackupPlansResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gkebackup.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupPlansResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.gkebackup.v1.IListBackupPlansResponse=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListBackupPlansResponse} ListBackupPlansResponse instance + */ + ListBackupPlansResponse.create = function create(properties) { + return new ListBackupPlansResponse(properties); + }; + + /** + * Encodes the specified ListBackupPlansResponse message. Does not implicitly {@link google.cloud.gkebackup.v1.ListBackupPlansResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.ListBackupPlansResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListBackupPlansResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backupPlans && message.backupPlans.length)) + message.backupPlans = []; + message.backupPlans.push($root.google.cloud.gkebackup.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.gkebackup.v1.ListBackupPlansResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.v1.ListBackupPlansResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListBackupPlansResponse} ListBackupPlansResponse + */ + ListBackupPlansResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListBackupPlansResponse) + return object; + var message = new $root.google.cloud.gkebackup.v1.ListBackupPlansResponse(); + if (object.backupPlans) { + if (!Array.isArray(object.backupPlans)) + throw TypeError(".google.cloud.gkebackup.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.gkebackup.v1.ListBackupPlansResponse.backupPlans: object expected"); + message.backupPlans[i] = $root.google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.v1.ListBackupPlansResponse"; + }; + + return ListBackupPlansResponse; + })(); + + v1.GetBackupPlanRequest = (function() { + + /** + * Properties of a GetBackupPlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IGetBackupPlanRequest + * @property {string|null} [name] GetBackupPlanRequest name + */ + + /** + * Constructs a new GetBackupPlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a GetBackupPlanRequest. + * @implements IGetBackupPlanRequest + * @constructor + * @param {google.cloud.gkebackup.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.gkebackup.v1.GetBackupPlanRequest + * @instance + */ + GetBackupPlanRequest.prototype.name = ""; + + /** + * Creates a new GetBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.GetBackupPlanRequest} GetBackupPlanRequest instance + */ + GetBackupPlanRequest.create = function create(properties) { + return new GetBackupPlanRequest(properties); + }; + + /** + * Encodes the specified GetBackupPlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.GetBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.v1.GetBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.GetBackupPlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.GetBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.GetBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.GetBackupPlanRequest} GetBackupPlanRequest + */ + GetBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.GetBackupPlanRequest) + return object; + var message = new $root.google.cloud.gkebackup.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.gkebackup.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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.gkebackup.v1.GetBackupPlanRequest"; + }; + + return GetBackupPlanRequest; + })(); + + v1.UpdateBackupPlanRequest = (function() { + + /** + * Properties of an UpdateBackupPlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IUpdateBackupPlanRequest + * @property {google.cloud.gkebackup.v1.IBackupPlan|null} [backupPlan] UpdateBackupPlanRequest backupPlan + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupPlanRequest updateMask + */ + + /** + * Constructs a new UpdateBackupPlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents an UpdateBackupPlanRequest. + * @implements IUpdateBackupPlanRequest + * @constructor + * @param {google.cloud.gkebackup.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.gkebackup.v1.IBackupPlan|null|undefined} backupPlan + * @memberof google.cloud.gkebackup.v1.UpdateBackupPlanRequest + * @instance + */ + UpdateBackupPlanRequest.prototype.backupPlan = null; + + /** + * UpdateBackupPlanRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gkebackup.v1.UpdateBackupPlanRequest + * @instance + */ + UpdateBackupPlanRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.UpdateBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IUpdateBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.UpdateBackupPlanRequest} UpdateBackupPlanRequest instance + */ + UpdateBackupPlanRequest.create = function create(properties) { + return new UpdateBackupPlanRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupPlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.UpdateBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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(); + return writer; + }; + + /** + * Encodes the specified UpdateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.UpdateBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.UpdateBackupPlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backupPlan = $root.google.cloud.gkebackup.v1.BackupPlan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + 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.gkebackup.v1.UpdateBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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; + } + return null; + }; + + /** + * Creates an UpdateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.UpdateBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.UpdateBackupPlanRequest} UpdateBackupPlanRequest + */ + UpdateBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.UpdateBackupPlanRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.UpdateBackupPlanRequest(); + if (object.backupPlan != null) { + if (typeof object.backupPlan !== "object") + throw TypeError(".google.cloud.gkebackup.v1.UpdateBackupPlanRequest.backupPlan: object expected"); + message.backupPlan = $root.google.cloud.gkebackup.v1.BackupPlan.fromObject(object.backupPlan); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gkebackup.v1.UpdateBackupPlanRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.UpdateBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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; + } + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = $root.google.cloud.gkebackup.v1.BackupPlan.toObject(message.backupPlan, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.UpdateBackupPlanRequest"; + }; + + return UpdateBackupPlanRequest; + })(); + + v1.DeleteBackupPlanRequest = (function() { + + /** + * Properties of a DeleteBackupPlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IDeleteBackupPlanRequest + * @property {string|null} [name] DeleteBackupPlanRequest name + * @property {string|null} [etag] DeleteBackupPlanRequest etag + */ + + /** + * Constructs a new DeleteBackupPlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a DeleteBackupPlanRequest. + * @implements IDeleteBackupPlanRequest + * @constructor + * @param {google.cloud.gkebackup.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.gkebackup.v1.DeleteBackupPlanRequest + * @instance + */ + DeleteBackupPlanRequest.prototype.name = ""; + + /** + * DeleteBackupPlanRequest etag. + * @member {string} etag + * @memberof google.cloud.gkebackup.v1.DeleteBackupPlanRequest + * @instance + */ + DeleteBackupPlanRequest.prototype.etag = ""; + + /** + * Creates a new DeleteBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IDeleteBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest instance + */ + DeleteBackupPlanRequest.create = function create(properties) { + return new DeleteBackupPlanRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupPlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.DeleteBackupPlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = 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.gkebackup.v1.DeleteBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: 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.gkebackup.v1.DeleteBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest + */ + DeleteBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.DeleteBackupPlanRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.DeleteBackupPlanRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.gkebackup.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.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.DeleteBackupPlanRequest"; + }; + + return DeleteBackupPlanRequest; + })(); + + v1.CreateBackupRequest = (function() { + + /** + * Properties of a CreateBackupRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {google.cloud.gkebackup.v1.IBackup|null} [backup] CreateBackupRequest backup + * @property {string|null} [backupId] CreateBackupRequest backupId + */ + + /** + * Constructs a new CreateBackupRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.cloud.gkebackup.v1.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; + + /** + * CreateBackupRequest backup. + * @member {google.cloud.gkebackup.v1.IBackup|null|undefined} backup + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; + + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @static + * @param {google.cloud.gkebackup.v1.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @static + * @param {google.cloud.gkebackup.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.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.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.gkebackup.v1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); + return writer; + }; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @static + * @param {google.cloud.gkebackup.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backup = $root.google.cloud.gkebackup.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.backupId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.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.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.gkebackup.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + return null; + }; + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.CreateBackupRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.gkebackup.v1.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.gkebackup.v1.Backup.fromObject(object.backup); + } + if (object.backupId != null) + message.backupId = String(object.backupId); + return message; + }; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @static + * @param {google.cloud.gkebackup.v1.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backup = null; + object.backupId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.gkebackup.v1.Backup.toObject(message.backup, options); + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + return object; + }; + + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.CreateBackupRequest"; + }; + + return CreateBackupRequest; + })(); + + v1.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.cloud.gkebackup.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 + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.cloud.gkebackup.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.gkebackup.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gkebackup.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gkebackup.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.gkebackup.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gkebackup.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListBackupsRequest + * @static + * @param {google.cloud.gkebackup.v1.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListBackupsRequest + * @static + * @param {google.cloud.gkebackup.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); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListBackupsRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListBackupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + 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.gkebackup.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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"; + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListBackupsRequest) + return object; + var message = new $root.google.cloud.gkebackup.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); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.ListBackupsRequest + * @static + * @param {google.cloud.gkebackup.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 = ""; + } + 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 ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v1.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.cloud.gkebackup.v1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.cloud.gkebackup.v1.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(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]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.gkebackup.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gkebackup.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListBackupsResponse + * @static + * @param {google.cloud.gkebackup.v1.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.gkebackup.v1.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListBackupsResponse + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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 ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListBackupsResponse + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.gkebackup.v1.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = 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.gkebackup.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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 ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListBackupsResponse) + return object; + var message = new $root.google.cloud.gkebackup.v1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.gkebackup.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.gkebackup.v1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.gkebackup.v1.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.ListBackupsResponse + * @static + * @param {google.cloud.gkebackup.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 = []; + 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.gkebackup.v1.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v1.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.cloud.gkebackup.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.gkebackup.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.GetBackupRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.GetBackupRequest + * @static + * @param {google.cloud.gkebackup.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); + return writer; + }; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.GetBackupRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.GetBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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"; + return null; + }; + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.GetBackupRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.GetBackupRequest + * @static + * @param {google.cloud.gkebackup.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 = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v1.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IUpdateBackupRequest + * @property {google.cloud.gkebackup.v1.IBackup|null} [backup] UpdateBackupRequest backup + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.cloud.gkebackup.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 backup. + * @member {google.cloud.gkebackup.v1.IBackup|null|undefined} backup + * @memberof google.cloud.gkebackup.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gkebackup.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.UpdateBackupRequest + * @static + * @param {google.cloud.gkebackup.v1.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.UpdateBackupRequest + * @static + * @param {google.cloud.gkebackup.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.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.gkebackup.v1.Backup.encode(message.backup, 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(); + return writer; + }; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.UpdateBackupRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backup = $root.google.cloud.gkebackup.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + 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.gkebackup.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.gkebackup.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.UpdateBackupRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.UpdateBackupRequest(); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.gkebackup.v1.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.gkebackup.v1.Backup.fromObject(object.backup); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gkebackup.v1.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.UpdateBackupRequest + * @static + * @param {google.cloud.gkebackup.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.backup = null; + object.updateMask = null; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.gkebackup.v1.Backup.toObject(message.backup, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v1.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + * @property {string|null} [etag] DeleteBackupRequest etag + * @property {boolean|null} [force] DeleteBackupRequest force + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.cloud.gkebackup.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.gkebackup.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * DeleteBackupRequest etag. + * @member {string} etag + * @memberof google.cloud.gkebackup.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.etag = ""; + + /** + * DeleteBackupRequest force. + * @member {boolean} force + * @memberof google.cloud.gkebackup.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.force = false; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.DeleteBackupRequest + * @static + * @param {google.cloud.gkebackup.v1.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.DeleteBackupRequest + * @static + * @param {google.cloud.gkebackup.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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.DeleteBackupRequest + * @static + * @param {google.cloud.gkebackup.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.gkebackup.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.gkebackup.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.DeleteBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + 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.gkebackup.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.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.gkebackup.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.DeleteBackupRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.DeleteBackupRequest + * @static + * @param {google.cloud.gkebackup.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.etag = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.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.gkebackup.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.gkebackup.v1.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v1.ListVolumeBackupsRequest = (function() { + + /** + * Properties of a ListVolumeBackupsRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IListVolumeBackupsRequest + * @property {string|null} [parent] ListVolumeBackupsRequest parent + * @property {number|null} [pageSize] ListVolumeBackupsRequest pageSize + * @property {string|null} [pageToken] ListVolumeBackupsRequest pageToken + * @property {string|null} [filter] ListVolumeBackupsRequest filter + * @property {string|null} [orderBy] ListVolumeBackupsRequest orderBy + */ + + /** + * Constructs a new ListVolumeBackupsRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a ListVolumeBackupsRequest. + * @implements IListVolumeBackupsRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IListVolumeBackupsRequest=} [properties] Properties to set + */ + function ListVolumeBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVolumeBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @instance + */ + ListVolumeBackupsRequest.prototype.parent = ""; + + /** + * ListVolumeBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @instance + */ + ListVolumeBackupsRequest.prototype.pageSize = 0; + + /** + * ListVolumeBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @instance + */ + ListVolumeBackupsRequest.prototype.pageToken = ""; + + /** + * ListVolumeBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @instance + */ + ListVolumeBackupsRequest.prototype.filter = ""; + + /** + * ListVolumeBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @instance + */ + ListVolumeBackupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListVolumeBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListVolumeBackupsRequest} ListVolumeBackupsRequest instance + */ + ListVolumeBackupsRequest.create = function create(properties) { + return new ListVolumeBackupsRequest(properties); + }; + + /** + * Encodes the specified ListVolumeBackupsRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeBackupsRequest} message ListVolumeBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVolumeBackupsRequest.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 ListVolumeBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeBackupsRequest} message ListVolumeBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVolumeBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVolumeBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.ListVolumeBackupsRequest} ListVolumeBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVolumeBackupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListVolumeBackupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVolumeBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.ListVolumeBackupsRequest} ListVolumeBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVolumeBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVolumeBackupsRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVolumeBackupsRequest.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 ListVolumeBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListVolumeBackupsRequest} ListVolumeBackupsRequest + */ + ListVolumeBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListVolumeBackupsRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.ListVolumeBackupsRequest(); + 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 ListVolumeBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @static + * @param {google.cloud.gkebackup.v1.ListVolumeBackupsRequest} message ListVolumeBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVolumeBackupsRequest.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 ListVolumeBackupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListVolumeBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVolumeBackupsRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVolumeBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.ListVolumeBackupsRequest"; + }; + + return ListVolumeBackupsRequest; + })(); + + v1.ListVolumeBackupsResponse = (function() { + + /** + * Properties of a ListVolumeBackupsResponse. + * @memberof google.cloud.gkebackup.v1 + * @interface IListVolumeBackupsResponse + * @property {Array.|null} [volumeBackups] ListVolumeBackupsResponse volumeBackups + * @property {string|null} [nextPageToken] ListVolumeBackupsResponse nextPageToken + */ + + /** + * Constructs a new ListVolumeBackupsResponse. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a ListVolumeBackupsResponse. + * @implements IListVolumeBackupsResponse + * @constructor + * @param {google.cloud.gkebackup.v1.IListVolumeBackupsResponse=} [properties] Properties to set + */ + function ListVolumeBackupsResponse(properties) { + this.volumeBackups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVolumeBackupsResponse volumeBackups. + * @member {Array.} volumeBackups + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @instance + */ + ListVolumeBackupsResponse.prototype.volumeBackups = $util.emptyArray; + + /** + * ListVolumeBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @instance + */ + ListVolumeBackupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListVolumeBackupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListVolumeBackupsResponse} ListVolumeBackupsResponse instance + */ + ListVolumeBackupsResponse.create = function create(properties) { + return new ListVolumeBackupsResponse(properties); + }; + + /** + * Encodes the specified ListVolumeBackupsResponse message. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeBackupsResponse} message ListVolumeBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVolumeBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.volumeBackups != null && message.volumeBackups.length) + for (var i = 0; i < message.volumeBackups.length; ++i) + $root.google.cloud.gkebackup.v1.VolumeBackup.encode(message.volumeBackups[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 ListVolumeBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeBackupsResponse} message ListVolumeBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVolumeBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVolumeBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.ListVolumeBackupsResponse} ListVolumeBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVolumeBackupsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListVolumeBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.volumeBackups && message.volumeBackups.length)) + message.volumeBackups = []; + message.volumeBackups.push($root.google.cloud.gkebackup.v1.VolumeBackup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVolumeBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.ListVolumeBackupsResponse} ListVolumeBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVolumeBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVolumeBackupsResponse message. + * @function verify + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVolumeBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.volumeBackups != null && message.hasOwnProperty("volumeBackups")) { + if (!Array.isArray(message.volumeBackups)) + return "volumeBackups: array expected"; + for (var i = 0; i < message.volumeBackups.length; ++i) { + var error = $root.google.cloud.gkebackup.v1.VolumeBackup.verify(message.volumeBackups[i]); + if (error) + return "volumeBackups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListVolumeBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListVolumeBackupsResponse} ListVolumeBackupsResponse + */ + ListVolumeBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListVolumeBackupsResponse) + return object; + var message = new $root.google.cloud.gkebackup.v1.ListVolumeBackupsResponse(); + if (object.volumeBackups) { + if (!Array.isArray(object.volumeBackups)) + throw TypeError(".google.cloud.gkebackup.v1.ListVolumeBackupsResponse.volumeBackups: array expected"); + message.volumeBackups = []; + for (var i = 0; i < object.volumeBackups.length; ++i) { + if (typeof object.volumeBackups[i] !== "object") + throw TypeError(".google.cloud.gkebackup.v1.ListVolumeBackupsResponse.volumeBackups: object expected"); + message.volumeBackups[i] = $root.google.cloud.gkebackup.v1.VolumeBackup.fromObject(object.volumeBackups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListVolumeBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @static + * @param {google.cloud.gkebackup.v1.ListVolumeBackupsResponse} message ListVolumeBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVolumeBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.volumeBackups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.volumeBackups && message.volumeBackups.length) { + object.volumeBackups = []; + for (var j = 0; j < message.volumeBackups.length; ++j) + object.volumeBackups[j] = $root.google.cloud.gkebackup.v1.VolumeBackup.toObject(message.volumeBackups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListVolumeBackupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListVolumeBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVolumeBackupsResponse + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.ListVolumeBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVolumeBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.ListVolumeBackupsResponse"; + }; + + return ListVolumeBackupsResponse; + })(); + + v1.GetVolumeBackupRequest = (function() { + + /** + * Properties of a GetVolumeBackupRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IGetVolumeBackupRequest + * @property {string|null} [name] GetVolumeBackupRequest name + */ + + /** + * Constructs a new GetVolumeBackupRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a GetVolumeBackupRequest. + * @implements IGetVolumeBackupRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IGetVolumeBackupRequest=} [properties] Properties to set + */ + function GetVolumeBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVolumeBackupRequest name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.GetVolumeBackupRequest + * @instance + */ + GetVolumeBackupRequest.prototype.name = ""; + + /** + * Creates a new GetVolumeBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.GetVolumeBackupRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetVolumeBackupRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.GetVolumeBackupRequest} GetVolumeBackupRequest instance + */ + GetVolumeBackupRequest.create = function create(properties) { + return new GetVolumeBackupRequest(properties); + }; + + /** + * Encodes the specified GetVolumeBackupRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.GetVolumeBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.GetVolumeBackupRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetVolumeBackupRequest} message GetVolumeBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVolumeBackupRequest.encode = function encode(message, writer) { + 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 GetVolumeBackupRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.GetVolumeBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.GetVolumeBackupRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetVolumeBackupRequest} message GetVolumeBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVolumeBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVolumeBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.GetVolumeBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.GetVolumeBackupRequest} GetVolumeBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVolumeBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.GetVolumeBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVolumeBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.GetVolumeBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.GetVolumeBackupRequest} GetVolumeBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVolumeBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVolumeBackupRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.GetVolumeBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVolumeBackupRequest.verify = function verify(message) { + if (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 GetVolumeBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.GetVolumeBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.GetVolumeBackupRequest} GetVolumeBackupRequest + */ + GetVolumeBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.GetVolumeBackupRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.GetVolumeBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetVolumeBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.GetVolumeBackupRequest + * @static + * @param {google.cloud.gkebackup.v1.GetVolumeBackupRequest} message GetVolumeBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVolumeBackupRequest.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 GetVolumeBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.GetVolumeBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetVolumeBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetVolumeBackupRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.GetVolumeBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetVolumeBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.GetVolumeBackupRequest"; + }; + + return GetVolumeBackupRequest; + })(); + + v1.CreateRestorePlanRequest = (function() { + + /** + * Properties of a CreateRestorePlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface ICreateRestorePlanRequest + * @property {string|null} [parent] CreateRestorePlanRequest parent + * @property {google.cloud.gkebackup.v1.IRestorePlan|null} [restorePlan] CreateRestorePlanRequest restorePlan + * @property {string|null} [restorePlanId] CreateRestorePlanRequest restorePlanId + */ + + /** + * Constructs a new CreateRestorePlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a CreateRestorePlanRequest. + * @implements ICreateRestorePlanRequest + * @constructor + * @param {google.cloud.gkebackup.v1.ICreateRestorePlanRequest=} [properties] Properties to set + */ + function CreateRestorePlanRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateRestorePlanRequest parent. + * @member {string} parent + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @instance + */ + CreateRestorePlanRequest.prototype.parent = ""; + + /** + * CreateRestorePlanRequest restorePlan. + * @member {google.cloud.gkebackup.v1.IRestorePlan|null|undefined} restorePlan + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @instance + */ + CreateRestorePlanRequest.prototype.restorePlan = null; + + /** + * CreateRestorePlanRequest restorePlanId. + * @member {string} restorePlanId + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @instance + */ + CreateRestorePlanRequest.prototype.restorePlanId = ""; + + /** + * Creates a new CreateRestorePlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.ICreateRestorePlanRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.CreateRestorePlanRequest} CreateRestorePlanRequest instance + */ + CreateRestorePlanRequest.create = function create(properties) { + return new CreateRestorePlanRequest(properties); + }; + + /** + * Encodes the specified CreateRestorePlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.CreateRestorePlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.ICreateRestorePlanRequest} message CreateRestorePlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRestorePlanRequest.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.restorePlan != null && Object.hasOwnProperty.call(message, "restorePlan")) + $root.google.cloud.gkebackup.v1.RestorePlan.encode(message.restorePlan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.restorePlanId != null && Object.hasOwnProperty.call(message, "restorePlanId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.restorePlanId); + return writer; + }; + + /** + * Encodes the specified CreateRestorePlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.CreateRestorePlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.ICreateRestorePlanRequest} message CreateRestorePlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRestorePlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRestorePlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.CreateRestorePlanRequest} CreateRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRestorePlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.CreateRestorePlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.restorePlan = $root.google.cloud.gkebackup.v1.RestorePlan.decode(reader, reader.uint32()); + break; + } + case 3: { + message.restorePlanId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRestorePlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.CreateRestorePlanRequest} CreateRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRestorePlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRestorePlanRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRestorePlanRequest.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.restorePlan != null && message.hasOwnProperty("restorePlan")) { + var error = $root.google.cloud.gkebackup.v1.RestorePlan.verify(message.restorePlan); + if (error) + return "restorePlan." + error; + } + if (message.restorePlanId != null && message.hasOwnProperty("restorePlanId")) + if (!$util.isString(message.restorePlanId)) + return "restorePlanId: string expected"; + return null; + }; + + /** + * Creates a CreateRestorePlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.CreateRestorePlanRequest} CreateRestorePlanRequest + */ + CreateRestorePlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.CreateRestorePlanRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.CreateRestorePlanRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.restorePlan != null) { + if (typeof object.restorePlan !== "object") + throw TypeError(".google.cloud.gkebackup.v1.CreateRestorePlanRequest.restorePlan: object expected"); + message.restorePlan = $root.google.cloud.gkebackup.v1.RestorePlan.fromObject(object.restorePlan); + } + if (object.restorePlanId != null) + message.restorePlanId = String(object.restorePlanId); + return message; + }; + + /** + * Creates a plain object from a CreateRestorePlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.CreateRestorePlanRequest} message CreateRestorePlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRestorePlanRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.restorePlan = null; + object.restorePlanId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.restorePlan != null && message.hasOwnProperty("restorePlan")) + object.restorePlan = $root.google.cloud.gkebackup.v1.RestorePlan.toObject(message.restorePlan, options); + if (message.restorePlanId != null && message.hasOwnProperty("restorePlanId")) + object.restorePlanId = message.restorePlanId; + return object; + }; + + /** + * Converts this CreateRestorePlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRestorePlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRestorePlanRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.CreateRestorePlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRestorePlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.CreateRestorePlanRequest"; + }; + + return CreateRestorePlanRequest; + })(); + + v1.ListRestorePlansRequest = (function() { + + /** + * Properties of a ListRestorePlansRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IListRestorePlansRequest + * @property {string|null} [parent] ListRestorePlansRequest parent + * @property {number|null} [pageSize] ListRestorePlansRequest pageSize + * @property {string|null} [pageToken] ListRestorePlansRequest pageToken + * @property {string|null} [filter] ListRestorePlansRequest filter + * @property {string|null} [orderBy] ListRestorePlansRequest orderBy + */ + + /** + * Constructs a new ListRestorePlansRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a ListRestorePlansRequest. + * @implements IListRestorePlansRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IListRestorePlansRequest=} [properties] Properties to set + */ + function ListRestorePlansRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRestorePlansRequest parent. + * @member {string} parent + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @instance + */ + ListRestorePlansRequest.prototype.parent = ""; + + /** + * ListRestorePlansRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @instance + */ + ListRestorePlansRequest.prototype.pageSize = 0; + + /** + * ListRestorePlansRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @instance + */ + ListRestorePlansRequest.prototype.pageToken = ""; + + /** + * ListRestorePlansRequest filter. + * @member {string} filter + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @instance + */ + ListRestorePlansRequest.prototype.filter = ""; + + /** + * ListRestorePlansRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @instance + */ + ListRestorePlansRequest.prototype.orderBy = ""; + + /** + * Creates a new ListRestorePlansRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @static + * @param {google.cloud.gkebackup.v1.IListRestorePlansRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListRestorePlansRequest} ListRestorePlansRequest instance + */ + ListRestorePlansRequest.create = function create(properties) { + return new ListRestorePlansRequest(properties); + }; + + /** + * Encodes the specified ListRestorePlansRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestorePlansRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @static + * @param {google.cloud.gkebackup.v1.IListRestorePlansRequest} message ListRestorePlansRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRestorePlansRequest.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 ListRestorePlansRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestorePlansRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @static + * @param {google.cloud.gkebackup.v1.IListRestorePlansRequest} message ListRestorePlansRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRestorePlansRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRestorePlansRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.ListRestorePlansRequest} ListRestorePlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRestorePlansRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListRestorePlansRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRestorePlansRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.ListRestorePlansRequest} ListRestorePlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRestorePlansRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRestorePlansRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRestorePlansRequest.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 ListRestorePlansRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListRestorePlansRequest} ListRestorePlansRequest + */ + ListRestorePlansRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListRestorePlansRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.ListRestorePlansRequest(); + 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 ListRestorePlansRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @static + * @param {google.cloud.gkebackup.v1.ListRestorePlansRequest} message ListRestorePlansRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRestorePlansRequest.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 ListRestorePlansRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @instance + * @returns {Object.} JSON object + */ + ListRestorePlansRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRestorePlansRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.ListRestorePlansRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRestorePlansRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.ListRestorePlansRequest"; + }; + + return ListRestorePlansRequest; + })(); + + v1.ListRestorePlansResponse = (function() { + + /** + * Properties of a ListRestorePlansResponse. + * @memberof google.cloud.gkebackup.v1 + * @interface IListRestorePlansResponse + * @property {Array.|null} [restorePlans] ListRestorePlansResponse restorePlans + * @property {string|null} [nextPageToken] ListRestorePlansResponse nextPageToken + * @property {Array.|null} [unreachable] ListRestorePlansResponse unreachable + */ + + /** + * Constructs a new ListRestorePlansResponse. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a ListRestorePlansResponse. + * @implements IListRestorePlansResponse + * @constructor + * @param {google.cloud.gkebackup.v1.IListRestorePlansResponse=} [properties] Properties to set + */ + function ListRestorePlansResponse(properties) { + this.restorePlans = []; + 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]]; + } + + /** + * ListRestorePlansResponse restorePlans. + * @member {Array.} restorePlans + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @instance + */ + ListRestorePlansResponse.prototype.restorePlans = $util.emptyArray; + + /** + * ListRestorePlansResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @instance + */ + ListRestorePlansResponse.prototype.nextPageToken = ""; + + /** + * ListRestorePlansResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @instance + */ + ListRestorePlansResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListRestorePlansResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @static + * @param {google.cloud.gkebackup.v1.IListRestorePlansResponse=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListRestorePlansResponse} ListRestorePlansResponse instance + */ + ListRestorePlansResponse.create = function create(properties) { + return new ListRestorePlansResponse(properties); + }; + + /** + * Encodes the specified ListRestorePlansResponse message. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestorePlansResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @static + * @param {google.cloud.gkebackup.v1.IListRestorePlansResponse} message ListRestorePlansResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRestorePlansResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restorePlans != null && message.restorePlans.length) + for (var i = 0; i < message.restorePlans.length; ++i) + $root.google.cloud.gkebackup.v1.RestorePlan.encode(message.restorePlans[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 ListRestorePlansResponse message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestorePlansResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @static + * @param {google.cloud.gkebackup.v1.IListRestorePlansResponse} message ListRestorePlansResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRestorePlansResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRestorePlansResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.ListRestorePlansResponse} ListRestorePlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRestorePlansResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListRestorePlansResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.restorePlans && message.restorePlans.length)) + message.restorePlans = []; + message.restorePlans.push($root.google.cloud.gkebackup.v1.RestorePlan.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 ListRestorePlansResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.ListRestorePlansResponse} ListRestorePlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRestorePlansResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRestorePlansResponse message. + * @function verify + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRestorePlansResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restorePlans != null && message.hasOwnProperty("restorePlans")) { + if (!Array.isArray(message.restorePlans)) + return "restorePlans: array expected"; + for (var i = 0; i < message.restorePlans.length; ++i) { + var error = $root.google.cloud.gkebackup.v1.RestorePlan.verify(message.restorePlans[i]); + if (error) + return "restorePlans." + 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 ListRestorePlansResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListRestorePlansResponse} ListRestorePlansResponse + */ + ListRestorePlansResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListRestorePlansResponse) + return object; + var message = new $root.google.cloud.gkebackup.v1.ListRestorePlansResponse(); + if (object.restorePlans) { + if (!Array.isArray(object.restorePlans)) + throw TypeError(".google.cloud.gkebackup.v1.ListRestorePlansResponse.restorePlans: array expected"); + message.restorePlans = []; + for (var i = 0; i < object.restorePlans.length; ++i) { + if (typeof object.restorePlans[i] !== "object") + throw TypeError(".google.cloud.gkebackup.v1.ListRestorePlansResponse.restorePlans: object expected"); + message.restorePlans[i] = $root.google.cloud.gkebackup.v1.RestorePlan.fromObject(object.restorePlans[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gkebackup.v1.ListRestorePlansResponse.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 ListRestorePlansResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @static + * @param {google.cloud.gkebackup.v1.ListRestorePlansResponse} message ListRestorePlansResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRestorePlansResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.restorePlans = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.restorePlans && message.restorePlans.length) { + object.restorePlans = []; + for (var j = 0; j < message.restorePlans.length; ++j) + object.restorePlans[j] = $root.google.cloud.gkebackup.v1.RestorePlan.toObject(message.restorePlans[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 ListRestorePlansResponse to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @instance + * @returns {Object.} JSON object + */ + ListRestorePlansResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRestorePlansResponse + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.ListRestorePlansResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRestorePlansResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.ListRestorePlansResponse"; + }; + + return ListRestorePlansResponse; + })(); + + v1.GetRestorePlanRequest = (function() { + + /** + * Properties of a GetRestorePlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IGetRestorePlanRequest + * @property {string|null} [name] GetRestorePlanRequest name + */ + + /** + * Constructs a new GetRestorePlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a GetRestorePlanRequest. + * @implements IGetRestorePlanRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IGetRestorePlanRequest=} [properties] Properties to set + */ + function GetRestorePlanRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRestorePlanRequest name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.GetRestorePlanRequest + * @instance + */ + GetRestorePlanRequest.prototype.name = ""; + + /** + * Creates a new GetRestorePlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.GetRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetRestorePlanRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.GetRestorePlanRequest} GetRestorePlanRequest instance + */ + GetRestorePlanRequest.create = function create(properties) { + return new GetRestorePlanRequest(properties); + }; + + /** + * Encodes the specified GetRestorePlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.GetRestorePlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.GetRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetRestorePlanRequest} message GetRestorePlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRestorePlanRequest.encode = function encode(message, writer) { + 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 GetRestorePlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.GetRestorePlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.GetRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetRestorePlanRequest} message GetRestorePlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRestorePlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRestorePlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.GetRestorePlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.GetRestorePlanRequest} GetRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRestorePlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.GetRestorePlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRestorePlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.GetRestorePlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.GetRestorePlanRequest} GetRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRestorePlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRestorePlanRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.GetRestorePlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRestorePlanRequest.verify = function verify(message) { + if (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 GetRestorePlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.GetRestorePlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.GetRestorePlanRequest} GetRestorePlanRequest + */ + GetRestorePlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.GetRestorePlanRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.GetRestorePlanRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRestorePlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.GetRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.GetRestorePlanRequest} message GetRestorePlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRestorePlanRequest.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 GetRestorePlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.GetRestorePlanRequest + * @instance + * @returns {Object.} JSON object + */ + GetRestorePlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRestorePlanRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.GetRestorePlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRestorePlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.GetRestorePlanRequest"; + }; + + return GetRestorePlanRequest; + })(); + + v1.UpdateRestorePlanRequest = (function() { + + /** + * Properties of an UpdateRestorePlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IUpdateRestorePlanRequest + * @property {google.cloud.gkebackup.v1.IRestorePlan|null} [restorePlan] UpdateRestorePlanRequest restorePlan + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateRestorePlanRequest updateMask + */ + + /** + * Constructs a new UpdateRestorePlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents an UpdateRestorePlanRequest. + * @implements IUpdateRestorePlanRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IUpdateRestorePlanRequest=} [properties] Properties to set + */ + function UpdateRestorePlanRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRestorePlanRequest restorePlan. + * @member {google.cloud.gkebackup.v1.IRestorePlan|null|undefined} restorePlan + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @instance + */ + UpdateRestorePlanRequest.prototype.restorePlan = null; + + /** + * UpdateRestorePlanRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @instance + */ + UpdateRestorePlanRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateRestorePlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IUpdateRestorePlanRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.UpdateRestorePlanRequest} UpdateRestorePlanRequest instance + */ + UpdateRestorePlanRequest.create = function create(properties) { + return new UpdateRestorePlanRequest(properties); + }; + + /** + * Encodes the specified UpdateRestorePlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateRestorePlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IUpdateRestorePlanRequest} message UpdateRestorePlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRestorePlanRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restorePlan != null && Object.hasOwnProperty.call(message, "restorePlan")) + $root.google.cloud.gkebackup.v1.RestorePlan.encode(message.restorePlan, 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(); + return writer; + }; + + /** + * Encodes the specified UpdateRestorePlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateRestorePlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IUpdateRestorePlanRequest} message UpdateRestorePlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRestorePlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRestorePlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.UpdateRestorePlanRequest} UpdateRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRestorePlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.UpdateRestorePlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.restorePlan = $root.google.cloud.gkebackup.v1.RestorePlan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateRestorePlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.UpdateRestorePlanRequest} UpdateRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRestorePlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRestorePlanRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRestorePlanRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restorePlan != null && message.hasOwnProperty("restorePlan")) { + var error = $root.google.cloud.gkebackup.v1.RestorePlan.verify(message.restorePlan); + if (error) + return "restorePlan." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateRestorePlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.UpdateRestorePlanRequest} UpdateRestorePlanRequest + */ + UpdateRestorePlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.UpdateRestorePlanRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.UpdateRestorePlanRequest(); + if (object.restorePlan != null) { + if (typeof object.restorePlan !== "object") + throw TypeError(".google.cloud.gkebackup.v1.UpdateRestorePlanRequest.restorePlan: object expected"); + message.restorePlan = $root.google.cloud.gkebackup.v1.RestorePlan.fromObject(object.restorePlan); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gkebackup.v1.UpdateRestorePlanRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateRestorePlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.UpdateRestorePlanRequest} message UpdateRestorePlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRestorePlanRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restorePlan = null; + object.updateMask = null; + } + if (message.restorePlan != null && message.hasOwnProperty("restorePlan")) + object.restorePlan = $root.google.cloud.gkebackup.v1.RestorePlan.toObject(message.restorePlan, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateRestorePlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRestorePlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateRestorePlanRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.UpdateRestorePlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateRestorePlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.UpdateRestorePlanRequest"; + }; + + return UpdateRestorePlanRequest; + })(); + + v1.DeleteRestorePlanRequest = (function() { + + /** + * Properties of a DeleteRestorePlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IDeleteRestorePlanRequest + * @property {string|null} [name] DeleteRestorePlanRequest name + * @property {string|null} [etag] DeleteRestorePlanRequest etag + * @property {boolean|null} [force] DeleteRestorePlanRequest force + */ + + /** + * Constructs a new DeleteRestorePlanRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a DeleteRestorePlanRequest. + * @implements IDeleteRestorePlanRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IDeleteRestorePlanRequest=} [properties] Properties to set + */ + function DeleteRestorePlanRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRestorePlanRequest name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @instance + */ + DeleteRestorePlanRequest.prototype.name = ""; + + /** + * DeleteRestorePlanRequest etag. + * @member {string} etag + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @instance + */ + DeleteRestorePlanRequest.prototype.etag = ""; + + /** + * DeleteRestorePlanRequest force. + * @member {boolean} force + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @instance + */ + DeleteRestorePlanRequest.prototype.force = false; + + /** + * Creates a new DeleteRestorePlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IDeleteRestorePlanRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.DeleteRestorePlanRequest} DeleteRestorePlanRequest instance + */ + DeleteRestorePlanRequest.create = function create(properties) { + return new DeleteRestorePlanRequest(properties); + }; + + /** + * Encodes the specified DeleteRestorePlanRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteRestorePlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IDeleteRestorePlanRequest} message DeleteRestorePlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRestorePlanRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteRestorePlanRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteRestorePlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.IDeleteRestorePlanRequest} message DeleteRestorePlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRestorePlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRestorePlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.DeleteRestorePlanRequest} DeleteRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRestorePlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.DeleteRestorePlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRestorePlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.DeleteRestorePlanRequest} DeleteRestorePlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRestorePlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRestorePlanRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRestorePlanRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteRestorePlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.DeleteRestorePlanRequest} DeleteRestorePlanRequest + */ + DeleteRestorePlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.DeleteRestorePlanRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.DeleteRestorePlanRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteRestorePlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @static + * @param {google.cloud.gkebackup.v1.DeleteRestorePlanRequest} message DeleteRestorePlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRestorePlanRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteRestorePlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRestorePlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRestorePlanRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.DeleteRestorePlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRestorePlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.DeleteRestorePlanRequest"; + }; + + return DeleteRestorePlanRequest; + })(); + + v1.CreateRestoreRequest = (function() { + + /** + * Properties of a CreateRestoreRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface ICreateRestoreRequest + * @property {string|null} [parent] CreateRestoreRequest parent + * @property {google.cloud.gkebackup.v1.IRestore|null} [restore] CreateRestoreRequest restore + * @property {string|null} [restoreId] CreateRestoreRequest restoreId + */ + + /** + * Constructs a new CreateRestoreRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a CreateRestoreRequest. + * @implements ICreateRestoreRequest + * @constructor + * @param {google.cloud.gkebackup.v1.ICreateRestoreRequest=} [properties] Properties to set + */ + function CreateRestoreRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateRestoreRequest parent. + * @member {string} parent + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @instance + */ + CreateRestoreRequest.prototype.parent = ""; + + /** + * CreateRestoreRequest restore. + * @member {google.cloud.gkebackup.v1.IRestore|null|undefined} restore + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @instance + */ + CreateRestoreRequest.prototype.restore = null; + + /** + * CreateRestoreRequest restoreId. + * @member {string} restoreId + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @instance + */ + CreateRestoreRequest.prototype.restoreId = ""; + + /** + * Creates a new CreateRestoreRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.ICreateRestoreRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.CreateRestoreRequest} CreateRestoreRequest instance + */ + CreateRestoreRequest.create = function create(properties) { + return new CreateRestoreRequest(properties); + }; + + /** + * Encodes the specified CreateRestoreRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.CreateRestoreRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.ICreateRestoreRequest} message CreateRestoreRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRestoreRequest.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.restore != null && Object.hasOwnProperty.call(message, "restore")) + $root.google.cloud.gkebackup.v1.Restore.encode(message.restore, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.restoreId != null && Object.hasOwnProperty.call(message, "restoreId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.restoreId); + return writer; + }; + + /** + * Encodes the specified CreateRestoreRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.CreateRestoreRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.ICreateRestoreRequest} message CreateRestoreRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRestoreRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRestoreRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.CreateRestoreRequest} CreateRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRestoreRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.CreateRestoreRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.restore = $root.google.cloud.gkebackup.v1.Restore.decode(reader, reader.uint32()); + break; + } + case 3: { + message.restoreId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRestoreRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.CreateRestoreRequest} CreateRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRestoreRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRestoreRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRestoreRequest.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.restore != null && message.hasOwnProperty("restore")) { + var error = $root.google.cloud.gkebackup.v1.Restore.verify(message.restore); + if (error) + return "restore." + error; + } + if (message.restoreId != null && message.hasOwnProperty("restoreId")) + if (!$util.isString(message.restoreId)) + return "restoreId: string expected"; + return null; + }; + + /** + * Creates a CreateRestoreRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.CreateRestoreRequest} CreateRestoreRequest + */ + CreateRestoreRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.CreateRestoreRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.CreateRestoreRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.restore != null) { + if (typeof object.restore !== "object") + throw TypeError(".google.cloud.gkebackup.v1.CreateRestoreRequest.restore: object expected"); + message.restore = $root.google.cloud.gkebackup.v1.Restore.fromObject(object.restore); + } + if (object.restoreId != null) + message.restoreId = String(object.restoreId); + return message; + }; + + /** + * Creates a plain object from a CreateRestoreRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.CreateRestoreRequest} message CreateRestoreRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRestoreRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.restore = null; + object.restoreId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.restore != null && message.hasOwnProperty("restore")) + object.restore = $root.google.cloud.gkebackup.v1.Restore.toObject(message.restore, options); + if (message.restoreId != null && message.hasOwnProperty("restoreId")) + object.restoreId = message.restoreId; + return object; + }; + + /** + * Converts this CreateRestoreRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRestoreRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRestoreRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.CreateRestoreRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRestoreRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.CreateRestoreRequest"; + }; + + return CreateRestoreRequest; + })(); + + v1.ListRestoresRequest = (function() { + + /** + * Properties of a ListRestoresRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IListRestoresRequest + * @property {string|null} [parent] ListRestoresRequest parent + * @property {number|null} [pageSize] ListRestoresRequest pageSize + * @property {string|null} [pageToken] ListRestoresRequest pageToken + * @property {string|null} [filter] ListRestoresRequest filter + * @property {string|null} [orderBy] ListRestoresRequest orderBy + */ + + /** + * Constructs a new ListRestoresRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a ListRestoresRequest. + * @implements IListRestoresRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IListRestoresRequest=} [properties] Properties to set + */ + function ListRestoresRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRestoresRequest parent. + * @member {string} parent + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @instance + */ + ListRestoresRequest.prototype.parent = ""; + + /** + * ListRestoresRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @instance + */ + ListRestoresRequest.prototype.pageSize = 0; + + /** + * ListRestoresRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @instance + */ + ListRestoresRequest.prototype.pageToken = ""; + + /** + * ListRestoresRequest filter. + * @member {string} filter + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @instance + */ + ListRestoresRequest.prototype.filter = ""; + + /** + * ListRestoresRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @instance + */ + ListRestoresRequest.prototype.orderBy = ""; + + /** + * Creates a new ListRestoresRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @static + * @param {google.cloud.gkebackup.v1.IListRestoresRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListRestoresRequest} ListRestoresRequest instance + */ + ListRestoresRequest.create = function create(properties) { + return new ListRestoresRequest(properties); + }; + + /** + * Encodes the specified ListRestoresRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestoresRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @static + * @param {google.cloud.gkebackup.v1.IListRestoresRequest} message ListRestoresRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRestoresRequest.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 ListRestoresRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestoresRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @static + * @param {google.cloud.gkebackup.v1.IListRestoresRequest} message ListRestoresRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRestoresRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRestoresRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.ListRestoresRequest} ListRestoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRestoresRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListRestoresRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRestoresRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.ListRestoresRequest} ListRestoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRestoresRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRestoresRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRestoresRequest.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 ListRestoresRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListRestoresRequest} ListRestoresRequest + */ + ListRestoresRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListRestoresRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.ListRestoresRequest(); + 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 ListRestoresRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @static + * @param {google.cloud.gkebackup.v1.ListRestoresRequest} message ListRestoresRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRestoresRequest.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 ListRestoresRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @instance + * @returns {Object.} JSON object + */ + ListRestoresRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRestoresRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.ListRestoresRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRestoresRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.ListRestoresRequest"; + }; + + return ListRestoresRequest; + })(); + + v1.ListRestoresResponse = (function() { + + /** + * Properties of a ListRestoresResponse. + * @memberof google.cloud.gkebackup.v1 + * @interface IListRestoresResponse + * @property {Array.|null} [restores] ListRestoresResponse restores + * @property {string|null} [nextPageToken] ListRestoresResponse nextPageToken + * @property {Array.|null} [unreachable] ListRestoresResponse unreachable + */ + + /** + * Constructs a new ListRestoresResponse. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a ListRestoresResponse. + * @implements IListRestoresResponse + * @constructor + * @param {google.cloud.gkebackup.v1.IListRestoresResponse=} [properties] Properties to set + */ + function ListRestoresResponse(properties) { + this.restores = []; + 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]]; + } + + /** + * ListRestoresResponse restores. + * @member {Array.} restores + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @instance + */ + ListRestoresResponse.prototype.restores = $util.emptyArray; + + /** + * ListRestoresResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @instance + */ + ListRestoresResponse.prototype.nextPageToken = ""; + + /** + * ListRestoresResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @instance + */ + ListRestoresResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListRestoresResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @static + * @param {google.cloud.gkebackup.v1.IListRestoresResponse=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListRestoresResponse} ListRestoresResponse instance + */ + ListRestoresResponse.create = function create(properties) { + return new ListRestoresResponse(properties); + }; + + /** + * Encodes the specified ListRestoresResponse message. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestoresResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @static + * @param {google.cloud.gkebackup.v1.IListRestoresResponse} message ListRestoresResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRestoresResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restores != null && message.restores.length) + for (var i = 0; i < message.restores.length; ++i) + $root.google.cloud.gkebackup.v1.Restore.encode(message.restores[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 ListRestoresResponse message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListRestoresResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @static + * @param {google.cloud.gkebackup.v1.IListRestoresResponse} message ListRestoresResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRestoresResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRestoresResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.ListRestoresResponse} ListRestoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRestoresResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListRestoresResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.restores && message.restores.length)) + message.restores = []; + message.restores.push($root.google.cloud.gkebackup.v1.Restore.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 ListRestoresResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.ListRestoresResponse} ListRestoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRestoresResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRestoresResponse message. + * @function verify + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRestoresResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restores != null && message.hasOwnProperty("restores")) { + if (!Array.isArray(message.restores)) + return "restores: array expected"; + for (var i = 0; i < message.restores.length; ++i) { + var error = $root.google.cloud.gkebackup.v1.Restore.verify(message.restores[i]); + if (error) + return "restores." + 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 ListRestoresResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListRestoresResponse} ListRestoresResponse + */ + ListRestoresResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListRestoresResponse) + return object; + var message = new $root.google.cloud.gkebackup.v1.ListRestoresResponse(); + if (object.restores) { + if (!Array.isArray(object.restores)) + throw TypeError(".google.cloud.gkebackup.v1.ListRestoresResponse.restores: array expected"); + message.restores = []; + for (var i = 0; i < object.restores.length; ++i) { + if (typeof object.restores[i] !== "object") + throw TypeError(".google.cloud.gkebackup.v1.ListRestoresResponse.restores: object expected"); + message.restores[i] = $root.google.cloud.gkebackup.v1.Restore.fromObject(object.restores[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gkebackup.v1.ListRestoresResponse.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 ListRestoresResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @static + * @param {google.cloud.gkebackup.v1.ListRestoresResponse} message ListRestoresResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRestoresResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.restores = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.restores && message.restores.length) { + object.restores = []; + for (var j = 0; j < message.restores.length; ++j) + object.restores[j] = $root.google.cloud.gkebackup.v1.Restore.toObject(message.restores[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 ListRestoresResponse to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @instance + * @returns {Object.} JSON object + */ + ListRestoresResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRestoresResponse + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.ListRestoresResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRestoresResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.ListRestoresResponse"; + }; + + return ListRestoresResponse; + })(); + + v1.GetRestoreRequest = (function() { + + /** + * Properties of a GetRestoreRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IGetRestoreRequest + * @property {string|null} [name] GetRestoreRequest name + */ + + /** + * Constructs a new GetRestoreRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a GetRestoreRequest. + * @implements IGetRestoreRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IGetRestoreRequest=} [properties] Properties to set + */ + function GetRestoreRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRestoreRequest name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.GetRestoreRequest + * @instance + */ + GetRestoreRequest.prototype.name = ""; + + /** + * Creates a new GetRestoreRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.GetRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetRestoreRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.GetRestoreRequest} GetRestoreRequest instance + */ + GetRestoreRequest.create = function create(properties) { + return new GetRestoreRequest(properties); + }; + + /** + * Encodes the specified GetRestoreRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.GetRestoreRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.GetRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetRestoreRequest} message GetRestoreRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRestoreRequest.encode = function encode(message, writer) { + 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 GetRestoreRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.GetRestoreRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.GetRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetRestoreRequest} message GetRestoreRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRestoreRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRestoreRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.GetRestoreRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.GetRestoreRequest} GetRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRestoreRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.GetRestoreRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRestoreRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.GetRestoreRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.GetRestoreRequest} GetRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRestoreRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRestoreRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.GetRestoreRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRestoreRequest.verify = function verify(message) { + if (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 GetRestoreRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.GetRestoreRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.GetRestoreRequest} GetRestoreRequest + */ + GetRestoreRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.GetRestoreRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.GetRestoreRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRestoreRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.GetRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.GetRestoreRequest} message GetRestoreRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRestoreRequest.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 GetRestoreRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.GetRestoreRequest + * @instance + * @returns {Object.} JSON object + */ + GetRestoreRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRestoreRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.GetRestoreRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRestoreRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.GetRestoreRequest"; + }; + + return GetRestoreRequest; + })(); + + v1.UpdateRestoreRequest = (function() { + + /** + * Properties of an UpdateRestoreRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IUpdateRestoreRequest + * @property {google.cloud.gkebackup.v1.IRestore|null} [restore] UpdateRestoreRequest restore + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateRestoreRequest updateMask + */ + + /** + * Constructs a new UpdateRestoreRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents an UpdateRestoreRequest. + * @implements IUpdateRestoreRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IUpdateRestoreRequest=} [properties] Properties to set + */ + function UpdateRestoreRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRestoreRequest restore. + * @member {google.cloud.gkebackup.v1.IRestore|null|undefined} restore + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @instance + */ + UpdateRestoreRequest.prototype.restore = null; + + /** + * UpdateRestoreRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @instance + */ + UpdateRestoreRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateRestoreRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IUpdateRestoreRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.UpdateRestoreRequest} UpdateRestoreRequest instance + */ + UpdateRestoreRequest.create = function create(properties) { + return new UpdateRestoreRequest(properties); + }; + + /** + * Encodes the specified UpdateRestoreRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateRestoreRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IUpdateRestoreRequest} message UpdateRestoreRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRestoreRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restore != null && Object.hasOwnProperty.call(message, "restore")) + $root.google.cloud.gkebackup.v1.Restore.encode(message.restore, 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(); + return writer; + }; + + /** + * Encodes the specified UpdateRestoreRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.UpdateRestoreRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IUpdateRestoreRequest} message UpdateRestoreRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRestoreRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRestoreRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.UpdateRestoreRequest} UpdateRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRestoreRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.UpdateRestoreRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.restore = $root.google.cloud.gkebackup.v1.Restore.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateRestoreRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.UpdateRestoreRequest} UpdateRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRestoreRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRestoreRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRestoreRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restore != null && message.hasOwnProperty("restore")) { + var error = $root.google.cloud.gkebackup.v1.Restore.verify(message.restore); + if (error) + return "restore." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateRestoreRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.UpdateRestoreRequest} UpdateRestoreRequest + */ + UpdateRestoreRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.UpdateRestoreRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.UpdateRestoreRequest(); + if (object.restore != null) { + if (typeof object.restore !== "object") + throw TypeError(".google.cloud.gkebackup.v1.UpdateRestoreRequest.restore: object expected"); + message.restore = $root.google.cloud.gkebackup.v1.Restore.fromObject(object.restore); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gkebackup.v1.UpdateRestoreRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateRestoreRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.UpdateRestoreRequest} message UpdateRestoreRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRestoreRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restore = null; + object.updateMask = null; + } + if (message.restore != null && message.hasOwnProperty("restore")) + object.restore = $root.google.cloud.gkebackup.v1.Restore.toObject(message.restore, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateRestoreRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRestoreRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateRestoreRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.UpdateRestoreRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateRestoreRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.UpdateRestoreRequest"; + }; + + return UpdateRestoreRequest; + })(); + + v1.DeleteRestoreRequest = (function() { + + /** + * Properties of a DeleteRestoreRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IDeleteRestoreRequest + * @property {string|null} [name] DeleteRestoreRequest name + * @property {string|null} [etag] DeleteRestoreRequest etag + * @property {boolean|null} [force] DeleteRestoreRequest force + */ + + /** + * Constructs a new DeleteRestoreRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a DeleteRestoreRequest. + * @implements IDeleteRestoreRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IDeleteRestoreRequest=} [properties] Properties to set + */ + function DeleteRestoreRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRestoreRequest name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @instance + */ + DeleteRestoreRequest.prototype.name = ""; + + /** + * DeleteRestoreRequest etag. + * @member {string} etag + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @instance + */ + DeleteRestoreRequest.prototype.etag = ""; + + /** + * DeleteRestoreRequest force. + * @member {boolean} force + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @instance + */ + DeleteRestoreRequest.prototype.force = false; + + /** + * Creates a new DeleteRestoreRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IDeleteRestoreRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.DeleteRestoreRequest} DeleteRestoreRequest instance + */ + DeleteRestoreRequest.create = function create(properties) { + return new DeleteRestoreRequest(properties); + }; + + /** + * Encodes the specified DeleteRestoreRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteRestoreRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IDeleteRestoreRequest} message DeleteRestoreRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRestoreRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteRestoreRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.DeleteRestoreRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IDeleteRestoreRequest} message DeleteRestoreRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRestoreRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRestoreRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.DeleteRestoreRequest} DeleteRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRestoreRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.DeleteRestoreRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRestoreRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.DeleteRestoreRequest} DeleteRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRestoreRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRestoreRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRestoreRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteRestoreRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.DeleteRestoreRequest} DeleteRestoreRequest + */ + DeleteRestoreRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.DeleteRestoreRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.DeleteRestoreRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteRestoreRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.DeleteRestoreRequest} message DeleteRestoreRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRestoreRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteRestoreRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRestoreRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRestoreRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.DeleteRestoreRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRestoreRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.DeleteRestoreRequest"; + }; + + return DeleteRestoreRequest; + })(); + + v1.ListVolumeRestoresRequest = (function() { + + /** + * Properties of a ListVolumeRestoresRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IListVolumeRestoresRequest + * @property {string|null} [parent] ListVolumeRestoresRequest parent + * @property {number|null} [pageSize] ListVolumeRestoresRequest pageSize + * @property {string|null} [pageToken] ListVolumeRestoresRequest pageToken + * @property {string|null} [filter] ListVolumeRestoresRequest filter + * @property {string|null} [orderBy] ListVolumeRestoresRequest orderBy + */ + + /** + * Constructs a new ListVolumeRestoresRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a ListVolumeRestoresRequest. + * @implements IListVolumeRestoresRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IListVolumeRestoresRequest=} [properties] Properties to set + */ + function ListVolumeRestoresRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVolumeRestoresRequest parent. + * @member {string} parent + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @instance + */ + ListVolumeRestoresRequest.prototype.parent = ""; + + /** + * ListVolumeRestoresRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @instance + */ + ListVolumeRestoresRequest.prototype.pageSize = 0; + + /** + * ListVolumeRestoresRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @instance + */ + ListVolumeRestoresRequest.prototype.pageToken = ""; + + /** + * ListVolumeRestoresRequest filter. + * @member {string} filter + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @instance + */ + ListVolumeRestoresRequest.prototype.filter = ""; + + /** + * ListVolumeRestoresRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @instance + */ + ListVolumeRestoresRequest.prototype.orderBy = ""; + + /** + * Creates a new ListVolumeRestoresRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeRestoresRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListVolumeRestoresRequest} ListVolumeRestoresRequest instance + */ + ListVolumeRestoresRequest.create = function create(properties) { + return new ListVolumeRestoresRequest(properties); + }; + + /** + * Encodes the specified ListVolumeRestoresRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeRestoresRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeRestoresRequest} message ListVolumeRestoresRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVolumeRestoresRequest.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 ListVolumeRestoresRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeRestoresRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeRestoresRequest} message ListVolumeRestoresRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVolumeRestoresRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVolumeRestoresRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.ListVolumeRestoresRequest} ListVolumeRestoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVolumeRestoresRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListVolumeRestoresRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVolumeRestoresRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.ListVolumeRestoresRequest} ListVolumeRestoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVolumeRestoresRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVolumeRestoresRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVolumeRestoresRequest.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 ListVolumeRestoresRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListVolumeRestoresRequest} ListVolumeRestoresRequest + */ + ListVolumeRestoresRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListVolumeRestoresRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.ListVolumeRestoresRequest(); + 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 ListVolumeRestoresRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @static + * @param {google.cloud.gkebackup.v1.ListVolumeRestoresRequest} message ListVolumeRestoresRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVolumeRestoresRequest.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 ListVolumeRestoresRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @instance + * @returns {Object.} JSON object + */ + ListVolumeRestoresRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVolumeRestoresRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVolumeRestoresRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.ListVolumeRestoresRequest"; + }; + + return ListVolumeRestoresRequest; + })(); + + v1.ListVolumeRestoresResponse = (function() { + + /** + * Properties of a ListVolumeRestoresResponse. + * @memberof google.cloud.gkebackup.v1 + * @interface IListVolumeRestoresResponse + * @property {Array.|null} [volumeRestores] ListVolumeRestoresResponse volumeRestores + * @property {string|null} [nextPageToken] ListVolumeRestoresResponse nextPageToken + */ + + /** + * Constructs a new ListVolumeRestoresResponse. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a ListVolumeRestoresResponse. + * @implements IListVolumeRestoresResponse + * @constructor + * @param {google.cloud.gkebackup.v1.IListVolumeRestoresResponse=} [properties] Properties to set + */ + function ListVolumeRestoresResponse(properties) { + this.volumeRestores = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVolumeRestoresResponse volumeRestores. + * @member {Array.} volumeRestores + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @instance + */ + ListVolumeRestoresResponse.prototype.volumeRestores = $util.emptyArray; + + /** + * ListVolumeRestoresResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @instance + */ + ListVolumeRestoresResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListVolumeRestoresResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeRestoresResponse=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.ListVolumeRestoresResponse} ListVolumeRestoresResponse instance + */ + ListVolumeRestoresResponse.create = function create(properties) { + return new ListVolumeRestoresResponse(properties); + }; + + /** + * Encodes the specified ListVolumeRestoresResponse message. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeRestoresResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeRestoresResponse} message ListVolumeRestoresResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVolumeRestoresResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.volumeRestores != null && message.volumeRestores.length) + for (var i = 0; i < message.volumeRestores.length; ++i) + $root.google.cloud.gkebackup.v1.VolumeRestore.encode(message.volumeRestores[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 ListVolumeRestoresResponse message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.ListVolumeRestoresResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @static + * @param {google.cloud.gkebackup.v1.IListVolumeRestoresResponse} message ListVolumeRestoresResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVolumeRestoresResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVolumeRestoresResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.ListVolumeRestoresResponse} ListVolumeRestoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVolumeRestoresResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.ListVolumeRestoresResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.volumeRestores && message.volumeRestores.length)) + message.volumeRestores = []; + message.volumeRestores.push($root.google.cloud.gkebackup.v1.VolumeRestore.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVolumeRestoresResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.ListVolumeRestoresResponse} ListVolumeRestoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVolumeRestoresResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVolumeRestoresResponse message. + * @function verify + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVolumeRestoresResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.volumeRestores != null && message.hasOwnProperty("volumeRestores")) { + if (!Array.isArray(message.volumeRestores)) + return "volumeRestores: array expected"; + for (var i = 0; i < message.volumeRestores.length; ++i) { + var error = $root.google.cloud.gkebackup.v1.VolumeRestore.verify(message.volumeRestores[i]); + if (error) + return "volumeRestores." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListVolumeRestoresResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.ListVolumeRestoresResponse} ListVolumeRestoresResponse + */ + ListVolumeRestoresResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.ListVolumeRestoresResponse) + return object; + var message = new $root.google.cloud.gkebackup.v1.ListVolumeRestoresResponse(); + if (object.volumeRestores) { + if (!Array.isArray(object.volumeRestores)) + throw TypeError(".google.cloud.gkebackup.v1.ListVolumeRestoresResponse.volumeRestores: array expected"); + message.volumeRestores = []; + for (var i = 0; i < object.volumeRestores.length; ++i) { + if (typeof object.volumeRestores[i] !== "object") + throw TypeError(".google.cloud.gkebackup.v1.ListVolumeRestoresResponse.volumeRestores: object expected"); + message.volumeRestores[i] = $root.google.cloud.gkebackup.v1.VolumeRestore.fromObject(object.volumeRestores[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListVolumeRestoresResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @static + * @param {google.cloud.gkebackup.v1.ListVolumeRestoresResponse} message ListVolumeRestoresResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVolumeRestoresResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.volumeRestores = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.volumeRestores && message.volumeRestores.length) { + object.volumeRestores = []; + for (var j = 0; j < message.volumeRestores.length; ++j) + object.volumeRestores[j] = $root.google.cloud.gkebackup.v1.VolumeRestore.toObject(message.volumeRestores[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListVolumeRestoresResponse to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @instance + * @returns {Object.} JSON object + */ + ListVolumeRestoresResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVolumeRestoresResponse + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.ListVolumeRestoresResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVolumeRestoresResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.ListVolumeRestoresResponse"; + }; + + return ListVolumeRestoresResponse; + })(); + + v1.GetVolumeRestoreRequest = (function() { + + /** + * Properties of a GetVolumeRestoreRequest. + * @memberof google.cloud.gkebackup.v1 + * @interface IGetVolumeRestoreRequest + * @property {string|null} [name] GetVolumeRestoreRequest name + */ + + /** + * Constructs a new GetVolumeRestoreRequest. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a GetVolumeRestoreRequest. + * @implements IGetVolumeRestoreRequest + * @constructor + * @param {google.cloud.gkebackup.v1.IGetVolumeRestoreRequest=} [properties] Properties to set + */ + function GetVolumeRestoreRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVolumeRestoreRequest name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.GetVolumeRestoreRequest + * @instance + */ + GetVolumeRestoreRequest.prototype.name = ""; + + /** + * Creates a new GetVolumeRestoreRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.GetVolumeRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetVolumeRestoreRequest=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.GetVolumeRestoreRequest} GetVolumeRestoreRequest instance + */ + GetVolumeRestoreRequest.create = function create(properties) { + return new GetVolumeRestoreRequest(properties); + }; + + /** + * Encodes the specified GetVolumeRestoreRequest message. Does not implicitly {@link google.cloud.gkebackup.v1.GetVolumeRestoreRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.GetVolumeRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetVolumeRestoreRequest} message GetVolumeRestoreRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVolumeRestoreRequest.encode = function encode(message, writer) { + 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 GetVolumeRestoreRequest message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.GetVolumeRestoreRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.GetVolumeRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.IGetVolumeRestoreRequest} message GetVolumeRestoreRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVolumeRestoreRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVolumeRestoreRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.GetVolumeRestoreRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.GetVolumeRestoreRequest} GetVolumeRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVolumeRestoreRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.GetVolumeRestoreRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVolumeRestoreRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.GetVolumeRestoreRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.GetVolumeRestoreRequest} GetVolumeRestoreRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVolumeRestoreRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVolumeRestoreRequest message. + * @function verify + * @memberof google.cloud.gkebackup.v1.GetVolumeRestoreRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVolumeRestoreRequest.verify = function verify(message) { + if (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 GetVolumeRestoreRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.GetVolumeRestoreRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.GetVolumeRestoreRequest} GetVolumeRestoreRequest + */ + GetVolumeRestoreRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.GetVolumeRestoreRequest) + return object; + var message = new $root.google.cloud.gkebackup.v1.GetVolumeRestoreRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetVolumeRestoreRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.GetVolumeRestoreRequest + * @static + * @param {google.cloud.gkebackup.v1.GetVolumeRestoreRequest} message GetVolumeRestoreRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVolumeRestoreRequest.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 GetVolumeRestoreRequest to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.GetVolumeRestoreRequest + * @instance + * @returns {Object.} JSON object + */ + GetVolumeRestoreRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetVolumeRestoreRequest + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.GetVolumeRestoreRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetVolumeRestoreRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.GetVolumeRestoreRequest"; + }; + + return GetVolumeRestoreRequest; + })(); + + v1.Restore = (function() { + + /** + * Properties of a Restore. + * @memberof google.cloud.gkebackup.v1 + * @interface IRestore + * @property {string|null} [name] Restore name + * @property {string|null} [uid] Restore uid + * @property {google.protobuf.ITimestamp|null} [createTime] Restore createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Restore updateTime + * @property {string|null} [description] Restore description + * @property {string|null} [backup] Restore backup + * @property {string|null} [cluster] Restore cluster + * @property {google.cloud.gkebackup.v1.IRestoreConfig|null} [restoreConfig] Restore restoreConfig + * @property {Object.|null} [labels] Restore labels + * @property {google.cloud.gkebackup.v1.Restore.State|null} [state] Restore state + * @property {string|null} [stateReason] Restore stateReason + * @property {google.protobuf.ITimestamp|null} [completeTime] Restore completeTime + * @property {number|null} [resourcesRestoredCount] Restore resourcesRestoredCount + * @property {number|null} [resourcesExcludedCount] Restore resourcesExcludedCount + * @property {number|null} [resourcesFailedCount] Restore resourcesFailedCount + * @property {number|null} [volumesRestoredCount] Restore volumesRestoredCount + * @property {string|null} [etag] Restore etag + */ + + /** + * Constructs a new Restore. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a Restore. + * @implements IRestore + * @constructor + * @param {google.cloud.gkebackup.v1.IRestore=} [properties] Properties to set + */ + function Restore(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]]; + } + + /** + * Restore name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.name = ""; + + /** + * Restore uid. + * @member {string} uid + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.uid = ""; + + /** + * Restore createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.createTime = null; + + /** + * Restore updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.updateTime = null; + + /** + * Restore description. + * @member {string} description + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.description = ""; + + /** + * Restore backup. + * @member {string} backup + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.backup = ""; + + /** + * Restore cluster. + * @member {string} cluster + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.cluster = ""; + + /** + * Restore restoreConfig. + * @member {google.cloud.gkebackup.v1.IRestoreConfig|null|undefined} restoreConfig + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.restoreConfig = null; + + /** + * Restore labels. + * @member {Object.} labels + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.labels = $util.emptyObject; + + /** + * Restore state. + * @member {google.cloud.gkebackup.v1.Restore.State} state + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.state = 0; + + /** + * Restore stateReason. + * @member {string} stateReason + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.stateReason = ""; + + /** + * Restore completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.completeTime = null; + + /** + * Restore resourcesRestoredCount. + * @member {number} resourcesRestoredCount + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.resourcesRestoredCount = 0; + + /** + * Restore resourcesExcludedCount. + * @member {number} resourcesExcludedCount + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.resourcesExcludedCount = 0; + + /** + * Restore resourcesFailedCount. + * @member {number} resourcesFailedCount + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.resourcesFailedCount = 0; + + /** + * Restore volumesRestoredCount. + * @member {number} volumesRestoredCount + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.volumesRestoredCount = 0; + + /** + * Restore etag. + * @member {string} etag + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + */ + Restore.prototype.etag = ""; + + /** + * Creates a new Restore instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.Restore + * @static + * @param {google.cloud.gkebackup.v1.IRestore=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.Restore} Restore instance + */ + Restore.create = function create(properties) { + return new Restore(properties); + }; + + /** + * Encodes the specified Restore message. Does not implicitly {@link google.cloud.gkebackup.v1.Restore.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.Restore + * @static + * @param {google.cloud.gkebackup.v1.IRestore} message Restore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Restore.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.backup); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cluster); + if (message.restoreConfig != null && Object.hasOwnProperty.call(message, "restoreConfig")) + $root.google.cloud.gkebackup.v1.RestoreConfig.encode(message.restoreConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.stateReason != null && Object.hasOwnProperty.call(message, "stateReason")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.stateReason); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.resourcesRestoredCount != null && Object.hasOwnProperty.call(message, "resourcesRestoredCount")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.resourcesRestoredCount); + if (message.resourcesExcludedCount != null && Object.hasOwnProperty.call(message, "resourcesExcludedCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.resourcesExcludedCount); + if (message.resourcesFailedCount != null && Object.hasOwnProperty.call(message, "resourcesFailedCount")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.resourcesFailedCount); + if (message.volumesRestoredCount != null && Object.hasOwnProperty.call(message, "volumesRestoredCount")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.volumesRestoredCount); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Restore message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.Restore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.Restore + * @static + * @param {google.cloud.gkebackup.v1.IRestore} message Restore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Restore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Restore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.Restore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.Restore} Restore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Restore.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.Restore(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.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: { + message.description = reader.string(); + break; + } + case 6: { + message.backup = reader.string(); + break; + } + case 7: { + message.cluster = reader.string(); + break; + } + case 8: { + message.restoreConfig = $root.google.cloud.gkebackup.v1.RestoreConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.stateReason = reader.string(); + break; + } + case 12: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.resourcesRestoredCount = reader.int32(); + break; + } + case 14: { + message.resourcesExcludedCount = reader.int32(); + break; + } + case 15: { + message.resourcesFailedCount = reader.int32(); + break; + } + case 16: { + message.volumesRestoredCount = reader.int32(); + break; + } + case 17: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Restore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.Restore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.Restore} Restore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Restore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Restore message. + * @function verify + * @memberof google.cloud.gkebackup.v1.Restore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Restore.verify = function verify(message) { + if (typeof message !== "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.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) + if (!$util.isString(message.backup)) + return "backup: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.restoreConfig != null && message.hasOwnProperty("restoreConfig")) { + var error = $root.google.cloud.gkebackup.v1.RestoreConfig.verify(message.restoreConfig); + if (error) + return "restoreConfig." + 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.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.stateReason != null && message.hasOwnProperty("stateReason")) + if (!$util.isString(message.stateReason)) + return "stateReason: string expected"; + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; + } + if (message.resourcesRestoredCount != null && message.hasOwnProperty("resourcesRestoredCount")) + if (!$util.isInteger(message.resourcesRestoredCount)) + return "resourcesRestoredCount: integer expected"; + if (message.resourcesExcludedCount != null && message.hasOwnProperty("resourcesExcludedCount")) + if (!$util.isInteger(message.resourcesExcludedCount)) + return "resourcesExcludedCount: integer expected"; + if (message.resourcesFailedCount != null && message.hasOwnProperty("resourcesFailedCount")) + if (!$util.isInteger(message.resourcesFailedCount)) + return "resourcesFailedCount: integer expected"; + if (message.volumesRestoredCount != null && message.hasOwnProperty("volumesRestoredCount")) + if (!$util.isInteger(message.volumesRestoredCount)) + return "volumesRestoredCount: integer expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Restore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.Restore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.Restore} Restore + */ + Restore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.Restore) + return object; + var message = new $root.google.cloud.gkebackup.v1.Restore(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Restore.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.gkebackup.v1.Restore.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + if (object.backup != null) + message.backup = String(object.backup); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.restoreConfig != null) { + if (typeof object.restoreConfig !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Restore.restoreConfig: object expected"); + message.restoreConfig = $root.google.cloud.gkebackup.v1.RestoreConfig.fromObject(object.restoreConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Restore.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.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 "IN_PROGRESS": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + } + if (object.stateReason != null) + message.stateReason = String(object.stateReason); + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.cloud.gkebackup.v1.Restore.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); + } + if (object.resourcesRestoredCount != null) + message.resourcesRestoredCount = object.resourcesRestoredCount | 0; + if (object.resourcesExcludedCount != null) + message.resourcesExcludedCount = object.resourcesExcludedCount | 0; + if (object.resourcesFailedCount != null) + message.resourcesFailedCount = object.resourcesFailedCount | 0; + if (object.volumesRestoredCount != null) + message.volumesRestoredCount = object.volumesRestoredCount | 0; + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Restore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.Restore + * @static + * @param {google.cloud.gkebackup.v1.Restore} message Restore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Restore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.backup = ""; + object.cluster = ""; + object.restoreConfig = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateReason = ""; + object.completeTime = null; + object.resourcesRestoredCount = 0; + object.resourcesExcludedCount = 0; + object.resourcesFailedCount = 0; + object.volumesRestoredCount = 0; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = message.backup; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.restoreConfig != null && message.hasOwnProperty("restoreConfig")) + object.restoreConfig = $root.google.cloud.gkebackup.v1.RestoreConfig.toObject(message.restoreConfig, 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.gkebackup.v1.Restore.State[message.state] === undefined ? message.state : $root.google.cloud.gkebackup.v1.Restore.State[message.state] : message.state; + if (message.stateReason != null && message.hasOwnProperty("stateReason")) + object.stateReason = message.stateReason; + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + if (message.resourcesRestoredCount != null && message.hasOwnProperty("resourcesRestoredCount")) + object.resourcesRestoredCount = message.resourcesRestoredCount; + if (message.resourcesExcludedCount != null && message.hasOwnProperty("resourcesExcludedCount")) + object.resourcesExcludedCount = message.resourcesExcludedCount; + if (message.resourcesFailedCount != null && message.hasOwnProperty("resourcesFailedCount")) + object.resourcesFailedCount = message.resourcesFailedCount; + if (message.volumesRestoredCount != null && message.hasOwnProperty("volumesRestoredCount")) + object.volumesRestoredCount = message.volumesRestoredCount; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Restore to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.Restore + * @instance + * @returns {Object.} JSON object + */ + Restore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Restore + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.Restore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Restore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.Restore"; + }; + + /** + * State enum. + * @name google.cloud.gkebackup.v1.Restore.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} IN_PROGRESS=2 IN_PROGRESS value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} DELETING=5 DELETING value + */ + Restore.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "IN_PROGRESS"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "DELETING"] = 5; + return values; + })(); + + return Restore; + })(); + + v1.RestoreConfig = (function() { + + /** + * Properties of a RestoreConfig. + * @memberof google.cloud.gkebackup.v1 + * @interface IRestoreConfig + * @property {google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy|null} [volumeDataRestorePolicy] RestoreConfig volumeDataRestorePolicy + * @property {google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy|null} [clusterResourceConflictPolicy] RestoreConfig clusterResourceConflictPolicy + * @property {google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode|null} [namespacedResourceRestoreMode] RestoreConfig namespacedResourceRestoreMode + * @property {google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope|null} [clusterResourceRestoreScope] RestoreConfig clusterResourceRestoreScope + * @property {boolean|null} [allNamespaces] RestoreConfig allNamespaces + * @property {google.cloud.gkebackup.v1.INamespaces|null} [selectedNamespaces] RestoreConfig selectedNamespaces + * @property {google.cloud.gkebackup.v1.INamespacedNames|null} [selectedApplications] RestoreConfig selectedApplications + * @property {Array.|null} [substitutionRules] RestoreConfig substitutionRules + */ + + /** + * Constructs a new RestoreConfig. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a RestoreConfig. + * @implements IRestoreConfig + * @constructor + * @param {google.cloud.gkebackup.v1.IRestoreConfig=} [properties] Properties to set + */ + function RestoreConfig(properties) { + this.substitutionRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreConfig volumeDataRestorePolicy. + * @member {google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy} volumeDataRestorePolicy + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @instance + */ + RestoreConfig.prototype.volumeDataRestorePolicy = 0; + + /** + * RestoreConfig clusterResourceConflictPolicy. + * @member {google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy} clusterResourceConflictPolicy + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @instance + */ + RestoreConfig.prototype.clusterResourceConflictPolicy = 0; + + /** + * RestoreConfig namespacedResourceRestoreMode. + * @member {google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode} namespacedResourceRestoreMode + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @instance + */ + RestoreConfig.prototype.namespacedResourceRestoreMode = 0; + + /** + * RestoreConfig clusterResourceRestoreScope. + * @member {google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope|null|undefined} clusterResourceRestoreScope + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @instance + */ + RestoreConfig.prototype.clusterResourceRestoreScope = null; + + /** + * RestoreConfig allNamespaces. + * @member {boolean|null|undefined} allNamespaces + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @instance + */ + RestoreConfig.prototype.allNamespaces = null; + + /** + * RestoreConfig selectedNamespaces. + * @member {google.cloud.gkebackup.v1.INamespaces|null|undefined} selectedNamespaces + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @instance + */ + RestoreConfig.prototype.selectedNamespaces = null; + + /** + * RestoreConfig selectedApplications. + * @member {google.cloud.gkebackup.v1.INamespacedNames|null|undefined} selectedApplications + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @instance + */ + RestoreConfig.prototype.selectedApplications = null; + + /** + * RestoreConfig substitutionRules. + * @member {Array.} substitutionRules + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @instance + */ + RestoreConfig.prototype.substitutionRules = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreConfig namespacedResourceRestoreScope. + * @member {"allNamespaces"|"selectedNamespaces"|"selectedApplications"|undefined} namespacedResourceRestoreScope + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @instance + */ + Object.defineProperty(RestoreConfig.prototype, "namespacedResourceRestoreScope", { + get: $util.oneOfGetter($oneOfFields = ["allNamespaces", "selectedNamespaces", "selectedApplications"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreConfig instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @static + * @param {google.cloud.gkebackup.v1.IRestoreConfig=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.RestoreConfig} RestoreConfig instance + */ + RestoreConfig.create = function create(properties) { + return new RestoreConfig(properties); + }; + + /** + * Encodes the specified RestoreConfig message. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @static + * @param {google.cloud.gkebackup.v1.IRestoreConfig} message RestoreConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.volumeDataRestorePolicy != null && Object.hasOwnProperty.call(message, "volumeDataRestorePolicy")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.volumeDataRestorePolicy); + if (message.clusterResourceConflictPolicy != null && Object.hasOwnProperty.call(message, "clusterResourceConflictPolicy")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.clusterResourceConflictPolicy); + if (message.namespacedResourceRestoreMode != null && Object.hasOwnProperty.call(message, "namespacedResourceRestoreMode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.namespacedResourceRestoreMode); + if (message.clusterResourceRestoreScope != null && Object.hasOwnProperty.call(message, "clusterResourceRestoreScope")) + $root.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.encode(message.clusterResourceRestoreScope, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allNamespaces != null && Object.hasOwnProperty.call(message, "allNamespaces")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allNamespaces); + if (message.selectedNamespaces != null && Object.hasOwnProperty.call(message, "selectedNamespaces")) + $root.google.cloud.gkebackup.v1.Namespaces.encode(message.selectedNamespaces, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.selectedApplications != null && Object.hasOwnProperty.call(message, "selectedApplications")) + $root.google.cloud.gkebackup.v1.NamespacedNames.encode(message.selectedApplications, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.substitutionRules != null && message.substitutionRules.length) + for (var i = 0; i < message.substitutionRules.length; ++i) + $root.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.encode(message.substitutionRules[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreConfig message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @static + * @param {google.cloud.gkebackup.v1.IRestoreConfig} message RestoreConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.RestoreConfig} RestoreConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.RestoreConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.volumeDataRestorePolicy = reader.int32(); + break; + } + case 2: { + message.clusterResourceConflictPolicy = reader.int32(); + break; + } + case 3: { + message.namespacedResourceRestoreMode = reader.int32(); + break; + } + case 4: { + message.clusterResourceRestoreScope = $root.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.decode(reader, reader.uint32()); + break; + } + case 5: { + message.allNamespaces = reader.bool(); + break; + } + case 6: { + message.selectedNamespaces = $root.google.cloud.gkebackup.v1.Namespaces.decode(reader, reader.uint32()); + break; + } + case 7: { + message.selectedApplications = $root.google.cloud.gkebackup.v1.NamespacedNames.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.substitutionRules && message.substitutionRules.length)) + message.substitutionRules = []; + message.substitutionRules.push($root.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.RestoreConfig} RestoreConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreConfig message. + * @function verify + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.volumeDataRestorePolicy != null && message.hasOwnProperty("volumeDataRestorePolicy")) + switch (message.volumeDataRestorePolicy) { + default: + return "volumeDataRestorePolicy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.clusterResourceConflictPolicy != null && message.hasOwnProperty("clusterResourceConflictPolicy")) + switch (message.clusterResourceConflictPolicy) { + default: + return "clusterResourceConflictPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.namespacedResourceRestoreMode != null && message.hasOwnProperty("namespacedResourceRestoreMode")) + switch (message.namespacedResourceRestoreMode) { + default: + return "namespacedResourceRestoreMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.clusterResourceRestoreScope != null && message.hasOwnProperty("clusterResourceRestoreScope")) { + var error = $root.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.verify(message.clusterResourceRestoreScope); + if (error) + return "clusterResourceRestoreScope." + error; + } + if (message.allNamespaces != null && message.hasOwnProperty("allNamespaces")) { + properties.namespacedResourceRestoreScope = 1; + if (typeof message.allNamespaces !== "boolean") + return "allNamespaces: boolean expected"; + } + if (message.selectedNamespaces != null && message.hasOwnProperty("selectedNamespaces")) { + if (properties.namespacedResourceRestoreScope === 1) + return "namespacedResourceRestoreScope: multiple values"; + properties.namespacedResourceRestoreScope = 1; + { + var error = $root.google.cloud.gkebackup.v1.Namespaces.verify(message.selectedNamespaces); + if (error) + return "selectedNamespaces." + error; + } + } + if (message.selectedApplications != null && message.hasOwnProperty("selectedApplications")) { + if (properties.namespacedResourceRestoreScope === 1) + return "namespacedResourceRestoreScope: multiple values"; + properties.namespacedResourceRestoreScope = 1; + { + var error = $root.google.cloud.gkebackup.v1.NamespacedNames.verify(message.selectedApplications); + if (error) + return "selectedApplications." + error; + } + } + if (message.substitutionRules != null && message.hasOwnProperty("substitutionRules")) { + if (!Array.isArray(message.substitutionRules)) + return "substitutionRules: array expected"; + for (var i = 0; i < message.substitutionRules.length; ++i) { + var error = $root.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.verify(message.substitutionRules[i]); + if (error) + return "substitutionRules." + error; + } + } + return null; + }; + + /** + * Creates a RestoreConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.RestoreConfig} RestoreConfig + */ + RestoreConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.RestoreConfig) + return object; + var message = new $root.google.cloud.gkebackup.v1.RestoreConfig(); + switch (object.volumeDataRestorePolicy) { + default: + if (typeof object.volumeDataRestorePolicy === "number") { + message.volumeDataRestorePolicy = object.volumeDataRestorePolicy; + break; + } + break; + case "VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED": + case 0: + message.volumeDataRestorePolicy = 0; + break; + case "RESTORE_VOLUME_DATA_FROM_BACKUP": + case 1: + message.volumeDataRestorePolicy = 1; + break; + case "REUSE_VOLUME_HANDLE_FROM_BACKUP": + case 2: + message.volumeDataRestorePolicy = 2; + break; + case "NO_VOLUME_DATA_RESTORATION": + case 3: + message.volumeDataRestorePolicy = 3; + break; + } + switch (object.clusterResourceConflictPolicy) { + default: + if (typeof object.clusterResourceConflictPolicy === "number") { + message.clusterResourceConflictPolicy = object.clusterResourceConflictPolicy; + break; + } + break; + case "CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED": + case 0: + message.clusterResourceConflictPolicy = 0; + break; + case "USE_EXISTING_VERSION": + case 1: + message.clusterResourceConflictPolicy = 1; + break; + case "USE_BACKUP_VERSION": + case 2: + message.clusterResourceConflictPolicy = 2; + break; + } + switch (object.namespacedResourceRestoreMode) { + default: + if (typeof object.namespacedResourceRestoreMode === "number") { + message.namespacedResourceRestoreMode = object.namespacedResourceRestoreMode; + break; + } + break; + case "NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED": + case 0: + message.namespacedResourceRestoreMode = 0; + break; + case "DELETE_AND_RESTORE": + case 1: + message.namespacedResourceRestoreMode = 1; + break; + case "FAIL_ON_CONFLICT": + case 2: + message.namespacedResourceRestoreMode = 2; + break; + } + if (object.clusterResourceRestoreScope != null) { + if (typeof object.clusterResourceRestoreScope !== "object") + throw TypeError(".google.cloud.gkebackup.v1.RestoreConfig.clusterResourceRestoreScope: object expected"); + message.clusterResourceRestoreScope = $root.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.fromObject(object.clusterResourceRestoreScope); + } + if (object.allNamespaces != null) + message.allNamespaces = Boolean(object.allNamespaces); + if (object.selectedNamespaces != null) { + if (typeof object.selectedNamespaces !== "object") + throw TypeError(".google.cloud.gkebackup.v1.RestoreConfig.selectedNamespaces: object expected"); + message.selectedNamespaces = $root.google.cloud.gkebackup.v1.Namespaces.fromObject(object.selectedNamespaces); + } + if (object.selectedApplications != null) { + if (typeof object.selectedApplications !== "object") + throw TypeError(".google.cloud.gkebackup.v1.RestoreConfig.selectedApplications: object expected"); + message.selectedApplications = $root.google.cloud.gkebackup.v1.NamespacedNames.fromObject(object.selectedApplications); + } + if (object.substitutionRules) { + if (!Array.isArray(object.substitutionRules)) + throw TypeError(".google.cloud.gkebackup.v1.RestoreConfig.substitutionRules: array expected"); + message.substitutionRules = []; + for (var i = 0; i < object.substitutionRules.length; ++i) { + if (typeof object.substitutionRules[i] !== "object") + throw TypeError(".google.cloud.gkebackup.v1.RestoreConfig.substitutionRules: object expected"); + message.substitutionRules[i] = $root.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.fromObject(object.substitutionRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RestoreConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig} message RestoreConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.substitutionRules = []; + if (options.defaults) { + object.volumeDataRestorePolicy = options.enums === String ? "VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED" : 0; + object.clusterResourceConflictPolicy = options.enums === String ? "CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED" : 0; + object.namespacedResourceRestoreMode = options.enums === String ? "NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED" : 0; + object.clusterResourceRestoreScope = null; + } + if (message.volumeDataRestorePolicy != null && message.hasOwnProperty("volumeDataRestorePolicy")) + object.volumeDataRestorePolicy = options.enums === String ? $root.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy[message.volumeDataRestorePolicy] === undefined ? message.volumeDataRestorePolicy : $root.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy[message.volumeDataRestorePolicy] : message.volumeDataRestorePolicy; + if (message.clusterResourceConflictPolicy != null && message.hasOwnProperty("clusterResourceConflictPolicy")) + object.clusterResourceConflictPolicy = options.enums === String ? $root.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy[message.clusterResourceConflictPolicy] === undefined ? message.clusterResourceConflictPolicy : $root.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy[message.clusterResourceConflictPolicy] : message.clusterResourceConflictPolicy; + if (message.namespacedResourceRestoreMode != null && message.hasOwnProperty("namespacedResourceRestoreMode")) + object.namespacedResourceRestoreMode = options.enums === String ? $root.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode[message.namespacedResourceRestoreMode] === undefined ? message.namespacedResourceRestoreMode : $root.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode[message.namespacedResourceRestoreMode] : message.namespacedResourceRestoreMode; + if (message.clusterResourceRestoreScope != null && message.hasOwnProperty("clusterResourceRestoreScope")) + object.clusterResourceRestoreScope = $root.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.toObject(message.clusterResourceRestoreScope, options); + if (message.allNamespaces != null && message.hasOwnProperty("allNamespaces")) { + object.allNamespaces = message.allNamespaces; + if (options.oneofs) + object.namespacedResourceRestoreScope = "allNamespaces"; + } + if (message.selectedNamespaces != null && message.hasOwnProperty("selectedNamespaces")) { + object.selectedNamespaces = $root.google.cloud.gkebackup.v1.Namespaces.toObject(message.selectedNamespaces, options); + if (options.oneofs) + object.namespacedResourceRestoreScope = "selectedNamespaces"; + } + if (message.selectedApplications != null && message.hasOwnProperty("selectedApplications")) { + object.selectedApplications = $root.google.cloud.gkebackup.v1.NamespacedNames.toObject(message.selectedApplications, options); + if (options.oneofs) + object.namespacedResourceRestoreScope = "selectedApplications"; + } + if (message.substitutionRules && message.substitutionRules.length) { + object.substitutionRules = []; + for (var j = 0; j < message.substitutionRules.length; ++j) + object.substitutionRules[j] = $root.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.toObject(message.substitutionRules[j], options); + } + return object; + }; + + /** + * Converts this RestoreConfig to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @instance + * @returns {Object.} JSON object + */ + RestoreConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreConfig + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.RestoreConfig"; + }; + + /** + * VolumeDataRestorePolicy enum. + * @name google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy + * @enum {number} + * @property {number} VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED=0 VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED value + * @property {number} RESTORE_VOLUME_DATA_FROM_BACKUP=1 RESTORE_VOLUME_DATA_FROM_BACKUP value + * @property {number} REUSE_VOLUME_HANDLE_FROM_BACKUP=2 REUSE_VOLUME_HANDLE_FROM_BACKUP value + * @property {number} NO_VOLUME_DATA_RESTORATION=3 NO_VOLUME_DATA_RESTORATION value + */ + RestoreConfig.VolumeDataRestorePolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESTORE_VOLUME_DATA_FROM_BACKUP"] = 1; + values[valuesById[2] = "REUSE_VOLUME_HANDLE_FROM_BACKUP"] = 2; + values[valuesById[3] = "NO_VOLUME_DATA_RESTORATION"] = 3; + return values; + })(); + + /** + * ClusterResourceConflictPolicy enum. + * @name google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy + * @enum {number} + * @property {number} CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED=0 CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED value + * @property {number} USE_EXISTING_VERSION=1 USE_EXISTING_VERSION value + * @property {number} USE_BACKUP_VERSION=2 USE_BACKUP_VERSION value + */ + RestoreConfig.ClusterResourceConflictPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "USE_EXISTING_VERSION"] = 1; + values[valuesById[2] = "USE_BACKUP_VERSION"] = 2; + return values; + })(); + + /** + * NamespacedResourceRestoreMode enum. + * @name google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode + * @enum {number} + * @property {number} NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED=0 NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED value + * @property {number} DELETE_AND_RESTORE=1 DELETE_AND_RESTORE value + * @property {number} FAIL_ON_CONFLICT=2 FAIL_ON_CONFLICT value + */ + RestoreConfig.NamespacedResourceRestoreMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DELETE_AND_RESTORE"] = 1; + values[valuesById[2] = "FAIL_ON_CONFLICT"] = 2; + return values; + })(); + + RestoreConfig.GroupKind = (function() { + + /** + * Properties of a GroupKind. + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @interface IGroupKind + * @property {string|null} [resourceGroup] GroupKind resourceGroup + * @property {string|null} [resourceKind] GroupKind resourceKind + */ + + /** + * Constructs a new GroupKind. + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @classdesc Represents a GroupKind. + * @implements IGroupKind + * @constructor + * @param {google.cloud.gkebackup.v1.RestoreConfig.IGroupKind=} [properties] Properties to set + */ + function GroupKind(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupKind resourceGroup. + * @member {string} resourceGroup + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @instance + */ + GroupKind.prototype.resourceGroup = ""; + + /** + * GroupKind resourceKind. + * @member {string} resourceKind + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @instance + */ + GroupKind.prototype.resourceKind = ""; + + /** + * Creates a new GroupKind instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.IGroupKind=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.RestoreConfig.GroupKind} GroupKind instance + */ + GroupKind.create = function create(properties) { + return new GroupKind(properties); + }; + + /** + * Encodes the specified GroupKind message. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.GroupKind.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.IGroupKind} message GroupKind message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupKind.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceGroup != null && Object.hasOwnProperty.call(message, "resourceGroup")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceGroup); + if (message.resourceKind != null && Object.hasOwnProperty.call(message, "resourceKind")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceKind); + return writer; + }; + + /** + * Encodes the specified GroupKind message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.GroupKind.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.IGroupKind} message GroupKind message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupKind.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupKind message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.RestoreConfig.GroupKind} GroupKind + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupKind.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceGroup = reader.string(); + break; + } + case 2: { + message.resourceKind = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupKind message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.RestoreConfig.GroupKind} GroupKind + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupKind.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupKind message. + * @function verify + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupKind.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) + if (!$util.isString(message.resourceGroup)) + return "resourceGroup: string expected"; + if (message.resourceKind != null && message.hasOwnProperty("resourceKind")) + if (!$util.isString(message.resourceKind)) + return "resourceKind: string expected"; + return null; + }; + + /** + * Creates a GroupKind message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.RestoreConfig.GroupKind} GroupKind + */ + GroupKind.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind) + return object; + var message = new $root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind(); + if (object.resourceGroup != null) + message.resourceGroup = String(object.resourceGroup); + if (object.resourceKind != null) + message.resourceKind = String(object.resourceKind); + return message; + }; + + /** + * Creates a plain object from a GroupKind message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.GroupKind} message GroupKind + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupKind.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceGroup = ""; + object.resourceKind = ""; + } + if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) + object.resourceGroup = message.resourceGroup; + if (message.resourceKind != null && message.hasOwnProperty("resourceKind")) + object.resourceKind = message.resourceKind; + return object; + }; + + /** + * Converts this GroupKind to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @instance + * @returns {Object.} JSON object + */ + GroupKind.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupKind + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.RestoreConfig.GroupKind + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupKind.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.RestoreConfig.GroupKind"; + }; + + return GroupKind; + })(); + + RestoreConfig.ClusterResourceRestoreScope = (function() { + + /** + * Properties of a ClusterResourceRestoreScope. + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @interface IClusterResourceRestoreScope + * @property {Array.|null} [selectedGroupKinds] ClusterResourceRestoreScope selectedGroupKinds + */ + + /** + * Constructs a new ClusterResourceRestoreScope. + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @classdesc Represents a ClusterResourceRestoreScope. + * @implements IClusterResourceRestoreScope + * @constructor + * @param {google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope=} [properties] Properties to set + */ + function ClusterResourceRestoreScope(properties) { + this.selectedGroupKinds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterResourceRestoreScope selectedGroupKinds. + * @member {Array.} selectedGroupKinds + * @memberof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + * @instance + */ + ClusterResourceRestoreScope.prototype.selectedGroupKinds = $util.emptyArray; + + /** + * Creates a new ClusterResourceRestoreScope instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope} ClusterResourceRestoreScope instance + */ + ClusterResourceRestoreScope.create = function create(properties) { + return new ClusterResourceRestoreScope(properties); + }; + + /** + * Encodes the specified ClusterResourceRestoreScope message. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope} message ClusterResourceRestoreScope message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterResourceRestoreScope.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectedGroupKinds != null && message.selectedGroupKinds.length) + for (var i = 0; i < message.selectedGroupKinds.length; ++i) + $root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.encode(message.selectedGroupKinds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterResourceRestoreScope message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.IClusterResourceRestoreScope} message ClusterResourceRestoreScope message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterResourceRestoreScope.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterResourceRestoreScope message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope} ClusterResourceRestoreScope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterResourceRestoreScope.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.selectedGroupKinds && message.selectedGroupKinds.length)) + message.selectedGroupKinds = []; + message.selectedGroupKinds.push($root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterResourceRestoreScope message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope} ClusterResourceRestoreScope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterResourceRestoreScope.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterResourceRestoreScope message. + * @function verify + * @memberof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterResourceRestoreScope.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selectedGroupKinds != null && message.hasOwnProperty("selectedGroupKinds")) { + if (!Array.isArray(message.selectedGroupKinds)) + return "selectedGroupKinds: array expected"; + for (var i = 0; i < message.selectedGroupKinds.length; ++i) { + var error = $root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.verify(message.selectedGroupKinds[i]); + if (error) + return "selectedGroupKinds." + error; + } + } + return null; + }; + + /** + * Creates a ClusterResourceRestoreScope message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope} ClusterResourceRestoreScope + */ + ClusterResourceRestoreScope.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope) + return object; + var message = new $root.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope(); + if (object.selectedGroupKinds) { + if (!Array.isArray(object.selectedGroupKinds)) + throw TypeError(".google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.selectedGroupKinds: array expected"); + message.selectedGroupKinds = []; + for (var i = 0; i < object.selectedGroupKinds.length; ++i) { + if (typeof object.selectedGroupKinds[i] !== "object") + throw TypeError(".google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.selectedGroupKinds: object expected"); + message.selectedGroupKinds[i] = $root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.fromObject(object.selectedGroupKinds[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClusterResourceRestoreScope message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope} message ClusterResourceRestoreScope + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterResourceRestoreScope.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.selectedGroupKinds = []; + if (message.selectedGroupKinds && message.selectedGroupKinds.length) { + object.selectedGroupKinds = []; + for (var j = 0; j < message.selectedGroupKinds.length; ++j) + object.selectedGroupKinds[j] = $root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.toObject(message.selectedGroupKinds[j], options); + } + return object; + }; + + /** + * Converts this ClusterResourceRestoreScope to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + * @instance + * @returns {Object.} JSON object + */ + ClusterResourceRestoreScope.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterResourceRestoreScope + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterResourceRestoreScope.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope"; + }; + + return ClusterResourceRestoreScope; + })(); + + RestoreConfig.SubstitutionRule = (function() { + + /** + * Properties of a SubstitutionRule. + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @interface ISubstitutionRule + * @property {Array.|null} [targetNamespaces] SubstitutionRule targetNamespaces + * @property {Array.|null} [targetGroupKinds] SubstitutionRule targetGroupKinds + * @property {string|null} [targetJsonPath] SubstitutionRule targetJsonPath + * @property {string|null} [originalValuePattern] SubstitutionRule originalValuePattern + * @property {string|null} [newValue] SubstitutionRule newValue + */ + + /** + * Constructs a new SubstitutionRule. + * @memberof google.cloud.gkebackup.v1.RestoreConfig + * @classdesc Represents a SubstitutionRule. + * @implements ISubstitutionRule + * @constructor + * @param {google.cloud.gkebackup.v1.RestoreConfig.ISubstitutionRule=} [properties] Properties to set + */ + function SubstitutionRule(properties) { + this.targetNamespaces = []; + this.targetGroupKinds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubstitutionRule targetNamespaces. + * @member {Array.} targetNamespaces + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @instance + */ + SubstitutionRule.prototype.targetNamespaces = $util.emptyArray; + + /** + * SubstitutionRule targetGroupKinds. + * @member {Array.} targetGroupKinds + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @instance + */ + SubstitutionRule.prototype.targetGroupKinds = $util.emptyArray; + + /** + * SubstitutionRule targetJsonPath. + * @member {string} targetJsonPath + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @instance + */ + SubstitutionRule.prototype.targetJsonPath = ""; + + /** + * SubstitutionRule originalValuePattern. + * @member {string} originalValuePattern + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @instance + */ + SubstitutionRule.prototype.originalValuePattern = ""; + + /** + * SubstitutionRule newValue. + * @member {string} newValue + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @instance + */ + SubstitutionRule.prototype.newValue = ""; + + /** + * Creates a new SubstitutionRule instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.ISubstitutionRule=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule} SubstitutionRule instance + */ + SubstitutionRule.create = function create(properties) { + return new SubstitutionRule(properties); + }; + + /** + * Encodes the specified SubstitutionRule message. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.ISubstitutionRule} message SubstitutionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubstitutionRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetNamespaces != null && message.targetNamespaces.length) + for (var i = 0; i < message.targetNamespaces.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetNamespaces[i]); + if (message.targetGroupKinds != null && message.targetGroupKinds.length) + for (var i = 0; i < message.targetGroupKinds.length; ++i) + $root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.encode(message.targetGroupKinds[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.targetJsonPath != null && Object.hasOwnProperty.call(message, "targetJsonPath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetJsonPath); + if (message.originalValuePattern != null && Object.hasOwnProperty.call(message, "originalValuePattern")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.originalValuePattern); + if (message.newValue != null && Object.hasOwnProperty.call(message, "newValue")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.newValue); + return writer; + }; + + /** + * Encodes the specified SubstitutionRule message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.ISubstitutionRule} message SubstitutionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubstitutionRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubstitutionRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule} SubstitutionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubstitutionRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.targetNamespaces && message.targetNamespaces.length)) + message.targetNamespaces = []; + message.targetNamespaces.push(reader.string()); + break; + } + case 2: { + if (!(message.targetGroupKinds && message.targetGroupKinds.length)) + message.targetGroupKinds = []; + message.targetGroupKinds.push($root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.decode(reader, reader.uint32())); + break; + } + case 3: { + message.targetJsonPath = reader.string(); + break; + } + case 4: { + message.originalValuePattern = reader.string(); + break; + } + case 5: { + message.newValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubstitutionRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule} SubstitutionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubstitutionRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubstitutionRule message. + * @function verify + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubstitutionRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetNamespaces != null && message.hasOwnProperty("targetNamespaces")) { + if (!Array.isArray(message.targetNamespaces)) + return "targetNamespaces: array expected"; + for (var i = 0; i < message.targetNamespaces.length; ++i) + if (!$util.isString(message.targetNamespaces[i])) + return "targetNamespaces: string[] expected"; + } + if (message.targetGroupKinds != null && message.hasOwnProperty("targetGroupKinds")) { + if (!Array.isArray(message.targetGroupKinds)) + return "targetGroupKinds: array expected"; + for (var i = 0; i < message.targetGroupKinds.length; ++i) { + var error = $root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.verify(message.targetGroupKinds[i]); + if (error) + return "targetGroupKinds." + error; + } + } + if (message.targetJsonPath != null && message.hasOwnProperty("targetJsonPath")) + if (!$util.isString(message.targetJsonPath)) + return "targetJsonPath: string expected"; + if (message.originalValuePattern != null && message.hasOwnProperty("originalValuePattern")) + if (!$util.isString(message.originalValuePattern)) + return "originalValuePattern: string expected"; + if (message.newValue != null && message.hasOwnProperty("newValue")) + if (!$util.isString(message.newValue)) + return "newValue: string expected"; + return null; + }; + + /** + * Creates a SubstitutionRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule} SubstitutionRule + */ + SubstitutionRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) + return object; + var message = new $root.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule(); + if (object.targetNamespaces) { + if (!Array.isArray(object.targetNamespaces)) + throw TypeError(".google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.targetNamespaces: array expected"); + message.targetNamespaces = []; + for (var i = 0; i < object.targetNamespaces.length; ++i) + message.targetNamespaces[i] = String(object.targetNamespaces[i]); + } + if (object.targetGroupKinds) { + if (!Array.isArray(object.targetGroupKinds)) + throw TypeError(".google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.targetGroupKinds: array expected"); + message.targetGroupKinds = []; + for (var i = 0; i < object.targetGroupKinds.length; ++i) { + if (typeof object.targetGroupKinds[i] !== "object") + throw TypeError(".google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.targetGroupKinds: object expected"); + message.targetGroupKinds[i] = $root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.fromObject(object.targetGroupKinds[i]); + } + } + if (object.targetJsonPath != null) + message.targetJsonPath = String(object.targetJsonPath); + if (object.originalValuePattern != null) + message.originalValuePattern = String(object.originalValuePattern); + if (object.newValue != null) + message.newValue = String(object.newValue); + return message; + }; + + /** + * Creates a plain object from a SubstitutionRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @static + * @param {google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule} message SubstitutionRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubstitutionRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targetNamespaces = []; + object.targetGroupKinds = []; + } + if (options.defaults) { + object.targetJsonPath = ""; + object.originalValuePattern = ""; + object.newValue = ""; + } + if (message.targetNamespaces && message.targetNamespaces.length) { + object.targetNamespaces = []; + for (var j = 0; j < message.targetNamespaces.length; ++j) + object.targetNamespaces[j] = message.targetNamespaces[j]; + } + if (message.targetGroupKinds && message.targetGroupKinds.length) { + object.targetGroupKinds = []; + for (var j = 0; j < message.targetGroupKinds.length; ++j) + object.targetGroupKinds[j] = $root.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.toObject(message.targetGroupKinds[j], options); + } + if (message.targetJsonPath != null && message.hasOwnProperty("targetJsonPath")) + object.targetJsonPath = message.targetJsonPath; + if (message.originalValuePattern != null && message.hasOwnProperty("originalValuePattern")) + object.originalValuePattern = message.originalValuePattern; + if (message.newValue != null && message.hasOwnProperty("newValue")) + object.newValue = message.newValue; + return object; + }; + + /** + * Converts this SubstitutionRule to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @instance + * @returns {Object.} JSON object + */ + SubstitutionRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubstitutionRule + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubstitutionRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule"; + }; + + return SubstitutionRule; + })(); + + return RestoreConfig; + })(); + + v1.RestorePlan = (function() { + + /** + * Properties of a RestorePlan. + * @memberof google.cloud.gkebackup.v1 + * @interface IRestorePlan + * @property {string|null} [name] RestorePlan name + * @property {string|null} [uid] RestorePlan uid + * @property {google.protobuf.ITimestamp|null} [createTime] RestorePlan createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] RestorePlan updateTime + * @property {string|null} [description] RestorePlan description + * @property {string|null} [backupPlan] RestorePlan backupPlan + * @property {string|null} [cluster] RestorePlan cluster + * @property {google.cloud.gkebackup.v1.IRestoreConfig|null} [restoreConfig] RestorePlan restoreConfig + * @property {Object.|null} [labels] RestorePlan labels + * @property {string|null} [etag] RestorePlan etag + */ + + /** + * Constructs a new RestorePlan. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a RestorePlan. + * @implements IRestorePlan + * @constructor + * @param {google.cloud.gkebackup.v1.IRestorePlan=} [properties] Properties to set + */ + function RestorePlan(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]]; + } + + /** + * RestorePlan name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @instance + */ + RestorePlan.prototype.name = ""; + + /** + * RestorePlan uid. + * @member {string} uid + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @instance + */ + RestorePlan.prototype.uid = ""; + + /** + * RestorePlan createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @instance + */ + RestorePlan.prototype.createTime = null; + + /** + * RestorePlan updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @instance + */ + RestorePlan.prototype.updateTime = null; + + /** + * RestorePlan description. + * @member {string} description + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @instance + */ + RestorePlan.prototype.description = ""; + + /** + * RestorePlan backupPlan. + * @member {string} backupPlan + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @instance + */ + RestorePlan.prototype.backupPlan = ""; + + /** + * RestorePlan cluster. + * @member {string} cluster + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @instance + */ + RestorePlan.prototype.cluster = ""; + + /** + * RestorePlan restoreConfig. + * @member {google.cloud.gkebackup.v1.IRestoreConfig|null|undefined} restoreConfig + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @instance + */ + RestorePlan.prototype.restoreConfig = null; + + /** + * RestorePlan labels. + * @member {Object.} labels + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @instance + */ + RestorePlan.prototype.labels = $util.emptyObject; + + /** + * RestorePlan etag. + * @member {string} etag + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @instance + */ + RestorePlan.prototype.etag = ""; + + /** + * Creates a new RestorePlan instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @static + * @param {google.cloud.gkebackup.v1.IRestorePlan=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.RestorePlan} RestorePlan instance + */ + RestorePlan.create = function create(properties) { + return new RestorePlan(properties); + }; + + /** + * Encodes the specified RestorePlan message. Does not implicitly {@link google.cloud.gkebackup.v1.RestorePlan.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @static + * @param {google.cloud.gkebackup.v1.IRestorePlan} message RestorePlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestorePlan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.backupPlan); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cluster); + if (message.restoreConfig != null && Object.hasOwnProperty.call(message, "restoreConfig")) + $root.google.cloud.gkebackup.v1.RestoreConfig.encode(message.restoreConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); + return writer; + }; + + /** + * Encodes the specified RestorePlan message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.RestorePlan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @static + * @param {google.cloud.gkebackup.v1.IRestorePlan} message RestorePlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestorePlan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestorePlan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.RestorePlan} RestorePlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestorePlan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.RestorePlan(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.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: { + message.description = reader.string(); + break; + } + case 6: { + message.backupPlan = reader.string(); + break; + } + case 7: { + message.cluster = reader.string(); + break; + } + case 8: { + message.restoreConfig = $root.google.cloud.gkebackup.v1.RestoreConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 10: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestorePlan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.RestorePlan} RestorePlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestorePlan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestorePlan message. + * @function verify + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestorePlan.verify = function verify(message) { + if (typeof message !== "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.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + if (!$util.isString(message.backupPlan)) + return "backupPlan: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.restoreConfig != null && message.hasOwnProperty("restoreConfig")) { + var error = $root.google.cloud.gkebackup.v1.RestoreConfig.verify(message.restoreConfig); + if (error) + return "restoreConfig." + 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a RestorePlan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.RestorePlan} RestorePlan + */ + RestorePlan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.RestorePlan) + return object; + var message = new $root.google.cloud.gkebackup.v1.RestorePlan(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gkebackup.v1.RestorePlan.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.gkebackup.v1.RestorePlan.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + if (object.backupPlan != null) + message.backupPlan = String(object.backupPlan); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.restoreConfig != null) { + if (typeof object.restoreConfig !== "object") + throw TypeError(".google.cloud.gkebackup.v1.RestorePlan.restoreConfig: object expected"); + message.restoreConfig = $root.google.cloud.gkebackup.v1.RestoreConfig.fromObject(object.restoreConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gkebackup.v1.RestorePlan.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.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a RestorePlan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @static + * @param {google.cloud.gkebackup.v1.RestorePlan} message RestorePlan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestorePlan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.backupPlan = ""; + object.cluster = ""; + object.restoreConfig = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = message.backupPlan; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.restoreConfig != null && message.hasOwnProperty("restoreConfig")) + object.restoreConfig = $root.google.cloud.gkebackup.v1.RestoreConfig.toObject(message.restoreConfig, 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this RestorePlan to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @instance + * @returns {Object.} JSON object + */ + RestorePlan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestorePlan + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.RestorePlan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestorePlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.RestorePlan"; + }; + + return RestorePlan; + })(); + + v1.VolumeBackup = (function() { + + /** + * Properties of a VolumeBackup. + * @memberof google.cloud.gkebackup.v1 + * @interface IVolumeBackup + * @property {string|null} [name] VolumeBackup name + * @property {string|null} [uid] VolumeBackup uid + * @property {google.protobuf.ITimestamp|null} [createTime] VolumeBackup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] VolumeBackup updateTime + * @property {google.cloud.gkebackup.v1.INamespacedName|null} [sourcePvc] VolumeBackup sourcePvc + * @property {string|null} [volumeBackupHandle] VolumeBackup volumeBackupHandle + * @property {google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat|null} [format] VolumeBackup format + * @property {number|Long|null} [storageBytes] VolumeBackup storageBytes + * @property {number|Long|null} [diskSizeBytes] VolumeBackup diskSizeBytes + * @property {google.protobuf.ITimestamp|null} [completeTime] VolumeBackup completeTime + * @property {google.cloud.gkebackup.v1.VolumeBackup.State|null} [state] VolumeBackup state + * @property {string|null} [stateMessage] VolumeBackup stateMessage + * @property {string|null} [etag] VolumeBackup etag + */ + + /** + * Constructs a new VolumeBackup. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a VolumeBackup. + * @implements IVolumeBackup + * @constructor + * @param {google.cloud.gkebackup.v1.IVolumeBackup=} [properties] Properties to set + */ + function VolumeBackup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VolumeBackup name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.name = ""; + + /** + * VolumeBackup uid. + * @member {string} uid + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.uid = ""; + + /** + * VolumeBackup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.createTime = null; + + /** + * VolumeBackup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.updateTime = null; + + /** + * VolumeBackup sourcePvc. + * @member {google.cloud.gkebackup.v1.INamespacedName|null|undefined} sourcePvc + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.sourcePvc = null; + + /** + * VolumeBackup volumeBackupHandle. + * @member {string} volumeBackupHandle + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.volumeBackupHandle = ""; + + /** + * VolumeBackup format. + * @member {google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat} format + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.format = 0; + + /** + * VolumeBackup storageBytes. + * @member {number|Long} storageBytes + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.storageBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * VolumeBackup diskSizeBytes. + * @member {number|Long} diskSizeBytes + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.diskSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * VolumeBackup completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.completeTime = null; + + /** + * VolumeBackup state. + * @member {google.cloud.gkebackup.v1.VolumeBackup.State} state + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.state = 0; + + /** + * VolumeBackup stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.stateMessage = ""; + + /** + * VolumeBackup etag. + * @member {string} etag + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + */ + VolumeBackup.prototype.etag = ""; + + /** + * Creates a new VolumeBackup instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @static + * @param {google.cloud.gkebackup.v1.IVolumeBackup=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.VolumeBackup} VolumeBackup instance + */ + VolumeBackup.create = function create(properties) { + return new VolumeBackup(properties); + }; + + /** + * Encodes the specified VolumeBackup message. Does not implicitly {@link google.cloud.gkebackup.v1.VolumeBackup.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @static + * @param {google.cloud.gkebackup.v1.IVolumeBackup} message VolumeBackup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VolumeBackup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.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.sourcePvc != null && Object.hasOwnProperty.call(message, "sourcePvc")) + $root.google.cloud.gkebackup.v1.NamespacedName.encode(message.sourcePvc, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.volumeBackupHandle != null && Object.hasOwnProperty.call(message, "volumeBackupHandle")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.volumeBackupHandle); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.format); + if (message.storageBytes != null && Object.hasOwnProperty.call(message, "storageBytes")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.storageBytes); + if (message.diskSizeBytes != null && Object.hasOwnProperty.call(message, "diskSizeBytes")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.diskSizeBytes); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.stateMessage); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.etag); + return writer; + }; + + /** + * Encodes the specified VolumeBackup message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.VolumeBackup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @static + * @param {google.cloud.gkebackup.v1.IVolumeBackup} message VolumeBackup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VolumeBackup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VolumeBackup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.VolumeBackup} VolumeBackup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VolumeBackup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.VolumeBackup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.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: { + message.sourcePvc = $root.google.cloud.gkebackup.v1.NamespacedName.decode(reader, reader.uint32()); + break; + } + case 6: { + message.volumeBackupHandle = reader.string(); + break; + } + case 7: { + message.format = reader.int32(); + break; + } + case 8: { + message.storageBytes = reader.int64(); + break; + } + case 9: { + message.diskSizeBytes = reader.int64(); + break; + } + case 10: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.state = reader.int32(); + break; + } + case 12: { + message.stateMessage = reader.string(); + break; + } + case 13: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VolumeBackup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.VolumeBackup} VolumeBackup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VolumeBackup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VolumeBackup message. + * @function verify + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VolumeBackup.verify = function verify(message) { + if (typeof message !== "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.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.sourcePvc != null && message.hasOwnProperty("sourcePvc")) { + var error = $root.google.cloud.gkebackup.v1.NamespacedName.verify(message.sourcePvc); + if (error) + return "sourcePvc." + error; + } + if (message.volumeBackupHandle != null && message.hasOwnProperty("volumeBackupHandle")) + if (!$util.isString(message.volumeBackupHandle)) + return "volumeBackupHandle: string expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + break; + } + if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) + if (!$util.isInteger(message.storageBytes) && !(message.storageBytes && $util.isInteger(message.storageBytes.low) && $util.isInteger(message.storageBytes.high))) + return "storageBytes: integer|Long expected"; + if (message.diskSizeBytes != null && message.hasOwnProperty("diskSizeBytes")) + if (!$util.isInteger(message.diskSizeBytes) && !(message.diskSizeBytes && $util.isInteger(message.diskSizeBytes.low) && $util.isInteger(message.diskSizeBytes.high))) + return "diskSizeBytes: integer|Long expected"; + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a VolumeBackup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.VolumeBackup} VolumeBackup + */ + VolumeBackup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.VolumeBackup) + return object; + var message = new $root.google.cloud.gkebackup.v1.VolumeBackup(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gkebackup.v1.VolumeBackup.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.gkebackup.v1.VolumeBackup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.sourcePvc != null) { + if (typeof object.sourcePvc !== "object") + throw TypeError(".google.cloud.gkebackup.v1.VolumeBackup.sourcePvc: object expected"); + message.sourcePvc = $root.google.cloud.gkebackup.v1.NamespacedName.fromObject(object.sourcePvc); + } + if (object.volumeBackupHandle != null) + message.volumeBackupHandle = String(object.volumeBackupHandle); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "VOLUME_BACKUP_FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "GCE_PERSISTENT_DISK": + case 1: + message.format = 1; + break; + } + if (object.storageBytes != null) + if ($util.Long) + (message.storageBytes = $util.Long.fromValue(object.storageBytes)).unsigned = false; + else if (typeof object.storageBytes === "string") + message.storageBytes = parseInt(object.storageBytes, 10); + else if (typeof object.storageBytes === "number") + message.storageBytes = object.storageBytes; + else if (typeof object.storageBytes === "object") + message.storageBytes = new $util.LongBits(object.storageBytes.low >>> 0, object.storageBytes.high >>> 0).toNumber(); + if (object.diskSizeBytes != null) + if ($util.Long) + (message.diskSizeBytes = $util.Long.fromValue(object.diskSizeBytes)).unsigned = false; + else if (typeof object.diskSizeBytes === "string") + message.diskSizeBytes = parseInt(object.diskSizeBytes, 10); + else if (typeof object.diskSizeBytes === "number") + message.diskSizeBytes = object.diskSizeBytes; + else if (typeof object.diskSizeBytes === "object") + message.diskSizeBytes = new $util.LongBits(object.diskSizeBytes.low >>> 0, object.diskSizeBytes.high >>> 0).toNumber(); + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.cloud.gkebackup.v1.VolumeBackup.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); + } + 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 "SNAPSHOTTING": + case 2: + message.state = 2; + break; + case "UPLOADING": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "DELETING": + case 6: + message.state = 6; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a VolumeBackup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @static + * @param {google.cloud.gkebackup.v1.VolumeBackup} message VolumeBackup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VolumeBackup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.sourcePvc = null; + object.volumeBackupHandle = ""; + object.format = options.enums === String ? "VOLUME_BACKUP_FORMAT_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.storageBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.storageBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.diskSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.diskSizeBytes = options.longs === String ? "0" : 0; + object.completeTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.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.sourcePvc != null && message.hasOwnProperty("sourcePvc")) + object.sourcePvc = $root.google.cloud.gkebackup.v1.NamespacedName.toObject(message.sourcePvc, options); + if (message.volumeBackupHandle != null && message.hasOwnProperty("volumeBackupHandle")) + object.volumeBackupHandle = message.volumeBackupHandle; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat[message.format] === undefined ? message.format : $root.google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat[message.format] : message.format; + if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) + if (typeof message.storageBytes === "number") + object.storageBytes = options.longs === String ? String(message.storageBytes) : message.storageBytes; + else + object.storageBytes = options.longs === String ? $util.Long.prototype.toString.call(message.storageBytes) : options.longs === Number ? new $util.LongBits(message.storageBytes.low >>> 0, message.storageBytes.high >>> 0).toNumber() : message.storageBytes; + if (message.diskSizeBytes != null && message.hasOwnProperty("diskSizeBytes")) + if (typeof message.diskSizeBytes === "number") + object.diskSizeBytes = options.longs === String ? String(message.diskSizeBytes) : message.diskSizeBytes; + else + object.diskSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeBytes) : options.longs === Number ? new $util.LongBits(message.diskSizeBytes.low >>> 0, message.diskSizeBytes.high >>> 0).toNumber() : message.diskSizeBytes; + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.gkebackup.v1.VolumeBackup.State[message.state] === undefined ? message.state : $root.google.cloud.gkebackup.v1.VolumeBackup.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this VolumeBackup to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @instance + * @returns {Object.} JSON object + */ + VolumeBackup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VolumeBackup + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.VolumeBackup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VolumeBackup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.VolumeBackup"; + }; + + /** + * VolumeBackupFormat enum. + * @name google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat + * @enum {number} + * @property {number} VOLUME_BACKUP_FORMAT_UNSPECIFIED=0 VOLUME_BACKUP_FORMAT_UNSPECIFIED value + * @property {number} GCE_PERSISTENT_DISK=1 GCE_PERSISTENT_DISK value + */ + VolumeBackup.VolumeBackupFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VOLUME_BACKUP_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "GCE_PERSISTENT_DISK"] = 1; + return values; + })(); + + /** + * State enum. + * @name google.cloud.gkebackup.v1.VolumeBackup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} SNAPSHOTTING=2 SNAPSHOTTING value + * @property {number} UPLOADING=3 UPLOADING value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} FAILED=5 FAILED value + * @property {number} DELETING=6 DELETING value + */ + VolumeBackup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "SNAPSHOTTING"] = 2; + values[valuesById[3] = "UPLOADING"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "DELETING"] = 6; + return values; + })(); + + return VolumeBackup; + })(); + + v1.VolumeRestore = (function() { + + /** + * Properties of a VolumeRestore. + * @memberof google.cloud.gkebackup.v1 + * @interface IVolumeRestore + * @property {string|null} [name] VolumeRestore name + * @property {string|null} [uid] VolumeRestore uid + * @property {google.protobuf.ITimestamp|null} [createTime] VolumeRestore createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] VolumeRestore updateTime + * @property {string|null} [volumeBackup] VolumeRestore volumeBackup + * @property {google.cloud.gkebackup.v1.INamespacedName|null} [targetPvc] VolumeRestore targetPvc + * @property {string|null} [volumeHandle] VolumeRestore volumeHandle + * @property {google.cloud.gkebackup.v1.VolumeRestore.VolumeType|null} [volumeType] VolumeRestore volumeType + * @property {google.protobuf.ITimestamp|null} [completeTime] VolumeRestore completeTime + * @property {google.cloud.gkebackup.v1.VolumeRestore.State|null} [state] VolumeRestore state + * @property {string|null} [stateMessage] VolumeRestore stateMessage + * @property {string|null} [etag] VolumeRestore etag + */ + + /** + * Constructs a new VolumeRestore. + * @memberof google.cloud.gkebackup.v1 + * @classdesc Represents a VolumeRestore. + * @implements IVolumeRestore + * @constructor + * @param {google.cloud.gkebackup.v1.IVolumeRestore=} [properties] Properties to set + */ + function VolumeRestore(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VolumeRestore name. + * @member {string} name + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.name = ""; + + /** + * VolumeRestore uid. + * @member {string} uid + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.uid = ""; + + /** + * VolumeRestore createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.createTime = null; + + /** + * VolumeRestore updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.updateTime = null; + + /** + * VolumeRestore volumeBackup. + * @member {string} volumeBackup + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.volumeBackup = ""; + + /** + * VolumeRestore targetPvc. + * @member {google.cloud.gkebackup.v1.INamespacedName|null|undefined} targetPvc + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.targetPvc = null; + + /** + * VolumeRestore volumeHandle. + * @member {string} volumeHandle + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.volumeHandle = ""; + + /** + * VolumeRestore volumeType. + * @member {google.cloud.gkebackup.v1.VolumeRestore.VolumeType} volumeType + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.volumeType = 0; + + /** + * VolumeRestore completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.completeTime = null; + + /** + * VolumeRestore state. + * @member {google.cloud.gkebackup.v1.VolumeRestore.State} state + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.state = 0; + + /** + * VolumeRestore stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.stateMessage = ""; + + /** + * VolumeRestore etag. + * @member {string} etag + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + */ + VolumeRestore.prototype.etag = ""; + + /** + * Creates a new VolumeRestore instance using the specified properties. + * @function create + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @static + * @param {google.cloud.gkebackup.v1.IVolumeRestore=} [properties] Properties to set + * @returns {google.cloud.gkebackup.v1.VolumeRestore} VolumeRestore instance + */ + VolumeRestore.create = function create(properties) { + return new VolumeRestore(properties); + }; + + /** + * Encodes the specified VolumeRestore message. Does not implicitly {@link google.cloud.gkebackup.v1.VolumeRestore.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @static + * @param {google.cloud.gkebackup.v1.IVolumeRestore} message VolumeRestore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VolumeRestore.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.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.volumeBackup != null && Object.hasOwnProperty.call(message, "volumeBackup")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.volumeBackup); + if (message.targetPvc != null && Object.hasOwnProperty.call(message, "targetPvc")) + $root.google.cloud.gkebackup.v1.NamespacedName.encode(message.targetPvc, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.volumeHandle != null && Object.hasOwnProperty.call(message, "volumeHandle")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.volumeHandle); + if (message.volumeType != null && Object.hasOwnProperty.call(message, "volumeType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.volumeType); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.stateMessage); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); + return writer; + }; + + /** + * Encodes the specified VolumeRestore message, length delimited. Does not implicitly {@link google.cloud.gkebackup.v1.VolumeRestore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @static + * @param {google.cloud.gkebackup.v1.IVolumeRestore} message VolumeRestore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VolumeRestore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VolumeRestore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkebackup.v1.VolumeRestore} VolumeRestore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VolumeRestore.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkebackup.v1.VolumeRestore(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.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: { + message.volumeBackup = reader.string(); + break; + } + case 6: { + message.targetPvc = $root.google.cloud.gkebackup.v1.NamespacedName.decode(reader, reader.uint32()); + break; + } + case 7: { + message.volumeHandle = reader.string(); + break; + } + case 8: { + message.volumeType = reader.int32(); + break; + } + case 9: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.stateMessage = reader.string(); + break; + } + case 12: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VolumeRestore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkebackup.v1.VolumeRestore} VolumeRestore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VolumeRestore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VolumeRestore message. + * @function verify + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VolumeRestore.verify = function verify(message) { + if (typeof message !== "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.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.volumeBackup != null && message.hasOwnProperty("volumeBackup")) + if (!$util.isString(message.volumeBackup)) + return "volumeBackup: string expected"; + if (message.targetPvc != null && message.hasOwnProperty("targetPvc")) { + var error = $root.google.cloud.gkebackup.v1.NamespacedName.verify(message.targetPvc); + if (error) + return "targetPvc." + error; + } + if (message.volumeHandle != null && message.hasOwnProperty("volumeHandle")) + if (!$util.isString(message.volumeHandle)) + return "volumeHandle: string expected"; + if (message.volumeType != null && message.hasOwnProperty("volumeType")) + switch (message.volumeType) { + default: + return "volumeType: enum value expected"; + case 0: + case 1: + break; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a VolumeRestore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkebackup.v1.VolumeRestore} VolumeRestore + */ + VolumeRestore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkebackup.v1.VolumeRestore) + return object; + var message = new $root.google.cloud.gkebackup.v1.VolumeRestore(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gkebackup.v1.VolumeRestore.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.gkebackup.v1.VolumeRestore.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.volumeBackup != null) + message.volumeBackup = String(object.volumeBackup); + if (object.targetPvc != null) { + if (typeof object.targetPvc !== "object") + throw TypeError(".google.cloud.gkebackup.v1.VolumeRestore.targetPvc: object expected"); + message.targetPvc = $root.google.cloud.gkebackup.v1.NamespacedName.fromObject(object.targetPvc); + } + if (object.volumeHandle != null) + message.volumeHandle = String(object.volumeHandle); + switch (object.volumeType) { + default: + if (typeof object.volumeType === "number") { + message.volumeType = object.volumeType; + break; + } + break; + case "VOLUME_TYPE_UNSPECIFIED": + case 0: + message.volumeType = 0; + break; + case "GCE_PERSISTENT_DISK": + case 1: + message.volumeType = 1; + break; + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.cloud.gkebackup.v1.VolumeRestore.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); + } + 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 "RESTORING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a VolumeRestore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @static + * @param {google.cloud.gkebackup.v1.VolumeRestore} message VolumeRestore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VolumeRestore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.volumeBackup = ""; + object.targetPvc = null; + object.volumeHandle = ""; + object.volumeType = options.enums === String ? "VOLUME_TYPE_UNSPECIFIED" : 0; + object.completeTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.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.volumeBackup != null && message.hasOwnProperty("volumeBackup")) + object.volumeBackup = message.volumeBackup; + if (message.targetPvc != null && message.hasOwnProperty("targetPvc")) + object.targetPvc = $root.google.cloud.gkebackup.v1.NamespacedName.toObject(message.targetPvc, options); + if (message.volumeHandle != null && message.hasOwnProperty("volumeHandle")) + object.volumeHandle = message.volumeHandle; + if (message.volumeType != null && message.hasOwnProperty("volumeType")) + object.volumeType = options.enums === String ? $root.google.cloud.gkebackup.v1.VolumeRestore.VolumeType[message.volumeType] === undefined ? message.volumeType : $root.google.cloud.gkebackup.v1.VolumeRestore.VolumeType[message.volumeType] : message.volumeType; + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.gkebackup.v1.VolumeRestore.State[message.state] === undefined ? message.state : $root.google.cloud.gkebackup.v1.VolumeRestore.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this VolumeRestore to JSON. + * @function toJSON + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @instance + * @returns {Object.} JSON object + */ + VolumeRestore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VolumeRestore + * @function getTypeUrl + * @memberof google.cloud.gkebackup.v1.VolumeRestore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VolumeRestore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkebackup.v1.VolumeRestore"; + }; + + /** + * VolumeType enum. + * @name google.cloud.gkebackup.v1.VolumeRestore.VolumeType + * @enum {number} + * @property {number} VOLUME_TYPE_UNSPECIFIED=0 VOLUME_TYPE_UNSPECIFIED value + * @property {number} GCE_PERSISTENT_DISK=1 GCE_PERSISTENT_DISK value + */ + VolumeRestore.VolumeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VOLUME_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GCE_PERSISTENT_DISK"] = 1; + return values; + })(); + + /** + * State enum. + * @name google.cloud.gkebackup.v1.VolumeRestore.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} RESTORING=2 RESTORING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} DELETING=5 DELETING value + */ + VolumeRestore.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "RESTORING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "DELETING"] = 5; + return values; + })(); + + return VolumeRestore; + })(); + + return v1; + })(); + + return gkebackup; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * 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 = []; + if (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; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + 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"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + 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_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + 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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 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.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.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[".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.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 {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.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) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.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: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 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.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.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 (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 {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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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 {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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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 {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 + */ + + /** + * 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 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"] = ""; + + /** + * 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.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"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 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; + } + 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.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"; + 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.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"]); + 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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"]; + 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 {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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 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.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.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[".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.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-gkebackup/protos/protos.json b/packages/google-cloud-gkebackup/protos/protos.json new file mode 100644 index 00000000000..f2808929ccc --- /dev/null +++ b/packages/google-cloud-gkebackup/protos/protos.json @@ -0,0 +1,3629 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "gkebackup": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.GkeBackup.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/gkebackup/v1;gkebackup", + "java_multiple_files": true, + "java_outer_classname": "VolumeProto", + "java_package": "com.google.cloud.gkebackup.v1", + "php_namespace": "Google\\Cloud\\GkeBackup\\V1", + "ruby_package": "Google::Cloud::GkeBackup::V1", + "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKey", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" + }, + "nested": { + "Backup": { + "options": { + "(google.api.resource).type": "gkebackup.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlans/{backup_plan}/backups/{backup}" + }, + "oneofs": { + "backupScope": { + "oneof": [ + "allNamespaces", + "selectedNamespaces", + "selectedApplications" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "manual": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "deleteLockDays": { + "type": "int32", + "id": 7 + }, + "deleteLockExpireTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "retainDays": { + "type": "int32", + "id": 9 + }, + "retainExpireTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionKey": { + "type": "EncryptionKey", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "allNamespaces": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "selectedNamespaces": { + "type": "Namespaces", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "selectedApplications": { + "type": "NamespacedNames", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "containsVolumeData": { + "type": "bool", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "containsSecrets": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterMetadata": { + "type": "ClusterMetadata", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateReason": { + "type": "string", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceCount": { + "type": "int32", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "volumeCount": { + "type": "int32", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sizeBytes": { + "type": "int64", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 25 + }, + "podCount": { + "type": "int32", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "configBackupSizeBytes": { + "type": "int64", + "id": 27, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ClusterMetadata": { + "oneofs": { + "platformVersion": { + "oneof": [ + "gkeVersion", + "anthosVersion" + ] + } + }, + "fields": { + "cluster": { + "type": "string", + "id": 1 + }, + "k8sVersion": { + "type": "string", + "id": 2 + }, + "backupCrdVersions": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "gkeVersion": { + "type": "string", + "id": 4 + }, + "anthosVersion": { + "type": "string", + "id": 5 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "IN_PROGRESS": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "DELETING": 5 + } + } + } + }, + "Namespaces": { + "fields": { + "namespaces": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "NamespacedName": { + "fields": { + "namespace": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + }, + "NamespacedNames": { + "fields": { + "namespacedNames": { + "rule": "repeated", + "type": "NamespacedName", + "id": 1 + } + } + }, + "EncryptionKey": { + "fields": { + "gcpKmsEncryptionKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + } + }, + "BackupPlan": { + "options": { + "(google.api.resource).type": "gkebackup.googleapis.com/BackupPlan", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlans/{backup_plan}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 5 + }, + "cluster": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "container.googleapis.com/Cluster" + } + }, + "retentionPolicy": { + "type": "RetentionPolicy", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "backupSchedule": { + "type": "Schedule", + "id": 9 + }, + "etag": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deactivated": { + "type": "bool", + "id": 11 + }, + "backupConfig": { + "type": "BackupConfig", + "id": 12 + }, + "protectedPodCount": { + "type": "int32", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "RetentionPolicy": { + "fields": { + "backupDeleteLockDays": { + "type": "int32", + "id": 1 + }, + "backupRetainDays": { + "type": "int32", + "id": 2 + }, + "locked": { + "type": "bool", + "id": 3 + } + } + }, + "Schedule": { + "fields": { + "cronSchedule": { + "type": "string", + "id": 1 + }, + "paused": { + "type": "bool", + "id": 2 + } + } + }, + "BackupConfig": { + "oneofs": { + "backupScope": { + "oneof": [ + "allNamespaces", + "selectedNamespaces", + "selectedApplications" + ] + } + }, + "fields": { + "allNamespaces": { + "type": "bool", + "id": 1 + }, + "selectedNamespaces": { + "type": "Namespaces", + "id": 2 + }, + "selectedApplications": { + "type": "NamespacedNames", + "id": 3 + }, + "includeVolumeData": { + "type": "bool", + "id": 4 + }, + "includeSecrets": { + "type": "bool", + "id": 5 + }, + "encryptionKey": { + "type": "EncryptionKey", + "id": 6 + } + } + } + } + }, + "BackupForGKE": { + "options": { + "(google.api.default_host)": "gkebackup.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "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" + } + } + ] + }, + "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" + } + ] + }, + "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" + } + ] + }, + "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" + } + } + ] + }, + "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" + } + } + ] + }, + "CreateBackup": { + "requestType": "CreateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/backupPlans/*}/backups", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "parent,backup,backup_id", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/backupPlans/*}/backups", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "parent,backup,backup_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupPlans/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/backupPlans/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlans/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupPlans/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backup.name=projects/*/locations/*/backupPlans/*/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/*/backupPlans/*/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/*/backupPlans/*/backups/*}", + "(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/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListVolumeBackups": { + "requestType": "ListVolumeBackupsRequest", + "responseType": "ListVolumeBackupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupPlans/*/backups/*}/volumeBackups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/backupPlans/*/backups/*}/volumeBackups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetVolumeBackup": { + "requestType": "GetVolumeBackupRequest", + "responseType": "VolumeBackup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateRestorePlan": { + "requestType": "CreateRestorePlanRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/restorePlans", + "(google.api.http).body": "restore_plan", + "(google.api.method_signature)": "parent,restore_plan,restore_plan_id", + "(google.longrunning.operation_info).response_type": "RestorePlan", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/restorePlans", + "body": "restore_plan" + } + }, + { + "(google.api.method_signature)": "parent,restore_plan,restore_plan_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RestorePlan", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListRestorePlans": { + "requestType": "ListRestorePlansRequest", + "responseType": "ListRestorePlansResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/restorePlans", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/restorePlans" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetRestorePlan": { + "requestType": "GetRestorePlanRequest", + "responseType": "RestorePlan", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/restorePlans/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/restorePlans/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateRestorePlan": { + "requestType": "UpdateRestorePlanRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{restore_plan.name=projects/*/locations/*/restorePlans/*}", + "(google.api.http).body": "restore_plan", + "(google.api.method_signature)": "restore_plan,update_mask", + "(google.longrunning.operation_info).response_type": "RestorePlan", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{restore_plan.name=projects/*/locations/*/restorePlans/*}", + "body": "restore_plan" + } + }, + { + "(google.api.method_signature)": "restore_plan,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RestorePlan", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteRestorePlan": { + "requestType": "DeleteRestorePlanRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/restorePlans/*}", + "(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/*/restorePlans/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateRestore": { + "requestType": "CreateRestoreRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/restorePlans/*}/restores", + "(google.api.http).body": "restore", + "(google.api.method_signature)": "parent,restore,restore_id", + "(google.longrunning.operation_info).response_type": "Restore", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/restorePlans/*}/restores", + "body": "restore" + } + }, + { + "(google.api.method_signature)": "parent,restore,restore_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Restore", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListRestores": { + "requestType": "ListRestoresRequest", + "responseType": "ListRestoresResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/restorePlans/*}/restores", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/restorePlans/*}/restores" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetRestore": { + "requestType": "GetRestoreRequest", + "responseType": "Restore", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateRestore": { + "requestType": "UpdateRestoreRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{restore.name=projects/*/locations/*/restorePlans/*/restores/*}", + "(google.api.http).body": "restore", + "(google.api.method_signature)": "restore,update_mask", + "(google.longrunning.operation_info).response_type": "Restore", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{restore.name=projects/*/locations/*/restorePlans/*/restores/*}", + "body": "restore" + } + }, + { + "(google.api.method_signature)": "restore,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Restore", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteRestore": { + "requestType": "DeleteRestoreRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*}", + "(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/*/restorePlans/*/restores/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListVolumeRestores": { + "requestType": "ListVolumeRestoresRequest", + "responseType": "ListVolumeRestoresResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/restorePlans/*/restores/*}/volumeRestores", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/restorePlans/*/restores/*}/volumeRestores" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetVolumeRestore": { + "requestType": "GetVolumeRestoreRequest", + "responseType": "VolumeRestore", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "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" + } + } + } + }, + "CreateBackupPlanRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "backupPlan": { + "type": "BackupPlan", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupPlanId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListBackupPlansRequest": { + "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 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "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": "gkebackup.googleapis.com/BackupPlan" + } + } + } + }, + "UpdateBackupPlanRequest": { + "fields": { + "backupPlan": { + "type": "BackupPlan", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteBackupPlanRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/BackupPlan" + } + }, + "etag": { + "type": "string", + "id": 2 + } + } + }, + "CreateBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/BackupPlan" + } + }, + "backup": { + "type": "Backup", + "id": 2 + }, + "backupId": { + "type": "string", + "id": 3 + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/BackupPlan" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/Backup" + } + } + } + }, + "UpdateBackupRequest": { + "fields": { + "backup": { + "type": "Backup", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/Backup" + } + }, + "etag": { + "type": "string", + "id": 2 + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "ListVolumeBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/Backup" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListVolumeBackupsResponse": { + "fields": { + "volumeBackups": { + "rule": "repeated", + "type": "VolumeBackup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetVolumeBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/VolumeBackup" + } + } + } + }, + "CreateRestorePlanRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "restorePlan": { + "type": "RestorePlan", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "restorePlanId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRestorePlansRequest": { + "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 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListRestorePlansResponse": { + "fields": { + "restorePlans": { + "rule": "repeated", + "type": "RestorePlan", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetRestorePlanRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/RestorePlan" + } + } + } + }, + "UpdateRestorePlanRequest": { + "fields": { + "restorePlan": { + "type": "RestorePlan", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteRestorePlanRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/RestorePlan" + } + }, + "etag": { + "type": "string", + "id": 2 + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "CreateRestoreRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/RestorePlan" + } + }, + "restore": { + "type": "Restore", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "restoreId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRestoresRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/RestorePlan" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListRestoresResponse": { + "fields": { + "restores": { + "rule": "repeated", + "type": "Restore", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetRestoreRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/Restore" + } + } + } + }, + "UpdateRestoreRequest": { + "fields": { + "restore": { + "type": "Restore", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteRestoreRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/Restore" + } + }, + "etag": { + "type": "string", + "id": 2 + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "ListVolumeRestoresRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/Restore" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListVolumeRestoresResponse": { + "fields": { + "volumeRestores": { + "rule": "repeated", + "type": "VolumeRestore", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetVolumeRestoreRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/VolumeRestore" + } + } + } + }, + "Restore": { + "options": { + "(google.api.resource).type": "gkebackup.googleapis.com/Restore", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 5 + }, + "backup": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/Backup" + } + }, + "cluster": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "container.googleapis.com/Cluster" + } + }, + "restoreConfig": { + "type": "RestoreConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + }, + "state": { + "type": "State", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateReason": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourcesRestoredCount": { + "type": "int32", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourcesExcludedCount": { + "type": "int32", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourcesFailedCount": { + "type": "int32", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "volumesRestoredCount": { + "type": "int32", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "IN_PROGRESS": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "DELETING": 5 + } + } + } + }, + "RestoreConfig": { + "oneofs": { + "namespacedResourceRestoreScope": { + "oneof": [ + "allNamespaces", + "selectedNamespaces", + "selectedApplications" + ] + } + }, + "fields": { + "volumeDataRestorePolicy": { + "type": "VolumeDataRestorePolicy", + "id": 1 + }, + "clusterResourceConflictPolicy": { + "type": "ClusterResourceConflictPolicy", + "id": 2 + }, + "namespacedResourceRestoreMode": { + "type": "NamespacedResourceRestoreMode", + "id": 3 + }, + "clusterResourceRestoreScope": { + "type": "ClusterResourceRestoreScope", + "id": 4 + }, + "allNamespaces": { + "type": "bool", + "id": 5 + }, + "selectedNamespaces": { + "type": "Namespaces", + "id": 6 + }, + "selectedApplications": { + "type": "NamespacedNames", + "id": 7 + }, + "substitutionRules": { + "rule": "repeated", + "type": "SubstitutionRule", + "id": 8 + } + }, + "nested": { + "VolumeDataRestorePolicy": { + "values": { + "VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED": 0, + "RESTORE_VOLUME_DATA_FROM_BACKUP": 1, + "REUSE_VOLUME_HANDLE_FROM_BACKUP": 2, + "NO_VOLUME_DATA_RESTORATION": 3 + } + }, + "ClusterResourceConflictPolicy": { + "values": { + "CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED": 0, + "USE_EXISTING_VERSION": 1, + "USE_BACKUP_VERSION": 2 + } + }, + "NamespacedResourceRestoreMode": { + "values": { + "NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED": 0, + "DELETE_AND_RESTORE": 1, + "FAIL_ON_CONFLICT": 2 + } + }, + "GroupKind": { + "fields": { + "resourceGroup": { + "type": "string", + "id": 1 + }, + "resourceKind": { + "type": "string", + "id": 2 + } + } + }, + "ClusterResourceRestoreScope": { + "fields": { + "selectedGroupKinds": { + "rule": "repeated", + "type": "GroupKind", + "id": 1 + } + } + }, + "SubstitutionRule": { + "fields": { + "targetNamespaces": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "targetGroupKinds": { + "rule": "repeated", + "type": "GroupKind", + "id": 2 + }, + "targetJsonPath": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "originalValuePattern": { + "type": "string", + "id": 4 + }, + "newValue": { + "type": "string", + "id": 5 + } + } + } + } + }, + "RestorePlan": { + "options": { + "(google.api.resource).type": "gkebackup.googleapis.com/RestorePlan", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/restorePlans/{restore_plan}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 5 + }, + "backupPlan": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gkebackup.googleapis.com/BackupPlan" + } + }, + "cluster": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "container.googleapis.com/Cluster" + } + }, + "restoreConfig": { + "type": "RestoreConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + }, + "etag": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "VolumeBackup": { + "options": { + "(google.api.resource).type": "gkebackup.googleapis.com/VolumeBackup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlans/{backup_plan}/backups/{backup}/volumeBackups/{volume_backup}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourcePvc": { + "type": "NamespacedName", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "volumeBackupHandle": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "format": { + "type": "VolumeBackupFormat", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "storageBytes": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "diskSizeBytes": { + "type": "int64", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "VolumeBackupFormat": { + "values": { + "VOLUME_BACKUP_FORMAT_UNSPECIFIED": 0, + "GCE_PERSISTENT_DISK": 1 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "SNAPSHOTTING": 2, + "UPLOADING": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "DELETING": 6 + } + } + } + }, + "VolumeRestore": { + "options": { + "(google.api.resource).type": "gkebackup.googleapis.com/VolumeRestore", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}/volumeRestores/{volume_restore}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "volumeBackup": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetPvc": { + "type": "NamespacedName", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "volumeHandle": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "volumeType": { + "type": "VolumeType", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "VolumeType": { + "values": { + "VOLUME_TYPE_UNSPECIFIED": 0, + "GCE_PERSISTENT_DISK": 1 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "RESTORING": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "DELETING": 5 + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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" + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "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 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup.js new file mode 100644 index 00000000000..3c223ef316e --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_CreateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 within which to create the Backup. + * Format: projects/* /locations/* /backupPlans/* + */ + // const parent = 'abc123' + /** + * The Backup resource to create. + */ + // const backup = {} + /** + * The client-provided short name for the Backup resource. + * This name must: + * - be between 1 and 63 characters long (inclusive) + * - consist of only lower-case ASCII letters, numbers, and dashes + * - start with a lower-case letter + * - end with a lower-case letter or number + * - be unique within the set of Backups in this BackupPlan + */ + // const backupId = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callCreateBackup() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await gkebackupClient.createBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackup(); + // [END gkebackup_v1_generated_BackupForGKE_CreateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup_plan.js new file mode 100644 index 00000000000..d7f167d8a03 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup_plan.js @@ -0,0 +1,79 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, backupPlan, backupPlanId) { + // [START gkebackup_v1_generated_BackupForGKE_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 location within which to create the BackupPlan. + * Format: projects/* /locations/* + */ + // const parent = 'abc123' + /** + * Required. The BackupPlan resource object to create. + */ + // const backupPlan = {} + /** + * Required. The client-provided short name for the BackupPlan resource. + * This name must: + * - be between 1 and 63 characters long (inclusive) + * - consist of only lower-case ASCII letters, numbers, and dashes + * - start with a lower-case letter + * - end with a lower-case letter or number + * - be unique within the set of BackupPlans in this location + */ + // const backupPlanId = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callCreateBackupPlan() { + // Construct request + const request = { + parent, + backupPlan, + backupPlanId, + }; + + // Run request + const [operation] = await gkebackupClient.createBackupPlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackupPlan(); + // [END gkebackup_v1_generated_BackupForGKE_CreateBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore.js new file mode 100644 index 00000000000..dfc867379f3 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore.js @@ -0,0 +1,79 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, restore, restoreId) { + // [START gkebackup_v1_generated_BackupForGKE_CreateRestore_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 RestorePlan within which to create the Restore. + * Format: projects/* /locations/* /restorePlans/* + */ + // const parent = 'abc123' + /** + * Required. The restore resource to create. + */ + // const restore = {} + /** + * Required. The client-provided short name for the Restore resource. + * This name must: + * - be between 1 and 63 characters long (inclusive) + * - consist of only lower-case ASCII letters, numbers, and dashes + * - start with a lower-case letter + * - end with a lower-case letter or number + * - be unique within the set of Restores in this RestorePlan. + */ + // const restoreId = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callCreateRestore() { + // Construct request + const request = { + parent, + restore, + restoreId, + }; + + // Run request + const [operation] = await gkebackupClient.createRestore(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateRestore(); + // [END gkebackup_v1_generated_BackupForGKE_CreateRestore_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore_plan.js new file mode 100644 index 00000000000..894663fffc8 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore_plan.js @@ -0,0 +1,79 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, restorePlan, restorePlanId) { + // [START gkebackup_v1_generated_BackupForGKE_CreateRestorePlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location within which to create the RestorePlan. + * Format: projects/* /locations/* + */ + // const parent = 'abc123' + /** + * Required. The RestorePlan resource object to create. + */ + // const restorePlan = {} + /** + * Required. The client-provided short name for the RestorePlan resource. + * This name must: + * - be between 1 and 63 characters long (inclusive) + * - consist of only lower-case ASCII letters, numbers, and dashes + * - start with a lower-case letter + * - end with a lower-case letter or number + * - be unique within the set of RestorePlans in this location + */ + // const restorePlanId = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callCreateRestorePlan() { + // Construct request + const request = { + parent, + restorePlan, + restorePlanId, + }; + + // Run request + const [operation] = await gkebackupClient.createRestorePlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateRestorePlan(); + // [END gkebackup_v1_generated_BackupForGKE_CreateRestorePlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup.js new file mode 100644 index 00000000000..db777c991ea --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_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 Backup resource. + * Format: projects/* /locations/* /backupPlans/* /backups/* + */ + // const name = 'abc123' + /** + * If provided, this value must match the current value of the + * target Backup's etag google.cloud.gkebackup.v1.Backup.etag field or the request is + * rejected. + */ + // const etag = 'abc123' + /** + * If set to true, any VolumeBackups below this Backup will also be deleted. + * Otherwise, the request will only succeed if the Backup has no + * VolumeBackups. + */ + // const force = true + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callDeleteBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gkebackupClient.deleteBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackup(); + // [END gkebackup_v1_generated_BackupForGKE_DeleteBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js new file mode 100644 index 00000000000..4df779773bc --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_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. Fully qualified BackupPlan name. + * Format: projects/* /locations/* /backupPlans/* + */ + // const name = 'abc123' + /** + * If provided, this value must match the current value of the + * target BackupPlan's etag google.cloud.gkebackup.v1.BackupPlan.etag field or the request is + * rejected. + */ + // const etag = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callDeleteBackupPlan() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gkebackupClient.deleteBackupPlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackupPlan(); + // [END gkebackup_v1_generated_BackupForGKE_DeleteBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore.js new file mode 100644 index 00000000000..71daffe04aa --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_DeleteRestore_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full name of the Restore + * Format: projects/* /locations/* /restorePlans/* /restores/* + */ + // const name = 'abc123' + /** + * If provided, this value must match the current value of the + * target Restore's etag google.cloud.gkebackup.v1.Restore.etag field or the request is + * rejected. + */ + // const etag = 'abc123' + /** + * If set to true, any VolumeRestores below this restore will also be deleted. + * Otherwise, the request will only succeed if the restore has no + * VolumeRestores. + */ + // const force = true + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callDeleteRestore() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gkebackupClient.deleteRestore(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteRestore(); + // [END gkebackup_v1_generated_BackupForGKE_DeleteRestore_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js new file mode 100644 index 00000000000..e6d9b0b529c --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_DeleteRestorePlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Fully qualified RestorePlan name. + * Format: projects/* /locations/* /restorePlans/* + */ + // const name = 'abc123' + /** + * If provided, this value must match the current value of the + * target RestorePlan's etag google.cloud.gkebackup.v1.RestorePlan.etag field or the request is + * rejected. + */ + // const etag = 'abc123' + /** + * If set to true, any Restores below this RestorePlan will also be deleted. + * Otherwise, the request will only succeed if the RestorePlan has no + * Restores. + */ + // const force = true + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callDeleteRestorePlan() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gkebackupClient.deleteRestorePlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteRestorePlan(); + // [END gkebackup_v1_generated_BackupForGKE_DeleteRestorePlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup.js new file mode 100644 index 00000000000..87fd8c8a000 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_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. Full name of the Backup resource. + * Format: projects/* /locations/* /backupPlans/* /backups/* + */ + // const name = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callGetBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gkebackupClient.getBackup(request); + console.log(response); + } + + callGetBackup(); + // [END gkebackup_v1_generated_BackupForGKE_GetBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup_plan.js new file mode 100644 index 00000000000..cb2bb95e3cf --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup_plan.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_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. Fully qualified BackupPlan name. + * Format: projects/* /locations/* /backupPlans/* + */ + // const name = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callGetBackupPlan() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gkebackupClient.getBackupPlan(request); + console.log(response); + } + + callGetBackupPlan(); + // [END gkebackup_v1_generated_BackupForGKE_GetBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore.js new file mode 100644 index 00000000000..9834eca9ec7 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_GetRestore_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 restore resource. + * Format: projects/* /locations/* /restorePlans/* /restores/* + */ + // const name = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callGetRestore() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gkebackupClient.getRestore(request); + console.log(response); + } + + callGetRestore(); + // [END gkebackup_v1_generated_BackupForGKE_GetRestore_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore_plan.js new file mode 100644 index 00000000000..a5c14347783 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore_plan.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_GetRestorePlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Fully qualified RestorePlan name. + * Format: projects/* /locations/* /restorePlans/* + */ + // const name = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callGetRestorePlan() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gkebackupClient.getRestorePlan(request); + console.log(response); + } + + callGetRestorePlan(); + // [END gkebackup_v1_generated_BackupForGKE_GetRestorePlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_backup.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_backup.js new file mode 100644 index 00000000000..ab85c1987dc --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_backup.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_GetVolumeBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full name of the VolumeBackup resource. + * Format: projects/* /locations/* /backupPlans/* /backups/* /volumeBackups/* + */ + // const name = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callGetVolumeBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gkebackupClient.getVolumeBackup(request); + console.log(response); + } + + callGetVolumeBackup(); + // [END gkebackup_v1_generated_BackupForGKE_GetVolumeBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_restore.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_restore.js new file mode 100644 index 00000000000..bbf02a5502c --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_restore.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_GetVolumeRestore_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full name of the VolumeRestore resource. + * Format: projects/* /locations/* /restorePlans/* /restores/* /volumeRestores/* + */ + // const name = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callGetVolumeRestore() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gkebackupClient.getVolumeRestore(request); + console.log(response); + } + + callGetVolumeRestore(); + // [END gkebackup_v1_generated_BackupForGKE_GetVolumeRestore_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backup_plans.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backup_plans.js new file mode 100644 index 00000000000..20df3412acc --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backup_plans.js @@ -0,0 +1,90 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_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 location that contains the BackupPlans to list. + * Format: projects/* /locations/* + */ + // const parent = 'abc123' + /** + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * next_page_token google.cloud.gkebackup.v1.ListBackupPlansResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The value of + * next_page_token google.cloud.gkebackup.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' + /** + * Field match expression used to filter the results. + */ + // const filter = 'abc123' + /** + * Field by which to sort the results. + */ + // const orderBy = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callListBackupPlans() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gkebackupClient.listBackupPlansAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackupPlans(); + // [END gkebackup_v1_generated_BackupForGKE_ListBackupPlans_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backups.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backups.js new file mode 100644 index 00000000000..973b5675260 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backups.js @@ -0,0 +1,90 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_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 BackupPlan that contains the Backups to list. + * Format: projects/* /locations/* /backupPlans/* + */ + // const parent = 'abc123' + /** + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * next_page_token google.cloud.gkebackup.v1.ListBackupsResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The value of + * next_page_token google.cloud.gkebackup.v1.ListBackupsResponse.next_page_token + * received from a previous `ListBackups` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackups` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Field match expression used to filter the results. + */ + // const filter = 'abc123' + /** + * Field by which to sort the results. + */ + // const orderBy = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callListBackups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gkebackupClient.listBackupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackups(); + // [END gkebackup_v1_generated_BackupForGKE_ListBackups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restore_plans.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restore_plans.js new file mode 100644 index 00000000000..f467cb64b7a --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restore_plans.js @@ -0,0 +1,90 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_ListRestorePlans_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location that contains the RestorePlans to list. + * Format: projects/* /locations/* + */ + // const parent = 'abc123' + /** + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * next_page_token google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The value of + * next_page_token google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token + * received from a previous `ListRestorePlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListRestorePlans` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Field match expression used to filter the results. + */ + // const filter = 'abc123' + /** + * Field by which to sort the results. + */ + // const orderBy = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callListRestorePlans() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gkebackupClient.listRestorePlansAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRestorePlans(); + // [END gkebackup_v1_generated_BackupForGKE_ListRestorePlans_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restores.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restores.js new file mode 100644 index 00000000000..c20f252bd56 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restores.js @@ -0,0 +1,90 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_ListRestores_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 RestorePlan that contains the Restores to list. + * Format: projects/* /locations/* /restorePlans/* + */ + // const parent = 'abc123' + /** + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * next_page_token google.cloud.gkebackup.v1.ListRestoresResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The value of + * next_page_token google.cloud.gkebackup.v1.ListRestoresResponse.next_page_token + * received from a previous `ListRestores` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to `ListRestores` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Field match expression used to filter the results. + */ + // const filter = 'abc123' + /** + * Field by which to sort the results. + */ + // const orderBy = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callListRestores() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gkebackupClient.listRestoresAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRestores(); + // [END gkebackup_v1_generated_BackupForGKE_ListRestores_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_backups.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_backups.js new file mode 100644 index 00000000000..627de36e6c5 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_backups.js @@ -0,0 +1,90 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_ListVolumeBackups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 that contains the VolumeBackups to list. + * Format: projects/* /locations/* /backupPlans/* /backups/* + */ + // const parent = 'abc123' + /** + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * next_page_token google.cloud.gkebackup.v1.ListVolumeBackupsResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The value of + * next_page_token google.cloud.gkebackup.v1.ListVolumeBackupsResponse.next_page_token + * received from a previous `ListVolumeBackups` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListVolumeBackups` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Field match expression used to filter the results. + */ + // const filter = 'abc123' + /** + * Field by which to sort the results. + */ + // const orderBy = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callListVolumeBackups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gkebackupClient.listVolumeBackupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListVolumeBackups(); + // [END gkebackup_v1_generated_BackupForGKE_ListVolumeBackups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_restores.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_restores.js new file mode 100644 index 00000000000..fdb49da22bb --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_restores.js @@ -0,0 +1,90 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_ListVolumeRestores_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Restore that contains the VolumeRestores to list. + * Format: projects/* /locations/* /restorePlans/* /restores/* + */ + // const parent = 'abc123' + /** + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * next_page_token google.cloud.gkebackup.v1.ListVolumeRestoresResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The value of + * next_page_token google.cloud.gkebackup.v1.ListVolumeRestoresResponse.next_page_token + * received from a previous `ListVolumeRestores` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListVolumeRestores` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Field match expression used to filter the results. + */ + // const filter = 'abc123' + /** + * Field by which to sort the results. + */ + // const orderBy = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callListVolumeRestores() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gkebackupClient.listVolumeRestoresAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListVolumeRestores(); + // [END gkebackup_v1_generated_BackupForGKE_ListVolumeRestores_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup.js new file mode 100644 index 00000000000..9c02775ef81 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(backup) { + // [START gkebackup_v1_generated_BackupForGKE_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. A new version of the Backup resource that contains updated fields. + * This may be sparsely populated if an `update_mask` is provided. + */ + // const backup = {} + /** + * This is used to specify the fields to be overwritten in the + * Backup targeted for update. The values for each of these + * updated fields will be taken from the `backup_plan` provided + * with this request. Field names are relative to the root of the resource. + * If no `update_mask` is provided, all fields in `backup` will be + * written to the target Backup resource. + * Note that OUTPUT_ONLY and IMMUTABLE fields in `backup` are ignored + * and are not used to update the target Backup. + */ + // const updateMask = {} + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callUpdateBackup() { + // Construct request + const request = { + backup, + }; + + // Run request + const [operation] = await gkebackupClient.updateBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackup(); + // [END gkebackup_v1_generated_BackupForGKE_UpdateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup_plan.js new file mode 100644 index 00000000000..8ef46f1b6a0 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup_plan.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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) { + // [START gkebackup_v1_generated_BackupForGKE_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. A new version of the BackupPlan resource that contains updated fields. + * This may be sparsely populated if an `update_mask` is provided. + */ + // const backupPlan = {} + /** + * This is used to specify the fields to be overwritten in the + * BackupPlan targeted for update. The values for each of these + * updated fields will be taken from the `backup_plan` provided + * with this request. Field names are relative to the root of the resource + * (e.g., `description`, `backup_config.include_volume_data`, etc.) + * If no `update_mask` is provided, all fields in `backup_plan` will be + * written to the target BackupPlan resource. + * Note that OUTPUT_ONLY and IMMUTABLE fields in `backup_plan` are ignored + * and are not used to update the target BackupPlan. + */ + // const updateMask = {} + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callUpdateBackupPlan() { + // Construct request + const request = { + backupPlan, + }; + + // Run request + const [operation] = await gkebackupClient.updateBackupPlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackupPlan(); + // [END gkebackup_v1_generated_BackupForGKE_UpdateBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore.js new file mode 100644 index 00000000000..3fdf31a030e --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(restore) { + // [START gkebackup_v1_generated_BackupForGKE_UpdateRestore_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A new version of the Restore resource that contains updated fields. + * This may be sparsely populated if an `update_mask` is provided. + */ + // const restore = {} + /** + * This is used to specify the fields to be overwritten in the + * Restore targeted for update. The values for each of these + * updated fields will be taken from the `restore` provided + * with this request. Field names are relative to the root of the resource. + * If no `update_mask` is provided, all fields in `restore` will be + * written to the target Restore resource. + * Note that OUTPUT_ONLY and IMMUTABLE fields in `restore` are ignored + * and are not used to update the target Restore. + */ + // const updateMask = {} + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callUpdateRestore() { + // Construct request + const request = { + restore, + }; + + // Run request + const [operation] = await gkebackupClient.updateRestore(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateRestore(); + // [END gkebackup_v1_generated_BackupForGKE_UpdateRestore_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore_plan.js new file mode 100644 index 00000000000..90ecab77485 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore_plan.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(restorePlan) { + // [START gkebackup_v1_generated_BackupForGKE_UpdateRestorePlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A new version of the RestorePlan resource that contains updated fields. + * This may be sparsely populated if an `update_mask` is provided. + */ + // const restorePlan = {} + /** + * This is used to specify the fields to be overwritten in the + * RestorePlan targeted for update. The values for each of these + * updated fields will be taken from the `restore_plan` provided + * with this request. Field names are relative to the root of the resource. + * If no `update_mask` is provided, all fields in `restore_plan` will be + * written to the target RestorePlan resource. + * Note that OUTPUT_ONLY and IMMUTABLE fields in `restore_plan` are ignored + * and are not used to update the target RestorePlan. + */ + // const updateMask = {} + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callUpdateRestorePlan() { + // Construct request + const request = { + restorePlan, + }; + + // Run request + const [operation] = await gkebackupClient.updateRestorePlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateRestorePlan(); + // [END gkebackup_v1_generated_BackupForGKE_UpdateRestorePlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/snippet_metadata.google.cloud.gkebackup.v1.json b/packages/google-cloud-gkebackup/samples/generated/v1/snippet_metadata.google.cloud.gkebackup.v1.json new file mode 100644 index 00000000000..9faeade4f23 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/generated/v1/snippet_metadata.google.cloud.gkebackup.v1.json @@ -0,0 +1,1147 @@ +{ + "clientLibrary": { + "name": "nodejs-gkebackup", + "version": "0.2.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.gkebackup.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_CreateBackupPlan_async", + "title": "BackupForGKE createBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Creates a new BackupPlan in a given location.", + "canonical": true, + "file": "backup_for_g_k_e.create_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateBackupPlan", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan", + "type": ".google.cloud.gkebackup.v1.BackupPlan" + }, + { + "name": "backup_plan_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "CreateBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateBackupPlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListBackupPlans_async", + "title": "BackupForGKE listBackupPlans Sample", + "origin": "API_DEFINITION", + "description": " Lists BackupPlans in a given location.", + "canonical": true, + "file": "backup_for_g_k_e.list_backup_plans.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackupPlans", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.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.gkebackup.v1.ListBackupPlansResponse", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListBackupPlans", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListBackupPlans", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetBackupPlan_async", + "title": "BackupForGKE getBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Retrieve the details of a single BackupPlan.", + "canonical": true, + "file": "backup_for_g_k_e.get_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetBackupPlan", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gkebackup.v1.BackupPlan", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetBackupPlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_UpdateBackupPlan_async", + "title": "BackupForGKE updateBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Update a BackupPlan.", + "canonical": true, + "file": "backup_for_g_k_e.update_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateBackupPlan", + "async": true, + "parameters": [ + { + "name": "backup_plan", + "type": ".google.cloud.gkebackup.v1.BackupPlan" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "UpdateBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateBackupPlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_DeleteBackupPlan_async", + "title": "BackupForGKE deleteBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing BackupPlan.", + "canonical": true, + "file": "backup_for_g_k_e.delete_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteBackupPlan", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "DeleteBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteBackupPlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_CreateBackup_async", + "title": "BackupForGKE createBackup Sample", + "origin": "API_DEFINITION", + "description": " Creates a Backup for the given BackupPlan.", + "canonical": true, + "file": "backup_for_g_k_e.create_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": ".google.cloud.gkebackup.v1.Backup" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateBackup", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListBackups_async", + "title": "BackupForGKE listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists the Backups for a given BackupPlan.", + "canonical": true, + "file": "backup_for_g_k_e.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.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" + } + ], + "resultType": ".google.cloud.gkebackup.v1.ListBackupsResponse", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListBackups", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetBackup_async", + "title": "BackupForGKE getBackup Sample", + "origin": "API_DEFINITION", + "description": " Retrieve the details of a single Backup.", + "canonical": true, + "file": "backup_for_g_k_e.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gkebackup.v1.Backup", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetBackup", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_UpdateBackup_async", + "title": "BackupForGKE updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Update a Backup.", + "canonical": true, + "file": "backup_for_g_k_e.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "backup", + "type": ".google.cloud.gkebackup.v1.Backup" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateBackup", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_DeleteBackup_async", + "title": "BackupForGKE deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing Backup.", + "canonical": true, + "file": "backup_for_g_k_e.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteBackup", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListVolumeBackups_async", + "title": "BackupForGKE listVolumeBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists the VolumeBackups for a given Backup.", + "canonical": true, + "file": "backup_for_g_k_e.list_volume_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListVolumeBackups", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListVolumeBackups", + "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.gkebackup.v1.ListVolumeBackupsResponse", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListVolumeBackups", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListVolumeBackups", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetVolumeBackup_async", + "title": "BackupForGKE getVolumeBackup Sample", + "origin": "API_DEFINITION", + "description": " Retrieve the details of a single VolumeBackup.", + "canonical": true, + "file": "backup_for_g_k_e.get_volume_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetVolumeBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetVolumeBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gkebackup.v1.VolumeBackup", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetVolumeBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetVolumeBackup", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_CreateRestorePlan_async", + "title": "BackupForGKE createRestorePlan Sample", + "origin": "API_DEFINITION", + "description": " Creates a new RestorePlan in a given location.", + "canonical": true, + "file": "backup_for_g_k_e.create_restore_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateRestorePlan", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "restore_plan", + "type": ".google.cloud.gkebackup.v1.RestorePlan" + }, + { + "name": "restore_plan_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "CreateRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateRestorePlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListRestorePlans_async", + "title": "BackupForGKE listRestorePlans Sample", + "origin": "API_DEFINITION", + "description": " Lists RestorePlans in a given location.", + "canonical": true, + "file": "backup_for_g_k_e.list_restore_plans.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRestorePlans", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListRestorePlans", + "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.gkebackup.v1.ListRestorePlansResponse", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListRestorePlans", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListRestorePlans", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetRestorePlan_async", + "title": "BackupForGKE getRestorePlan Sample", + "origin": "API_DEFINITION", + "description": " Retrieve the details of a single RestorePlan.", + "canonical": true, + "file": "backup_for_g_k_e.get_restore_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetRestorePlan", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gkebackup.v1.RestorePlan", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetRestorePlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_UpdateRestorePlan_async", + "title": "BackupForGKE updateRestorePlan Sample", + "origin": "API_DEFINITION", + "description": " Update a RestorePlan.", + "canonical": true, + "file": "backup_for_g_k_e.update_restore_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateRestorePlan", + "async": true, + "parameters": [ + { + "name": "restore_plan", + "type": ".google.cloud.gkebackup.v1.RestorePlan" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "UpdateRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateRestorePlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_DeleteRestorePlan_async", + "title": "BackupForGKE deleteRestorePlan Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing RestorePlan.", + "canonical": true, + "file": "backup_for_g_k_e.delete_restore_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteRestorePlan", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "DeleteRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteRestorePlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_CreateRestore_async", + "title": "BackupForGKE createRestore Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Restore for the given RestorePlan.", + "canonical": true, + "file": "backup_for_g_k_e.create_restore.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateRestore", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "restore", + "type": ".google.cloud.gkebackup.v1.Restore" + }, + { + "name": "restore_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "CreateRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateRestore", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListRestores_async", + "title": "BackupForGKE listRestores Sample", + "origin": "API_DEFINITION", + "description": " Lists the Restores for a given RestorePlan.", + "canonical": true, + "file": "backup_for_g_k_e.list_restores.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRestores", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListRestores", + "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.gkebackup.v1.ListRestoresResponse", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListRestores", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListRestores", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetRestore_async", + "title": "BackupForGKE getRestore Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the details of a single Restore.", + "canonical": true, + "file": "backup_for_g_k_e.get_restore.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetRestore", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gkebackup.v1.Restore", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetRestore", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_UpdateRestore_async", + "title": "BackupForGKE updateRestore Sample", + "origin": "API_DEFINITION", + "description": " Update a Restore.", + "canonical": true, + "file": "backup_for_g_k_e.update_restore.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateRestore", + "async": true, + "parameters": [ + { + "name": "restore", + "type": ".google.cloud.gkebackup.v1.Restore" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "UpdateRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateRestore", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_DeleteRestore_async", + "title": "BackupForGKE deleteRestore Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing Restore.", + "canonical": true, + "file": "backup_for_g_k_e.delete_restore.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteRestore", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "DeleteRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteRestore", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListVolumeRestores_async", + "title": "BackupForGKE listVolumeRestores Sample", + "origin": "API_DEFINITION", + "description": " Lists the VolumeRestores for a given Restore.", + "canonical": true, + "file": "backup_for_g_k_e.list_volume_restores.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListVolumeRestores", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListVolumeRestores", + "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.gkebackup.v1.ListVolumeRestoresResponse", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListVolumeRestores", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListVolumeRestores", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetVolumeRestore_async", + "title": "BackupForGKE getVolumeRestore Sample", + "origin": "API_DEFINITION", + "description": " Retrieve the details of a single VolumeRestore.", + "canonical": true, + "file": "backup_for_g_k_e.get_volume_restore.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetVolumeRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetVolumeRestore", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gkebackup.v1.VolumeRestore", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetVolumeRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetVolumeRestore", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-gkebackup/samples/package.json b/packages/google-cloud-gkebackup/samples/package.json new file mode 100644 index 00000000000..da4aaff26e1 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-gke-backup", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=10" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/gke-backup": "^0.2.2" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^10.0.0" + } +} diff --git a/packages/google-cloud-gkebackup/samples/quickstart.js b/packages/google-cloud-gkebackup/samples/quickstart.js new file mode 100644 index 00000000000..aa1359763f1 --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/quickstart.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 gkebackup_v1_generated_BackupForGKE_ListRestorePlans_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location that contains the RestorePlans to list. + * Format: projects/* /locations/* + */ + // const parent = 'abc123' + /** + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * next_page_token google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The value of + * next_page_token google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token + * received from a previous `ListRestorePlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListRestorePlans` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Field match expression used to filter the results. + */ + // const filter = 'abc123' + /** + * Field by which to sort the results. + */ + // const orderBy = 'abc123' + + // Imports the Gkebackup library + const {BackupForGKEClient} = require('@google-cloud/gke-backup').v1; + + // Instantiates a client + const gkebackupClient = new BackupForGKEClient(); + + async function callListRestorePlans() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gkebackupClient.listRestorePlansAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRestorePlans(); + // [END gkebackup_v1_generated_BackupForGKE_ListRestorePlans_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkebackup/samples/test/quickstart.js b/packages/google-cloud-gkebackup/samples/test/quickstart.js new file mode 100644 index 00000000000..7134569164e --- /dev/null +++ b/packages/google-cloud-gkebackup/samples/test/quickstart.js @@ -0,0 +1,50 @@ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +// eslint-disable-next-line node/no-missing-require +const {BackupForGKEClient} = require('@google-cloud/gke-backup'); +// eslint-disable-next-line no-unused-vars, node/no-missing-require +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new BackupForGKEClient(); + +describe('Quickstart', () => { + //TODO: remove this if not using the projectId + // eslint-disable-next-line no-unused-vars + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync( + `node ./quickstart.js projects/${projectId}/locations/us-central1`, + {cwd} + ); + assert(stdout !== null); + }); +}); diff --git a/packages/google-cloud-gkebackup/src/index.ts b/packages/google-cloud-gkebackup/src/index.ts new file mode 100644 index 00000000000..6c34e859d39 --- /dev/null +++ b/packages/google-cloud-gkebackup/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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 BackupForGKEClient = v1.BackupForGKEClient; +type BackupForGKEClient = v1.BackupForGKEClient; + +export {v1, BackupForGKEClient}; +export default {v1, BackupForGKEClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_client.ts b/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_client.ts new file mode 100644 index 00000000000..ee954ec25c3 --- /dev/null +++ b/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_client.ts @@ -0,0 +1,4822 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/backup_for_g_k_e_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './backup_for_g_k_e_client_config.json'; +const version = require('../../../package.json').version; + +/** + * BackupForGKE allows Kubernetes administrators to configure, execute, and + * manage backup and restore operations for their GKE clusters. + * @class + * @memberof v1 + */ +export class BackupForGKEClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + backupForGKEStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BackupForGKEClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 BackupForGKEClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof BackupForGKEClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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}/backupPlans/{backup_plan}/backups/{backup}' + ), + backupPlanPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlans/{backup_plan}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + restorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}' + ), + restorePlanPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/restorePlans/{restore_plan}' + ), + volumeBackupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlans/{backup_plan}/backups/{backup}/volumeBackups/{volume_backup}' + ), + volumeRestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}/volumeRestores/{volume_restore}' + ), + }; + + // 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 = { + listBackupPlans: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backupPlans' + ), + listBackups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backups' + ), + listVolumeBackups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'volumeBackups' + ), + listRestorePlans: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'restorePlans' + ), + listRestores: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'restores' + ), + listVolumeRestores: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'volumeRestores' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + 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/*/backupPlans/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/backupPlans/*/backups/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/restorePlans/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/restorePlans/*/restores/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/backupPlans/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/backupPlans/*/backups/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/restorePlans/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/restorePlans/*/restores/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/backupPlans/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/backupPlans/*/backups/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/restorePlans/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/restorePlans/*/restores/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*}: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 createBackupPlanResponse = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.BackupPlan' + ) as gax.protobuf.Type; + const createBackupPlanMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateBackupPlanResponse = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.BackupPlan' + ) as gax.protobuf.Type; + const updateBackupPlanMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupPlanResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteBackupPlanMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createBackupResponse = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.Backup' + ) as gax.protobuf.Type; + const createBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateBackupResponse = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.Backup' + ) as gax.protobuf.Type; + const updateBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createRestorePlanResponse = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.RestorePlan' + ) as gax.protobuf.Type; + const createRestorePlanMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateRestorePlanResponse = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.RestorePlan' + ) as gax.protobuf.Type; + const updateRestorePlanMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteRestorePlanResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteRestorePlanMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createRestoreResponse = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.Restore' + ) as gax.protobuf.Type; + const createRestoreMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateRestoreResponse = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.Restore' + ) as gax.protobuf.Type; + const updateRestoreMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteRestoreResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteRestoreMetadata = protoFilesRoot.lookup( + '.google.cloud.gkebackup.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + 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) + ), + createBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupResponse.decode.bind(createBackupResponse), + createBackupMetadata.decode.bind(createBackupMetadata) + ), + 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) + ), + createRestorePlan: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createRestorePlanResponse.decode.bind(createRestorePlanResponse), + createRestorePlanMetadata.decode.bind(createRestorePlanMetadata) + ), + updateRestorePlan: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateRestorePlanResponse.decode.bind(updateRestorePlanResponse), + updateRestorePlanMetadata.decode.bind(updateRestorePlanMetadata) + ), + deleteRestorePlan: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteRestorePlanResponse.decode.bind(deleteRestorePlanResponse), + deleteRestorePlanMetadata.decode.bind(deleteRestorePlanMetadata) + ), + createRestore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createRestoreResponse.decode.bind(createRestoreResponse), + createRestoreMetadata.decode.bind(createRestoreMetadata) + ), + updateRestore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateRestoreResponse.decode.bind(updateRestoreResponse), + updateRestoreMetadata.decode.bind(updateRestoreMetadata) + ), + deleteRestore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteRestoreResponse.decode.bind(deleteRestoreResponse), + deleteRestoreMetadata.decode.bind(deleteRestoreMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gkebackup.v1.BackupForGKE', + 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.backupForGKEStub) { + return this.backupForGKEStub; + } + + // Put together the "service stub" for + // google.cloud.gkebackup.v1.BackupForGKE. + this.backupForGKEStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gkebackup.v1.BackupForGKE' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gkebackup.v1.BackupForGKE, + 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 backupForGKEStubMethods = [ + 'createBackupPlan', + 'listBackupPlans', + 'getBackupPlan', + 'updateBackupPlan', + 'deleteBackupPlan', + 'createBackup', + 'listBackups', + 'getBackup', + 'updateBackup', + 'deleteBackup', + 'listVolumeBackups', + 'getVolumeBackup', + 'createRestorePlan', + 'listRestorePlans', + 'getRestorePlan', + 'updateRestorePlan', + 'deleteRestorePlan', + 'createRestore', + 'listRestores', + 'getRestore', + 'updateRestore', + 'deleteRestore', + 'listVolumeRestores', + 'getVolumeRestore', + ]; + for (const methodName of backupForGKEStubMethods) { + const callPromise = this.backupForGKEStub.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.backupForGKEStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'gkebackup.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'gkebackup.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Retrieve the details of a single BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Fully qualified BackupPlan name. + * Format: projects/* /locations/* /backupPlans/* + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BackupPlan]{@link google.cloud.gkebackup.v1.BackupPlan}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.get_backup_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_GetBackupPlan_async + */ + getBackupPlan( + request?: protos.google.cloud.gkebackup.v1.IGetBackupPlanRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IGetBackupPlanRequest | undefined, + {} | undefined + ] + >; + getBackupPlan( + request: protos.google.cloud.gkebackup.v1.IGetBackupPlanRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IGetBackupPlanRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackupPlan( + request: protos.google.cloud.gkebackup.v1.IGetBackupPlanRequest, + callback: Callback< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IGetBackupPlanRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackupPlan( + request?: protos.google.cloud.gkebackup.v1.IGetBackupPlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gkebackup.v1.IBackupPlan, + | protos.google.cloud.gkebackup.v1.IGetBackupPlanRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IGetBackupPlanRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.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(); + return this.innerApiCalls.getBackupPlan(request, options, callback); + } + /** + * Retrieve the details of a single Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Full name of the Backup resource. + * Format: projects/* /locations/* /backupPlans/* /backups/* + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Backup]{@link google.cloud.gkebackup.v1.Backup}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.get_backup.js + * region_tag:gkebackup_v1_generated_BackupForGKE_GetBackup_async + */ + getBackup( + request?: protos.google.cloud.gkebackup.v1.IGetBackupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IGetBackupRequest | undefined, + {} | undefined + ] + >; + getBackup( + request: protos.google.cloud.gkebackup.v1.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackup( + request: protos.google.cloud.gkebackup.v1.IGetBackupRequest, + callback: Callback< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackup( + request?: protos.google.cloud.gkebackup.v1.IGetBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.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(); + return this.innerApiCalls.getBackup(request, options, callback); + } + /** + * Retrieve the details of a single VolumeBackup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Full name of the VolumeBackup resource. + * Format: projects/* /locations/* /backupPlans/* /backups/* /volumeBackups/* + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [VolumeBackup]{@link google.cloud.gkebackup.v1.VolumeBackup}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.get_volume_backup.js + * region_tag:gkebackup_v1_generated_BackupForGKE_GetVolumeBackup_async + */ + getVolumeBackup( + request?: protos.google.cloud.gkebackup.v1.IGetVolumeBackupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IVolumeBackup, + protos.google.cloud.gkebackup.v1.IGetVolumeBackupRequest | undefined, + {} | undefined + ] + >; + getVolumeBackup( + request: protos.google.cloud.gkebackup.v1.IGetVolumeBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gkebackup.v1.IVolumeBackup, + | protos.google.cloud.gkebackup.v1.IGetVolumeBackupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVolumeBackup( + request: protos.google.cloud.gkebackup.v1.IGetVolumeBackupRequest, + callback: Callback< + protos.google.cloud.gkebackup.v1.IVolumeBackup, + | protos.google.cloud.gkebackup.v1.IGetVolumeBackupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVolumeBackup( + request?: protos.google.cloud.gkebackup.v1.IGetVolumeBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gkebackup.v1.IVolumeBackup, + | protos.google.cloud.gkebackup.v1.IGetVolumeBackupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gkebackup.v1.IVolumeBackup, + | protos.google.cloud.gkebackup.v1.IGetVolumeBackupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IVolumeBackup, + protos.google.cloud.gkebackup.v1.IGetVolumeBackupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getVolumeBackup(request, options, callback); + } + /** + * Retrieve the details of a single RestorePlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Fully qualified RestorePlan name. + * Format: projects/* /locations/* /restorePlans/* + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RestorePlan]{@link google.cloud.gkebackup.v1.RestorePlan}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.get_restore_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_GetRestorePlan_async + */ + getRestorePlan( + request?: protos.google.cloud.gkebackup.v1.IGetRestorePlanRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IGetRestorePlanRequest | undefined, + {} | undefined + ] + >; + getRestorePlan( + request: protos.google.cloud.gkebackup.v1.IGetRestorePlanRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gkebackup.v1.IRestorePlan, + | protos.google.cloud.gkebackup.v1.IGetRestorePlanRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRestorePlan( + request: protos.google.cloud.gkebackup.v1.IGetRestorePlanRequest, + callback: Callback< + protos.google.cloud.gkebackup.v1.IRestorePlan, + | protos.google.cloud.gkebackup.v1.IGetRestorePlanRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRestorePlan( + request?: protos.google.cloud.gkebackup.v1.IGetRestorePlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gkebackup.v1.IRestorePlan, + | protos.google.cloud.gkebackup.v1.IGetRestorePlanRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gkebackup.v1.IRestorePlan, + | protos.google.cloud.gkebackup.v1.IGetRestorePlanRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IGetRestorePlanRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getRestorePlan(request, options, callback); + } + /** + * Retrieves the details of a single Restore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the restore resource. + * Format: projects/* /locations/* /restorePlans/* /restores/* + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Restore]{@link google.cloud.gkebackup.v1.Restore}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.get_restore.js + * region_tag:gkebackup_v1_generated_BackupForGKE_GetRestore_async + */ + getRestore( + request?: protos.google.cloud.gkebackup.v1.IGetRestoreRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IGetRestoreRequest | undefined, + {} | undefined + ] + >; + getRestore( + request: protos.google.cloud.gkebackup.v1.IGetRestoreRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IGetRestoreRequest | null | undefined, + {} | null | undefined + > + ): void; + getRestore( + request: protos.google.cloud.gkebackup.v1.IGetRestoreRequest, + callback: Callback< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IGetRestoreRequest | null | undefined, + {} | null | undefined + > + ): void; + getRestore( + request?: protos.google.cloud.gkebackup.v1.IGetRestoreRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gkebackup.v1.IRestore, + | protos.google.cloud.gkebackup.v1.IGetRestoreRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IGetRestoreRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IGetRestoreRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getRestore(request, options, callback); + } + /** + * Retrieve the details of a single VolumeRestore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Full name of the VolumeRestore resource. + * Format: projects/* /locations/* /restorePlans/* /restores/* /volumeRestores/* + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [VolumeRestore]{@link google.cloud.gkebackup.v1.VolumeRestore}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.get_volume_restore.js + * region_tag:gkebackup_v1_generated_BackupForGKE_GetVolumeRestore_async + */ + getVolumeRestore( + request?: protos.google.cloud.gkebackup.v1.IGetVolumeRestoreRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IVolumeRestore, + protos.google.cloud.gkebackup.v1.IGetVolumeRestoreRequest | undefined, + {} | undefined + ] + >; + getVolumeRestore( + request: protos.google.cloud.gkebackup.v1.IGetVolumeRestoreRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gkebackup.v1.IVolumeRestore, + | protos.google.cloud.gkebackup.v1.IGetVolumeRestoreRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVolumeRestore( + request: protos.google.cloud.gkebackup.v1.IGetVolumeRestoreRequest, + callback: Callback< + protos.google.cloud.gkebackup.v1.IVolumeRestore, + | protos.google.cloud.gkebackup.v1.IGetVolumeRestoreRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVolumeRestore( + request?: protos.google.cloud.gkebackup.v1.IGetVolumeRestoreRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gkebackup.v1.IVolumeRestore, + | protos.google.cloud.gkebackup.v1.IGetVolumeRestoreRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gkebackup.v1.IVolumeRestore, + | protos.google.cloud.gkebackup.v1.IGetVolumeRestoreRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IVolumeRestore, + protos.google.cloud.gkebackup.v1.IGetVolumeRestoreRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getVolumeRestore(request, options, callback); + } + + /** + * Creates a new BackupPlan in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location within which to create the BackupPlan. + * Format: projects/* /locations/* + * @param {google.cloud.gkebackup.v1.BackupPlan} request.backupPlan + * Required. The BackupPlan resource object to create. + * @param {string} request.backupPlanId + * Required. The client-provided short name for the BackupPlan resource. + * This name must: + * + * - be between 1 and 63 characters long (inclusive) + * - consist of only lower-case ASCII letters, numbers, and dashes + * - start with a lower-case letter + * - end with a lower-case letter or number + * - be unique within the set of BackupPlans in this 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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.create_backup_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_CreateBackupPlan_async + */ + createBackupPlan( + request?: protos.google.cloud.gkebackup.v1.ICreateBackupPlanRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createBackupPlan( + request: protos.google.cloud.gkebackup.v1.ICreateBackupPlanRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupPlan( + request: protos.google.cloud.gkebackup.v1.ICreateBackupPlanRequest, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupPlan( + request?: protos.google.cloud.gkebackup.v1.ICreateBackupPlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createBackupPlan(request, options, callback); + } + /** + * 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.create_backup_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_CreateBackupPlan_async + */ + async checkCreateBackupPlanProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gkebackup.v1.BackupPlan, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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< + protos.google.cloud.gkebackup.v1.BackupPlan, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Update a BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gkebackup.v1.BackupPlan} request.backupPlan + * Required. A new version of the BackupPlan resource that contains updated fields. + * This may be sparsely populated if an `update_mask` is provided. + * @param {google.protobuf.FieldMask} request.updateMask + * This is used to specify the fields to be overwritten in the + * BackupPlan targeted for update. The values for each of these + * updated fields will be taken from the `backup_plan` provided + * with this request. Field names are relative to the root of the resource + * (e.g., `description`, `backup_config.include_volume_data`, etc.) + * If no `update_mask` is provided, all fields in `backup_plan` will be + * written to the target BackupPlan resource. + * Note that OUTPUT_ONLY and IMMUTABLE fields in `backup_plan` are ignored + * and are not used to update the target BackupPlan. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.update_backup_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_UpdateBackupPlan_async + */ + updateBackupPlan( + request?: protos.google.cloud.gkebackup.v1.IUpdateBackupPlanRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateBackupPlan( + request: protos.google.cloud.gkebackup.v1.IUpdateBackupPlanRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackupPlan( + request: protos.google.cloud.gkebackup.v1.IUpdateBackupPlanRequest, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackupPlan( + request?: protos.google.cloud.gkebackup.v1.IUpdateBackupPlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.updateBackupPlan(request, options, callback); + } + /** + * 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.update_backup_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_UpdateBackupPlan_async + */ + async checkUpdateBackupPlanProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gkebackup.v1.BackupPlan, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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< + protos.google.cloud.gkebackup.v1.BackupPlan, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Deletes an existing BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Fully qualified BackupPlan name. + * Format: projects/* /locations/* /backupPlans/* + * @param {string} request.etag + * If provided, this value must match the current value of the + * target BackupPlan's {@link google.cloud.gkebackup.v1.BackupPlan.etag|etag} field or the request is + * rejected. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_DeleteBackupPlan_async + */ + deleteBackupPlan( + request?: protos.google.cloud.gkebackup.v1.IDeleteBackupPlanRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteBackupPlan( + request: protos.google.cloud.gkebackup.v1.IDeleteBackupPlanRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupPlan( + request: protos.google.cloud.gkebackup.v1.IDeleteBackupPlanRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupPlan( + request?: protos.google.cloud.gkebackup.v1.IDeleteBackupPlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteBackupPlan(request, options, callback); + } + /** + * 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_DeleteBackupPlan_async + */ + async checkDeleteBackupPlanProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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< + protos.google.protobuf.Empty, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Creates a Backup for the given BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The BackupPlan within which to create the Backup. + * Format: projects/* /locations/* /backupPlans/* + * @param {google.cloud.gkebackup.v1.Backup} request.backup + * The Backup resource to create. + * @param {string} request.backupId + * The client-provided short name for the Backup resource. + * This name must: + * + * - be between 1 and 63 characters long (inclusive) + * - consist of only lower-case ASCII letters, numbers, and dashes + * - start with a lower-case letter + * - end with a lower-case letter or number + * - be unique within the set of Backups in this BackupPlan + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.create_backup.js + * region_tag:gkebackup_v1_generated_BackupForGKE_CreateBackup_async + */ + createBackup( + request?: protos.google.cloud.gkebackup.v1.ICreateBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createBackup( + request: protos.google.cloud.gkebackup.v1.ICreateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackup( + request: protos.google.cloud.gkebackup.v1.ICreateBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackup( + request?: protos.google.cloud.gkebackup.v1.ICreateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createBackup()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.create_backup.js + * region_tag:gkebackup_v1_generated_BackupForGKE_CreateBackup_async + */ + async checkCreateBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gkebackup.v1.Backup, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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.createBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gkebackup.v1.Backup, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Update a Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gkebackup.v1.Backup} request.backup + * Required. A new version of the Backup resource that contains updated fields. + * This may be sparsely populated if an `update_mask` is provided. + * @param {google.protobuf.FieldMask} request.updateMask + * This is used to specify the fields to be overwritten in the + * Backup targeted for update. The values for each of these + * updated fields will be taken from the `backup_plan` provided + * with this request. Field names are relative to the root of the resource. + * If no `update_mask` is provided, all fields in `backup` will be + * written to the target Backup resource. + * Note that OUTPUT_ONLY and IMMUTABLE fields in `backup` are ignored + * and are not used to update the target Backup. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.update_backup.js + * region_tag:gkebackup_v1_generated_BackupForGKE_UpdateBackup_async + */ + updateBackup( + request?: protos.google.cloud.gkebackup.v1.IUpdateBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateBackup( + request: protos.google.cloud.gkebackup.v1.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackup( + request: protos.google.cloud.gkebackup.v1.IUpdateBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackup( + request?: protos.google.cloud.gkebackup.v1.IUpdateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.updateBackup(request, options, callback); + } + /** + * 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.update_backup.js + * region_tag:gkebackup_v1_generated_BackupForGKE_UpdateBackup_async + */ + async checkUpdateBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gkebackup.v1.Backup, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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< + protos.google.cloud.gkebackup.v1.Backup, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Deletes an existing Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the Backup resource. + * Format: projects/* /locations/* /backupPlans/* /backups/* + * @param {string} request.etag + * If provided, this value must match the current value of the + * target Backup's {@link google.cloud.gkebackup.v1.Backup.etag|etag} field or the request is + * rejected. + * @param {boolean} request.force + * If set to true, any VolumeBackups below this Backup will also be deleted. + * Otherwise, the request will only succeed if the Backup has no + * VolumeBackups. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.delete_backup.js + * region_tag:gkebackup_v1_generated_BackupForGKE_DeleteBackup_async + */ + deleteBackup( + request?: protos.google.cloud.gkebackup.v1.IDeleteBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteBackup( + request: protos.google.cloud.gkebackup.v1.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request: protos.google.cloud.gkebackup.v1.IDeleteBackupRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request?: protos.google.cloud.gkebackup.v1.IDeleteBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteBackup(request, options, callback); + } + /** + * 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.delete_backup.js + * region_tag:gkebackup_v1_generated_BackupForGKE_DeleteBackup_async + */ + async checkDeleteBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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< + protos.google.protobuf.Empty, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Creates a new RestorePlan in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location within which to create the RestorePlan. + * Format: projects/* /locations/* + * @param {google.cloud.gkebackup.v1.RestorePlan} request.restorePlan + * Required. The RestorePlan resource object to create. + * @param {string} request.restorePlanId + * Required. The client-provided short name for the RestorePlan resource. + * This name must: + * + * - be between 1 and 63 characters long (inclusive) + * - consist of only lower-case ASCII letters, numbers, and dashes + * - start with a lower-case letter + * - end with a lower-case letter or number + * - be unique within the set of RestorePlans in this 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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.create_restore_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_CreateRestorePlan_async + */ + createRestorePlan( + request?: protos.google.cloud.gkebackup.v1.ICreateRestorePlanRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createRestorePlan( + request: protos.google.cloud.gkebackup.v1.ICreateRestorePlanRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRestorePlan( + request: protos.google.cloud.gkebackup.v1.ICreateRestorePlanRequest, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRestorePlan( + request?: protos.google.cloud.gkebackup.v1.ICreateRestorePlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createRestorePlan(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createRestorePlan()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.create_restore_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_CreateRestorePlan_async + */ + async checkCreateRestorePlanProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gkebackup.v1.RestorePlan, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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.createRestorePlan, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gkebackup.v1.RestorePlan, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Update a RestorePlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gkebackup.v1.RestorePlan} request.restorePlan + * Required. A new version of the RestorePlan resource that contains updated fields. + * This may be sparsely populated if an `update_mask` is provided. + * @param {google.protobuf.FieldMask} request.updateMask + * This is used to specify the fields to be overwritten in the + * RestorePlan targeted for update. The values for each of these + * updated fields will be taken from the `restore_plan` provided + * with this request. Field names are relative to the root of the resource. + * If no `update_mask` is provided, all fields in `restore_plan` will be + * written to the target RestorePlan resource. + * Note that OUTPUT_ONLY and IMMUTABLE fields in `restore_plan` are ignored + * and are not used to update the target RestorePlan. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.update_restore_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_UpdateRestorePlan_async + */ + updateRestorePlan( + request?: protos.google.cloud.gkebackup.v1.IUpdateRestorePlanRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateRestorePlan( + request: protos.google.cloud.gkebackup.v1.IUpdateRestorePlanRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateRestorePlan( + request: protos.google.cloud.gkebackup.v1.IUpdateRestorePlanRequest, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateRestorePlan( + request?: protos.google.cloud.gkebackup.v1.IUpdateRestorePlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + 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({ + 'restore_plan.name': request.restorePlan!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateRestorePlan(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateRestorePlan()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.update_restore_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_UpdateRestorePlan_async + */ + async checkUpdateRestorePlanProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gkebackup.v1.RestorePlan, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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.updateRestorePlan, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gkebackup.v1.RestorePlan, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Deletes an existing RestorePlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Fully qualified RestorePlan name. + * Format: projects/* /locations/* /restorePlans/* + * @param {string} request.etag + * If provided, this value must match the current value of the + * target RestorePlan's {@link google.cloud.gkebackup.v1.RestorePlan.etag|etag} field or the request is + * rejected. + * @param {boolean} request.force + * If set to true, any Restores below this RestorePlan will also be deleted. + * Otherwise, the request will only succeed if the RestorePlan has no + * Restores. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_DeleteRestorePlan_async + */ + deleteRestorePlan( + request?: protos.google.cloud.gkebackup.v1.IDeleteRestorePlanRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteRestorePlan( + request: protos.google.cloud.gkebackup.v1.IDeleteRestorePlanRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRestorePlan( + request: protos.google.cloud.gkebackup.v1.IDeleteRestorePlanRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRestorePlan( + request?: protos.google.cloud.gkebackup.v1.IDeleteRestorePlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteRestorePlan(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteRestorePlan()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js + * region_tag:gkebackup_v1_generated_BackupForGKE_DeleteRestorePlan_async + */ + async checkDeleteRestorePlanProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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.deleteRestorePlan, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Creates a new Restore for the given RestorePlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The RestorePlan within which to create the Restore. + * Format: projects/* /locations/* /restorePlans/* + * @param {google.cloud.gkebackup.v1.Restore} request.restore + * Required. The restore resource to create. + * @param {string} request.restoreId + * Required. The client-provided short name for the Restore resource. + * This name must: + * + * - be between 1 and 63 characters long (inclusive) + * - consist of only lower-case ASCII letters, numbers, and dashes + * - start with a lower-case letter + * - end with a lower-case letter or number + * - be unique within the set of Restores in this RestorePlan. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.create_restore.js + * region_tag:gkebackup_v1_generated_BackupForGKE_CreateRestore_async + */ + createRestore( + request?: protos.google.cloud.gkebackup.v1.ICreateRestoreRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createRestore( + request: protos.google.cloud.gkebackup.v1.ICreateRestoreRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRestore( + request: protos.google.cloud.gkebackup.v1.ICreateRestoreRequest, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRestore( + request?: protos.google.cloud.gkebackup.v1.ICreateRestoreRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createRestore(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createRestore()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.create_restore.js + * region_tag:gkebackup_v1_generated_BackupForGKE_CreateRestore_async + */ + async checkCreateRestoreProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gkebackup.v1.Restore, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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.createRestore, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gkebackup.v1.Restore, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Update a Restore. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gkebackup.v1.Restore} request.restore + * Required. A new version of the Restore resource that contains updated fields. + * This may be sparsely populated if an `update_mask` is provided. + * @param {google.protobuf.FieldMask} request.updateMask + * This is used to specify the fields to be overwritten in the + * Restore targeted for update. The values for each of these + * updated fields will be taken from the `restore` provided + * with this request. Field names are relative to the root of the resource. + * If no `update_mask` is provided, all fields in `restore` will be + * written to the target Restore resource. + * Note that OUTPUT_ONLY and IMMUTABLE fields in `restore` are ignored + * and are not used to update the target Restore. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.update_restore.js + * region_tag:gkebackup_v1_generated_BackupForGKE_UpdateRestore_async + */ + updateRestore( + request?: protos.google.cloud.gkebackup.v1.IUpdateRestoreRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateRestore( + request: protos.google.cloud.gkebackup.v1.IUpdateRestoreRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateRestore( + request: protos.google.cloud.gkebackup.v1.IUpdateRestoreRequest, + callback: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateRestore( + request?: protos.google.cloud.gkebackup.v1.IUpdateRestoreRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + 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({ + 'restore.name': request.restore!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateRestore(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateRestore()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.update_restore.js + * region_tag:gkebackup_v1_generated_BackupForGKE_UpdateRestore_async + */ + async checkUpdateRestoreProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gkebackup.v1.Restore, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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.updateRestore, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gkebackup.v1.Restore, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Deletes an existing Restore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Full name of the Restore + * Format: projects/* /locations/* /restorePlans/* /restores/* + * @param {string} request.etag + * If provided, this value must match the current value of the + * target Restore's {@link google.cloud.gkebackup.v1.Restore.etag|etag} field or the request is + * rejected. + * @param {boolean} request.force + * If set to true, any VolumeRestores below this restore will also be deleted. + * Otherwise, the request will only succeed if the restore has no + * VolumeRestores. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.delete_restore.js + * region_tag:gkebackup_v1_generated_BackupForGKE_DeleteRestore_async + */ + deleteRestore( + request?: protos.google.cloud.gkebackup.v1.IDeleteRestoreRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteRestore( + request: protos.google.cloud.gkebackup.v1.IDeleteRestoreRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRestore( + request: protos.google.cloud.gkebackup.v1.IDeleteRestoreRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRestore( + request?: protos.google.cloud.gkebackup.v1.IDeleteRestoreRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteRestore(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteRestore()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.delete_restore.js + * region_tag:gkebackup_v1_generated_BackupForGKE_DeleteRestore_async + */ + async checkDeleteRestoreProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gkebackup.v1.OperationMetadata + > + > { + 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.deleteRestore, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gkebackup.v1.OperationMetadata + >; + } + /** + * Lists BackupPlans in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location that contains the BackupPlans to list. + * Format: projects/* /locations/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.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 + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [BackupPlan]{@link google.cloud.gkebackup.v1.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listBackupPlans( + request?: protos.google.cloud.gkebackup.v1.IListBackupPlansRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IBackupPlan[], + protos.google.cloud.gkebackup.v1.IListBackupPlansRequest | null, + protos.google.cloud.gkebackup.v1.IListBackupPlansResponse + ] + >; + listBackupPlans( + request: protos.google.cloud.gkebackup.v1.IListBackupPlansRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListBackupPlansRequest, + | protos.google.cloud.gkebackup.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IBackupPlan + > + ): void; + listBackupPlans( + request: protos.google.cloud.gkebackup.v1.IListBackupPlansRequest, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListBackupPlansRequest, + | protos.google.cloud.gkebackup.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IBackupPlan + > + ): void; + listBackupPlans( + request?: protos.google.cloud.gkebackup.v1.IListBackupPlansRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gkebackup.v1.IListBackupPlansRequest, + | protos.google.cloud.gkebackup.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IBackupPlan + >, + callback?: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListBackupPlansRequest, + | protos.google.cloud.gkebackup.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IBackupPlan + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IBackupPlan[], + protos.google.cloud.gkebackup.v1.IListBackupPlansRequest | null, + protos.google.cloud.gkebackup.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(); + return this.innerApiCalls.listBackupPlans(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location that contains the BackupPlans to list. + * Format: projects/* /locations/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.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 + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [BackupPlan]{@link google.cloud.gkebackup.v1.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listBackupPlansStream( + request?: protos.google.cloud.gkebackup.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(); + 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 location that contains the BackupPlans to list. + * Format: projects/* /locations/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.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 + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [BackupPlan]{@link google.cloud.gkebackup.v1.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.list_backup_plans.js + * region_tag:gkebackup_v1_generated_BackupForGKE_ListBackupPlans_async + */ + listBackupPlansAsync( + request?: protos.google.cloud.gkebackup.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(); + return this.descriptors.page.listBackupPlans.asyncIterate( + this.innerApiCalls['listBackupPlans'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the Backups for a given BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The BackupPlan that contains the Backups to list. + * Format: projects/* /locations/* /backupPlans/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListBackupsResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListBackupsResponse.next_page_token|next_page_token} + * received from a previous `ListBackups` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackups` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [Backup]{@link google.cloud.gkebackup.v1.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listBackups( + request?: protos.google.cloud.gkebackup.v1.IListBackupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IBackup[], + protos.google.cloud.gkebackup.v1.IListBackupsRequest | null, + protos.google.cloud.gkebackup.v1.IListBackupsResponse + ] + >; + listBackups( + request: protos.google.cloud.gkebackup.v1.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListBackupsRequest, + protos.google.cloud.gkebackup.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.gkebackup.v1.IBackup + > + ): void; + listBackups( + request: protos.google.cloud.gkebackup.v1.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListBackupsRequest, + protos.google.cloud.gkebackup.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.gkebackup.v1.IBackup + > + ): void; + listBackups( + request?: protos.google.cloud.gkebackup.v1.IListBackupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gkebackup.v1.IListBackupsRequest, + | protos.google.cloud.gkebackup.v1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IBackup + >, + callback?: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListBackupsRequest, + protos.google.cloud.gkebackup.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.gkebackup.v1.IBackup + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IBackup[], + protos.google.cloud.gkebackup.v1.IListBackupsRequest | null, + protos.google.cloud.gkebackup.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(); + return this.innerApiCalls.listBackups(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The BackupPlan that contains the Backups to list. + * Format: projects/* /locations/* /backupPlans/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListBackupsResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListBackupsResponse.next_page_token|next_page_token} + * received from a previous `ListBackups` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackups` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [Backup]{@link google.cloud.gkebackup.v1.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listBackupsStream( + request?: protos.google.cloud.gkebackup.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(); + 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 BackupPlan that contains the Backups to list. + * Format: projects/* /locations/* /backupPlans/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListBackupsResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListBackupsResponse.next_page_token|next_page_token} + * received from a previous `ListBackups` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackups` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Backup]{@link google.cloud.gkebackup.v1.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.list_backups.js + * region_tag:gkebackup_v1_generated_BackupForGKE_ListBackups_async + */ + listBackupsAsync( + request?: protos.google.cloud.gkebackup.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(); + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the VolumeBackups for a given Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Backup that contains the VolumeBackups to list. + * Format: projects/* /locations/* /backupPlans/* /backups/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListVolumeBackupsResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListVolumeBackupsResponse.next_page_token|next_page_token} + * received from a previous `ListVolumeBackups` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListVolumeBackups` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [VolumeBackup]{@link google.cloud.gkebackup.v1.VolumeBackup}. + * 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 `listVolumeBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listVolumeBackups( + request?: protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IVolumeBackup[], + protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest | null, + protos.google.cloud.gkebackup.v1.IListVolumeBackupsResponse + ] + >; + listVolumeBackups( + request: protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest, + | protos.google.cloud.gkebackup.v1.IListVolumeBackupsResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IVolumeBackup + > + ): void; + listVolumeBackups( + request: protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest, + | protos.google.cloud.gkebackup.v1.IListVolumeBackupsResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IVolumeBackup + > + ): void; + listVolumeBackups( + request?: protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest, + | protos.google.cloud.gkebackup.v1.IListVolumeBackupsResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IVolumeBackup + >, + callback?: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest, + | protos.google.cloud.gkebackup.v1.IListVolumeBackupsResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IVolumeBackup + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IVolumeBackup[], + protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest | null, + protos.google.cloud.gkebackup.v1.IListVolumeBackupsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listVolumeBackups(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Backup that contains the VolumeBackups to list. + * Format: projects/* /locations/* /backupPlans/* /backups/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListVolumeBackupsResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListVolumeBackupsResponse.next_page_token|next_page_token} + * received from a previous `ListVolumeBackups` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListVolumeBackups` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [VolumeBackup]{@link google.cloud.gkebackup.v1.VolumeBackup} 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 `listVolumeBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listVolumeBackupsStream( + request?: protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest, + 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['listVolumeBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVolumeBackups.createStream( + this.innerApiCalls.listVolumeBackups as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listVolumeBackups`, 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 Backup that contains the VolumeBackups to list. + * Format: projects/* /locations/* /backupPlans/* /backups/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListVolumeBackupsResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListVolumeBackupsResponse.next_page_token|next_page_token} + * received from a previous `ListVolumeBackups` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListVolumeBackups` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [VolumeBackup]{@link google.cloud.gkebackup.v1.VolumeBackup}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.list_volume_backups.js + * region_tag:gkebackup_v1_generated_BackupForGKE_ListVolumeBackups_async + */ + listVolumeBackupsAsync( + request?: protos.google.cloud.gkebackup.v1.IListVolumeBackupsRequest, + 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['listVolumeBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVolumeBackups.asyncIterate( + this.innerApiCalls['listVolumeBackups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists RestorePlans in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location that contains the RestorePlans to list. + * Format: projects/* /locations/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token|next_page_token} + * received from a previous `ListRestorePlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListRestorePlans` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [RestorePlan]{@link google.cloud.gkebackup.v1.RestorePlan}. + * 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 `listRestorePlansAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRestorePlans( + request?: protos.google.cloud.gkebackup.v1.IListRestorePlansRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IRestorePlan[], + protos.google.cloud.gkebackup.v1.IListRestorePlansRequest | null, + protos.google.cloud.gkebackup.v1.IListRestorePlansResponse + ] + >; + listRestorePlans( + request: protos.google.cloud.gkebackup.v1.IListRestorePlansRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListRestorePlansRequest, + | protos.google.cloud.gkebackup.v1.IListRestorePlansResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IRestorePlan + > + ): void; + listRestorePlans( + request: protos.google.cloud.gkebackup.v1.IListRestorePlansRequest, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListRestorePlansRequest, + | protos.google.cloud.gkebackup.v1.IListRestorePlansResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IRestorePlan + > + ): void; + listRestorePlans( + request?: protos.google.cloud.gkebackup.v1.IListRestorePlansRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gkebackup.v1.IListRestorePlansRequest, + | protos.google.cloud.gkebackup.v1.IListRestorePlansResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IRestorePlan + >, + callback?: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListRestorePlansRequest, + | protos.google.cloud.gkebackup.v1.IListRestorePlansResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IRestorePlan + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IRestorePlan[], + protos.google.cloud.gkebackup.v1.IListRestorePlansRequest | null, + protos.google.cloud.gkebackup.v1.IListRestorePlansResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listRestorePlans(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location that contains the RestorePlans to list. + * Format: projects/* /locations/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token|next_page_token} + * received from a previous `ListRestorePlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListRestorePlans` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [RestorePlan]{@link google.cloud.gkebackup.v1.RestorePlan} 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 `listRestorePlansAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRestorePlansStream( + request?: protos.google.cloud.gkebackup.v1.IListRestorePlansRequest, + 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['listRestorePlans']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRestorePlans.createStream( + this.innerApiCalls.listRestorePlans as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRestorePlans`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location that contains the RestorePlans to list. + * Format: projects/* /locations/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListRestorePlansResponse.next_page_token|next_page_token} + * received from a previous `ListRestorePlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListRestorePlans` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [RestorePlan]{@link google.cloud.gkebackup.v1.RestorePlan}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.list_restore_plans.js + * region_tag:gkebackup_v1_generated_BackupForGKE_ListRestorePlans_async + */ + listRestorePlansAsync( + request?: protos.google.cloud.gkebackup.v1.IListRestorePlansRequest, + 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['listRestorePlans']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRestorePlans.asyncIterate( + this.innerApiCalls['listRestorePlans'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the Restores for a given RestorePlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The RestorePlan that contains the Restores to list. + * Format: projects/* /locations/* /restorePlans/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListRestoresResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListRestoresResponse.next_page_token|next_page_token} + * received from a previous `ListRestores` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to `ListRestores` + * must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [Restore]{@link google.cloud.gkebackup.v1.Restore}. + * 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 `listRestoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRestores( + request?: protos.google.cloud.gkebackup.v1.IListRestoresRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IRestore[], + protos.google.cloud.gkebackup.v1.IListRestoresRequest | null, + protos.google.cloud.gkebackup.v1.IListRestoresResponse + ] + >; + listRestores( + request: protos.google.cloud.gkebackup.v1.IListRestoresRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListRestoresRequest, + protos.google.cloud.gkebackup.v1.IListRestoresResponse | null | undefined, + protos.google.cloud.gkebackup.v1.IRestore + > + ): void; + listRestores( + request: protos.google.cloud.gkebackup.v1.IListRestoresRequest, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListRestoresRequest, + protos.google.cloud.gkebackup.v1.IListRestoresResponse | null | undefined, + protos.google.cloud.gkebackup.v1.IRestore + > + ): void; + listRestores( + request?: protos.google.cloud.gkebackup.v1.IListRestoresRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gkebackup.v1.IListRestoresRequest, + | protos.google.cloud.gkebackup.v1.IListRestoresResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IRestore + >, + callback?: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListRestoresRequest, + protos.google.cloud.gkebackup.v1.IListRestoresResponse | null | undefined, + protos.google.cloud.gkebackup.v1.IRestore + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IRestore[], + protos.google.cloud.gkebackup.v1.IListRestoresRequest | null, + protos.google.cloud.gkebackup.v1.IListRestoresResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listRestores(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The RestorePlan that contains the Restores to list. + * Format: projects/* /locations/* /restorePlans/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListRestoresResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListRestoresResponse.next_page_token|next_page_token} + * received from a previous `ListRestores` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to `ListRestores` + * must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [Restore]{@link google.cloud.gkebackup.v1.Restore} 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 `listRestoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRestoresStream( + request?: protos.google.cloud.gkebackup.v1.IListRestoresRequest, + 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['listRestores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRestores.createStream( + this.innerApiCalls.listRestores as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRestores`, 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 RestorePlan that contains the Restores to list. + * Format: projects/* /locations/* /restorePlans/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListRestoresResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListRestoresResponse.next_page_token|next_page_token} + * received from a previous `ListRestores` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to `ListRestores` + * must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Restore]{@link google.cloud.gkebackup.v1.Restore}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.list_restores.js + * region_tag:gkebackup_v1_generated_BackupForGKE_ListRestores_async + */ + listRestoresAsync( + request?: protos.google.cloud.gkebackup.v1.IListRestoresRequest, + 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['listRestores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRestores.asyncIterate( + this.innerApiCalls['listRestores'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the VolumeRestores for a given Restore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Restore that contains the VolumeRestores to list. + * Format: projects/* /locations/* /restorePlans/* /restores/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListVolumeRestoresResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListVolumeRestoresResponse.next_page_token|next_page_token} + * received from a previous `ListVolumeRestores` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListVolumeRestores` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [VolumeRestore]{@link google.cloud.gkebackup.v1.VolumeRestore}. + * 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 `listVolumeRestoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listVolumeRestores( + request?: protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IVolumeRestore[], + protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest | null, + protos.google.cloud.gkebackup.v1.IListVolumeRestoresResponse + ] + >; + listVolumeRestores( + request: protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest, + | protos.google.cloud.gkebackup.v1.IListVolumeRestoresResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IVolumeRestore + > + ): void; + listVolumeRestores( + request: protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest, + callback: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest, + | protos.google.cloud.gkebackup.v1.IListVolumeRestoresResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IVolumeRestore + > + ): void; + listVolumeRestores( + request?: protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest, + | protos.google.cloud.gkebackup.v1.IListVolumeRestoresResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IVolumeRestore + >, + callback?: PaginationCallback< + protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest, + | protos.google.cloud.gkebackup.v1.IListVolumeRestoresResponse + | null + | undefined, + protos.google.cloud.gkebackup.v1.IVolumeRestore + > + ): Promise< + [ + protos.google.cloud.gkebackup.v1.IVolumeRestore[], + protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest | null, + protos.google.cloud.gkebackup.v1.IListVolumeRestoresResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listVolumeRestores(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Restore that contains the VolumeRestores to list. + * Format: projects/* /locations/* /restorePlans/* /restores/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListVolumeRestoresResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListVolumeRestoresResponse.next_page_token|next_page_token} + * received from a previous `ListVolumeRestores` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListVolumeRestores` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [VolumeRestore]{@link google.cloud.gkebackup.v1.VolumeRestore} 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 `listVolumeRestoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listVolumeRestoresStream( + request?: protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest, + 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['listVolumeRestores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVolumeRestores.createStream( + this.innerApiCalls.listVolumeRestores as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listVolumeRestores`, 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 Restore that contains the VolumeRestores to list. + * Format: projects/* /locations/* /restorePlans/* /restores/* + * @param {number} request.pageSize + * The target number of results to return in a single response. + * If not specified, a default value will be chosen by the service. + * Note that the response may inclue a partial list and a caller should + * only rely on the response's + * {@link google.cloud.gkebackup.v1.ListVolumeRestoresResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The value of + * {@link google.cloud.gkebackup.v1.ListVolumeRestoresResponse.next_page_token|next_page_token} + * received from a previous `ListVolumeRestores` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListVolumeRestores` must match the call that provided the page token. + * @param {string} request.filter + * Field match expression used to filter the results. + * @param {string} request.orderBy + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [VolumeRestore]{@link google.cloud.gkebackup.v1.VolumeRestore}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/backup_for_g_k_e.list_volume_restores.js + * region_tag:gkebackup_v1_generated_BackupForGKE_ListVolumeRestores_async + */ + listVolumeRestoresAsync( + request?: protos.google.cloud.gkebackup.v1.IListVolumeRestoresRequest, + 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['listVolumeRestores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVolumeRestores.asyncIterate( + this.innerApiCalls['listVolumeRestores'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath( + project: string, + location: string, + backupPlan: string, + backup: string + ) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backup_plan: backupPlan, + 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 backup_plan from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup_plan. + */ + matchBackupPlanFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup_plan; + } + + /** + * 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 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 restore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} restore_plan + * @param {string} restore + * @returns {string} Resource name string. + */ + restorePath( + project: string, + location: string, + restorePlan: string, + restore: string + ) { + return this.pathTemplates.restorePathTemplate.render({ + project: project, + location: location, + restore_plan: restorePlan, + restore: restore, + }); + } + + /** + * Parse the project from Restore resource. + * + * @param {string} restoreName + * A fully-qualified path representing Restore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRestoreName(restoreName: string) { + return this.pathTemplates.restorePathTemplate.match(restoreName).project; + } + + /** + * Parse the location from Restore resource. + * + * @param {string} restoreName + * A fully-qualified path representing Restore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRestoreName(restoreName: string) { + return this.pathTemplates.restorePathTemplate.match(restoreName).location; + } + + /** + * Parse the restore_plan from Restore resource. + * + * @param {string} restoreName + * A fully-qualified path representing Restore resource. + * @returns {string} A string representing the restore_plan. + */ + matchRestorePlanFromRestoreName(restoreName: string) { + return this.pathTemplates.restorePathTemplate.match(restoreName) + .restore_plan; + } + + /** + * Parse the restore from Restore resource. + * + * @param {string} restoreName + * A fully-qualified path representing Restore resource. + * @returns {string} A string representing the restore. + */ + matchRestoreFromRestoreName(restoreName: string) { + return this.pathTemplates.restorePathTemplate.match(restoreName).restore; + } + + /** + * Return a fully-qualified restorePlan resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} restore_plan + * @returns {string} Resource name string. + */ + restorePlanPath(project: string, location: string, restorePlan: string) { + return this.pathTemplates.restorePlanPathTemplate.render({ + project: project, + location: location, + restore_plan: restorePlan, + }); + } + + /** + * Parse the project from RestorePlan resource. + * + * @param {string} restorePlanName + * A fully-qualified path representing RestorePlan resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRestorePlanName(restorePlanName: string) { + return this.pathTemplates.restorePlanPathTemplate.match(restorePlanName) + .project; + } + + /** + * Parse the location from RestorePlan resource. + * + * @param {string} restorePlanName + * A fully-qualified path representing RestorePlan resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRestorePlanName(restorePlanName: string) { + return this.pathTemplates.restorePlanPathTemplate.match(restorePlanName) + .location; + } + + /** + * Parse the restore_plan from RestorePlan resource. + * + * @param {string} restorePlanName + * A fully-qualified path representing RestorePlan resource. + * @returns {string} A string representing the restore_plan. + */ + matchRestorePlanFromRestorePlanName(restorePlanName: string) { + return this.pathTemplates.restorePlanPathTemplate.match(restorePlanName) + .restore_plan; + } + + /** + * Return a fully-qualified volumeBackup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan + * @param {string} backup + * @param {string} volume_backup + * @returns {string} Resource name string. + */ + volumeBackupPath( + project: string, + location: string, + backupPlan: string, + backup: string, + volumeBackup: string + ) { + return this.pathTemplates.volumeBackupPathTemplate.render({ + project: project, + location: location, + backup_plan: backupPlan, + backup: backup, + volume_backup: volumeBackup, + }); + } + + /** + * Parse the project from VolumeBackup resource. + * + * @param {string} volumeBackupName + * A fully-qualified path representing VolumeBackup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVolumeBackupName(volumeBackupName: string) { + return this.pathTemplates.volumeBackupPathTemplate.match(volumeBackupName) + .project; + } + + /** + * Parse the location from VolumeBackup resource. + * + * @param {string} volumeBackupName + * A fully-qualified path representing VolumeBackup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVolumeBackupName(volumeBackupName: string) { + return this.pathTemplates.volumeBackupPathTemplate.match(volumeBackupName) + .location; + } + + /** + * Parse the backup_plan from VolumeBackup resource. + * + * @param {string} volumeBackupName + * A fully-qualified path representing VolumeBackup resource. + * @returns {string} A string representing the backup_plan. + */ + matchBackupPlanFromVolumeBackupName(volumeBackupName: string) { + return this.pathTemplates.volumeBackupPathTemplate.match(volumeBackupName) + .backup_plan; + } + + /** + * Parse the backup from VolumeBackup resource. + * + * @param {string} volumeBackupName + * A fully-qualified path representing VolumeBackup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromVolumeBackupName(volumeBackupName: string) { + return this.pathTemplates.volumeBackupPathTemplate.match(volumeBackupName) + .backup; + } + + /** + * Parse the volume_backup from VolumeBackup resource. + * + * @param {string} volumeBackupName + * A fully-qualified path representing VolumeBackup resource. + * @returns {string} A string representing the volume_backup. + */ + matchVolumeBackupFromVolumeBackupName(volumeBackupName: string) { + return this.pathTemplates.volumeBackupPathTemplate.match(volumeBackupName) + .volume_backup; + } + + /** + * Return a fully-qualified volumeRestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} restore_plan + * @param {string} restore + * @param {string} volume_restore + * @returns {string} Resource name string. + */ + volumeRestorePath( + project: string, + location: string, + restorePlan: string, + restore: string, + volumeRestore: string + ) { + return this.pathTemplates.volumeRestorePathTemplate.render({ + project: project, + location: location, + restore_plan: restorePlan, + restore: restore, + volume_restore: volumeRestore, + }); + } + + /** + * Parse the project from VolumeRestore resource. + * + * @param {string} volumeRestoreName + * A fully-qualified path representing VolumeRestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVolumeRestoreName(volumeRestoreName: string) { + return this.pathTemplates.volumeRestorePathTemplate.match(volumeRestoreName) + .project; + } + + /** + * Parse the location from VolumeRestore resource. + * + * @param {string} volumeRestoreName + * A fully-qualified path representing VolumeRestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVolumeRestoreName(volumeRestoreName: string) { + return this.pathTemplates.volumeRestorePathTemplate.match(volumeRestoreName) + .location; + } + + /** + * Parse the restore_plan from VolumeRestore resource. + * + * @param {string} volumeRestoreName + * A fully-qualified path representing VolumeRestore resource. + * @returns {string} A string representing the restore_plan. + */ + matchRestorePlanFromVolumeRestoreName(volumeRestoreName: string) { + return this.pathTemplates.volumeRestorePathTemplate.match(volumeRestoreName) + .restore_plan; + } + + /** + * Parse the restore from VolumeRestore resource. + * + * @param {string} volumeRestoreName + * A fully-qualified path representing VolumeRestore resource. + * @returns {string} A string representing the restore. + */ + matchRestoreFromVolumeRestoreName(volumeRestoreName: string) { + return this.pathTemplates.volumeRestorePathTemplate.match(volumeRestoreName) + .restore; + } + + /** + * Parse the volume_restore from VolumeRestore resource. + * + * @param {string} volumeRestoreName + * A fully-qualified path representing VolumeRestore resource. + * @returns {string} A string representing the volume_restore. + */ + matchVolumeRestoreFromVolumeRestoreName(volumeRestoreName: string) { + return this.pathTemplates.volumeRestorePathTemplate.match(volumeRestoreName) + .volume_restore; + } + + /** + * 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.backupForGKEStub && !this._terminated) { + return this.backupForGKEStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_client_config.json b/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_client_config.json new file mode 100644 index 00000000000..5b662185052 --- /dev/null +++ b/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_client_config.json @@ -0,0 +1,158 @@ +{ + "interfaces": { + "google.cloud.gkebackup.v1.BackupForGKE": { + "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 + }, + "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateBackupPlan": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackupPlans": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackup": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListVolumeBackups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetVolumeBackup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateRestorePlan": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRestorePlans": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetRestorePlan": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateRestorePlan": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteRestorePlan": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateRestore": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRestores": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetRestore": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateRestore": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteRestore": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListVolumeRestores": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetVolumeRestore": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_proto_list.json b/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_proto_list.json new file mode 100644 index 00000000000..30bdfe50d4f --- /dev/null +++ b/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/gkebackup/v1/backup.proto", + "../../protos/google/cloud/gkebackup/v1/backup_plan.proto", + "../../protos/google/cloud/gkebackup/v1/common.proto", + "../../protos/google/cloud/gkebackup/v1/gkebackup.proto", + "../../protos/google/cloud/gkebackup/v1/restore.proto", + "../../protos/google/cloud/gkebackup/v1/restore_plan.proto", + "../../protos/google/cloud/gkebackup/v1/volume.proto" +] diff --git a/packages/google-cloud-gkebackup/src/v1/gapic_metadata.json b/packages/google-cloud-gkebackup/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..f3498121c6e --- /dev/null +++ b/packages/google-cloud-gkebackup/src/v1/gapic_metadata.json @@ -0,0 +1,287 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.gkebackup.v1", + "libraryPackage": "@google-cloud/gke-backup", + "services": { + "BackupForGKE": { + "clients": { + "grpc": { + "libraryClient": "BackupForGKEClient", + "rpcs": { + "GetBackupPlan": { + "methods": [ + "getBackupPlan" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetVolumeBackup": { + "methods": [ + "getVolumeBackup" + ] + }, + "GetRestorePlan": { + "methods": [ + "getRestorePlan" + ] + }, + "GetRestore": { + "methods": [ + "getRestore" + ] + }, + "GetVolumeRestore": { + "methods": [ + "getVolumeRestore" + ] + }, + "CreateBackupPlan": { + "methods": [ + "createBackupPlan" + ] + }, + "UpdateBackupPlan": { + "methods": [ + "updateBackupPlan" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "deleteBackupPlan" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "CreateRestorePlan": { + "methods": [ + "createRestorePlan" + ] + }, + "UpdateRestorePlan": { + "methods": [ + "updateRestorePlan" + ] + }, + "DeleteRestorePlan": { + "methods": [ + "deleteRestorePlan" + ] + }, + "CreateRestore": { + "methods": [ + "createRestore" + ] + }, + "UpdateRestore": { + "methods": [ + "updateRestore" + ] + }, + "DeleteRestore": { + "methods": [ + "deleteRestore" + ] + }, + "ListBackupPlans": { + "methods": [ + "listBackupPlans", + "listBackupPlansStream", + "listBackupPlansAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListVolumeBackups": { + "methods": [ + "listVolumeBackups", + "listVolumeBackupsStream", + "listVolumeBackupsAsync" + ] + }, + "ListRestorePlans": { + "methods": [ + "listRestorePlans", + "listRestorePlansStream", + "listRestorePlansAsync" + ] + }, + "ListRestores": { + "methods": [ + "listRestores", + "listRestoresStream", + "listRestoresAsync" + ] + }, + "ListVolumeRestores": { + "methods": [ + "listVolumeRestores", + "listVolumeRestoresStream", + "listVolumeRestoresAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BackupForGKEClient", + "rpcs": { + "GetBackupPlan": { + "methods": [ + "getBackupPlan" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetVolumeBackup": { + "methods": [ + "getVolumeBackup" + ] + }, + "GetRestorePlan": { + "methods": [ + "getRestorePlan" + ] + }, + "GetRestore": { + "methods": [ + "getRestore" + ] + }, + "GetVolumeRestore": { + "methods": [ + "getVolumeRestore" + ] + }, + "CreateBackupPlan": { + "methods": [ + "createBackupPlan" + ] + }, + "UpdateBackupPlan": { + "methods": [ + "updateBackupPlan" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "deleteBackupPlan" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "CreateRestorePlan": { + "methods": [ + "createRestorePlan" + ] + }, + "UpdateRestorePlan": { + "methods": [ + "updateRestorePlan" + ] + }, + "DeleteRestorePlan": { + "methods": [ + "deleteRestorePlan" + ] + }, + "CreateRestore": { + "methods": [ + "createRestore" + ] + }, + "UpdateRestore": { + "methods": [ + "updateRestore" + ] + }, + "DeleteRestore": { + "methods": [ + "deleteRestore" + ] + }, + "ListBackupPlans": { + "methods": [ + "listBackupPlans", + "listBackupPlansStream", + "listBackupPlansAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListVolumeBackups": { + "methods": [ + "listVolumeBackups", + "listVolumeBackupsStream", + "listVolumeBackupsAsync" + ] + }, + "ListRestorePlans": { + "methods": [ + "listRestorePlans", + "listRestorePlansStream", + "listRestorePlansAsync" + ] + }, + "ListRestores": { + "methods": [ + "listRestores", + "listRestoresStream", + "listRestoresAsync" + ] + }, + "ListVolumeRestores": { + "methods": [ + "listVolumeRestores", + "listVolumeRestoresStream", + "listVolumeRestoresAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-gkebackup/src/v1/index.ts b/packages/google-cloud-gkebackup/src/v1/index.ts new file mode 100644 index 00000000000..47c24ab3f7c --- /dev/null +++ b/packages/google-cloud-gkebackup/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {BackupForGKEClient} from './backup_for_g_k_e_client'; diff --git a/packages/google-cloud-gkebackup/system-test/fixtures/sample/src/index.js b/packages/google-cloud-gkebackup/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..f9fc9c8e79c --- /dev/null +++ b/packages/google-cloud-gkebackup/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 gkebackup = require('@google-cloud/gke-backup'); + +function main() { + const backupForGKEClient = new gkebackup.BackupForGKEClient(); +} + +main(); diff --git a/packages/google-cloud-gkebackup/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-gkebackup/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..1ac5bba1f11 --- /dev/null +++ b/packages/google-cloud-gkebackup/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {BackupForGKEClient} from '@google-cloud/gke-backup'; + +// check that the client class type name can be used +function doStuffWithBackupForGKEClient(client: BackupForGKEClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const backupForGKEClient = new BackupForGKEClient(); + doStuffWithBackupForGKEClient(backupForGKEClient); +} + +main(); diff --git a/packages/google-cloud-gkebackup/system-test/install.ts b/packages/google-cloud-gkebackup/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-gkebackup/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/packages/google-cloud-gkebackup/test/gapic_backup_for_g_k_e_v1.ts b/packages/google-cloud-gkebackup/test/gapic_backup_for_g_k_e_v1.ts new file mode 100644 index 00000000000..8fcaac1979d --- /dev/null +++ b/packages/google-cloud-gkebackup/test/gapic_backup_for_g_k_e_v1.ts @@ -0,0 +1,5784 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 backupforgkeModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.BackupForGKEClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = backupforgkeModule.v1.BackupForGKEClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = backupforgkeModule.v1.BackupForGKEClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = backupforgkeModule.v1.BackupForGKEClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new backupforgkeModule.v1.BackupForGKEClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.backupForGKEStub, undefined); + await client.initialize(); + assert(client.backupForGKEStub); + }); + + it('has close method for the initialized client', done => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.backupForGKEStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.backupForGKEStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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('getBackupPlan', () => { + it('invokes getBackupPlan without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.BackupPlan() + ); + client.innerApiCalls.getBackupPlan = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackupPlan( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackupPlan(request), expectedError); + }); + }); + + describe('getBackup', () => { + it('invokes getBackup without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.Backup() + ); + client.innerApiCalls.getBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackup(request), expectedError); + }); + }); + + describe('getVolumeBackup', () => { + it('invokes getVolumeBackup without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetVolumeBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetVolumeBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ); + client.innerApiCalls.getVolumeBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getVolumeBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVolumeBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVolumeBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVolumeBackup without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetVolumeBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetVolumeBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ); + client.innerApiCalls.getVolumeBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVolumeBackup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.v1.IVolumeBackup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVolumeBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVolumeBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVolumeBackup with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetVolumeBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetVolumeBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVolumeBackup = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getVolumeBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getVolumeBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVolumeBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVolumeBackup with closed client', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetVolumeBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetVolumeBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getVolumeBackup(request), expectedError); + }); + }); + + describe('getRestorePlan', () => { + it('invokes getRestorePlan without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetRestorePlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ); + client.innerApiCalls.getRestorePlan = stubSimpleCall(expectedResponse); + const [response] = await client.getRestorePlan(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRestorePlan without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetRestorePlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ); + client.innerApiCalls.getRestorePlan = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRestorePlan( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.v1.IRestorePlan | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRestorePlan with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetRestorePlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRestorePlan = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRestorePlan(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRestorePlan with closed client', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetRestorePlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRestorePlan(request), expectedError); + }); + }); + + describe('getRestore', () => { + it('invokes getRestore without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.Restore() + ); + client.innerApiCalls.getRestore = stubSimpleCall(expectedResponse); + const [response] = await client.getRestore(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRestore without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.Restore() + ); + client.innerApiCalls.getRestore = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRestore( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.v1.IRestore | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRestore with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRestore = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRestore(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRestore with closed client', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRestore(request), expectedError); + }); + }); + + describe('getVolumeRestore', () => { + it('invokes getVolumeRestore without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetVolumeRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetVolumeRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ); + client.innerApiCalls.getVolumeRestore = stubSimpleCall(expectedResponse); + const [response] = await client.getVolumeRestore(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVolumeRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVolumeRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVolumeRestore without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetVolumeRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetVolumeRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ); + client.innerApiCalls.getVolumeRestore = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVolumeRestore( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.v1.IVolumeRestore | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVolumeRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVolumeRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVolumeRestore with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetVolumeRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetVolumeRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVolumeRestore = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getVolumeRestore(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getVolumeRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVolumeRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVolumeRestore with closed client', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.GetVolumeRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.GetVolumeRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getVolumeRestore(request), expectedError); + }); + }); + + describe('createBackupPlan', () => { + it('invokes createBackupPlan without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + 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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateBackupPlanProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackupPlan', () => { + it('invokes updateBackupPlan without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateBackupPlanRequest() + ); + request.backupPlan ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateBackupPlanRequest() + ); + request.backupPlan ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gkebackup.v1.IBackupPlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + 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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateBackupPlanRequest() + ); + request.backupPlan ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateBackupPlanRequest() + ); + request.backupPlan ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateBackupPlanProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackupPlan', () => { + it('invokes deleteBackupPlan without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + 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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteBackupPlanProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createBackup', () => { + it('invokes createBackup without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with call error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with LRO error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gkebackup.v1.IBackup, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + 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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + 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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createRestorePlan', () => { + it('invokes createRestorePlan without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateRestorePlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRestorePlan = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createRestorePlan(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRestorePlan without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateRestorePlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRestorePlan = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRestorePlan( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRestorePlan with call error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateRestorePlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRestorePlan = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createRestorePlan(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRestorePlan with LRO error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateRestorePlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRestorePlan = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createRestorePlan(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateRestorePlanProgress without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateRestorePlanProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateRestorePlanProgress with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateRestorePlanProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateRestorePlan', () => { + it('invokes updateRestorePlan without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateRestorePlanRequest() + ); + request.restorePlan ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.UpdateRestorePlanRequest', + ['restorePlan', 'name'] + ); + request.restorePlan.name = defaultValue1; + const expectedHeaderRequestParams = `restore_plan.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRestorePlan = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateRestorePlan(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRestorePlan without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateRestorePlanRequest() + ); + request.restorePlan ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.UpdateRestorePlanRequest', + ['restorePlan', 'name'] + ); + request.restorePlan.name = defaultValue1; + const expectedHeaderRequestParams = `restore_plan.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRestorePlan = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRestorePlan( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gkebackup.v1.IRestorePlan, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRestorePlan with call error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateRestorePlanRequest() + ); + request.restorePlan ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.UpdateRestorePlanRequest', + ['restorePlan', 'name'] + ); + request.restorePlan.name = defaultValue1; + const expectedHeaderRequestParams = `restore_plan.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRestorePlan = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateRestorePlan(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRestorePlan with LRO error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateRestorePlanRequest() + ); + request.restorePlan ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.UpdateRestorePlanRequest', + ['restorePlan', 'name'] + ); + request.restorePlan.name = defaultValue1; + const expectedHeaderRequestParams = `restore_plan.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRestorePlan = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateRestorePlan(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateRestorePlanProgress without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateRestorePlanProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateRestorePlanProgress with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateRestorePlanProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteRestorePlan', () => { + it('invokes deleteRestorePlan without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.DeleteRestorePlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRestorePlan = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteRestorePlan(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRestorePlan without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.DeleteRestorePlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRestorePlan = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRestorePlan( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRestorePlan with call error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.DeleteRestorePlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRestorePlan = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteRestorePlan(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRestorePlan with LRO error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteRestorePlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.DeleteRestorePlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRestorePlan = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteRestorePlan(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRestorePlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRestorePlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteRestorePlanProgress without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteRestorePlanProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteRestorePlanProgress with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteRestorePlanProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createRestore', () => { + it('invokes createRestore without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateRestoreRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRestore = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createRestore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRestore without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateRestoreRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRestore = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRestore( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRestore with call error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateRestoreRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRestore = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createRestore(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRestore with LRO error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.CreateRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.CreateRestoreRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRestore = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createRestore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateRestoreProgress without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateRestoreProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateRestoreProgress with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateRestoreProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateRestore', () => { + it('invokes updateRestore without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateRestoreRequest() + ); + request.restore ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.UpdateRestoreRequest', + ['restore', 'name'] + ); + request.restore.name = defaultValue1; + const expectedHeaderRequestParams = `restore.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRestore = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateRestore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRestore without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateRestoreRequest() + ); + request.restore ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.UpdateRestoreRequest', + ['restore', 'name'] + ); + request.restore.name = defaultValue1; + const expectedHeaderRequestParams = `restore.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRestore = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRestore( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gkebackup.v1.IRestore, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRestore with call error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateRestoreRequest() + ); + request.restore ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.UpdateRestoreRequest', + ['restore', 'name'] + ); + request.restore.name = defaultValue1; + const expectedHeaderRequestParams = `restore.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRestore = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateRestore(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRestore with LRO error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.UpdateRestoreRequest() + ); + request.restore ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.UpdateRestoreRequest', + ['restore', 'name'] + ); + request.restore.name = defaultValue1; + const expectedHeaderRequestParams = `restore.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRestore = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateRestore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateRestoreProgress without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateRestoreProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateRestoreProgress with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateRestoreProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteRestore', () => { + it('invokes deleteRestore without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.DeleteRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRestore = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteRestore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRestore without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.DeleteRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRestore = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRestore( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gkebackup.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRestore with call error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.DeleteRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRestore = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteRestore(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRestore with LRO error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.DeleteRestoreRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.DeleteRestoreRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRestore = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteRestore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteRestoreProgress without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteRestoreProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteRestoreProgress with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteRestoreProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listBackupPlans', () => { + it('invokes listBackupPlans without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.BackupPlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.BackupPlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.BackupPlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.BackupPlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.BackupPlan() + ), + ]; + client.innerApiCalls.listBackupPlans = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackupPlans( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.BackupPlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.BackupPlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.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.gkebackup.v1.BackupPlan[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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.gkebackup.v1.BackupPlan[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.BackupPlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.BackupPlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.BackupPlan() + ), + ]; + client.descriptors.page.listBackupPlans.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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.gkebackup.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('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Backup()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Backup()), + generateSampleMessage(new protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Backup()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Backup()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Backup()), + ]; + client.innerApiCalls.listBackups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Backup()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Backup()), + generateSampleMessage(new protos.google.cloud.gkebackup.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.gkebackup.v1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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.gkebackup.v1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Backup()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Backup()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Backup()), + ]; + client.descriptors.page.listBackups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gkebackup.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 backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.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.gkebackup.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('listVolumeBackups', () => { + it('invokes listVolumeBackups without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + ]; + client.innerApiCalls.listVolumeBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listVolumeBackups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVolumeBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVolumeBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVolumeBackups without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + ]; + client.innerApiCalls.listVolumeBackups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVolumeBackups( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.v1.IVolumeBackup[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVolumeBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVolumeBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVolumeBackups with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVolumeBackups = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listVolumeBackups(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listVolumeBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVolumeBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVolumeBackupsStream without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + ]; + client.descriptors.page.listVolumeBackups.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listVolumeBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gkebackup.v1.VolumeBackup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.v1.VolumeBackup) => { + 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.listVolumeBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVolumeBackups, request) + ); + assert( + (client.descriptors.page.listVolumeBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listVolumeBackupsStream with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVolumeBackups.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listVolumeBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gkebackup.v1.VolumeBackup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.v1.VolumeBackup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listVolumeBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVolumeBackups, request) + ); + assert( + (client.descriptors.page.listVolumeBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVolumeBackups without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeBackup() + ), + ]; + client.descriptors.page.listVolumeBackups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gkebackup.v1.IVolumeBackup[] = []; + const iterable = client.listVolumeBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listVolumeBackups.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVolumeBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVolumeBackups with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVolumeBackups.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVolumeBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gkebackup.v1.IVolumeBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listVolumeBackups.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVolumeBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listRestorePlans', () => { + it('invokes listRestorePlans without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestorePlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestorePlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + ]; + client.innerApiCalls.listRestorePlans = stubSimpleCall(expectedResponse); + const [response] = await client.listRestorePlans(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRestorePlans as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRestorePlans as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRestorePlans without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestorePlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestorePlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + ]; + client.innerApiCalls.listRestorePlans = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRestorePlans( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.v1.IRestorePlan[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRestorePlans as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRestorePlans as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRestorePlans with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestorePlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestorePlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRestorePlans = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listRestorePlans(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listRestorePlans as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRestorePlans as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRestorePlansStream without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestorePlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestorePlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + ]; + client.descriptors.page.listRestorePlans.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRestorePlansStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gkebackup.v1.RestorePlan[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.v1.RestorePlan) => { + 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.listRestorePlans.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRestorePlans, request) + ); + assert( + (client.descriptors.page.listRestorePlans.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRestorePlansStream with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestorePlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestorePlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRestorePlans.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRestorePlansStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gkebackup.v1.RestorePlan[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.v1.RestorePlan) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listRestorePlans.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRestorePlans, request) + ); + assert( + (client.descriptors.page.listRestorePlans.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRestorePlans without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestorePlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestorePlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.RestorePlan() + ), + ]; + client.descriptors.page.listRestorePlans.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gkebackup.v1.IRestorePlan[] = []; + const iterable = client.listRestorePlansAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRestorePlans.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRestorePlans.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRestorePlans with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestorePlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestorePlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRestorePlans.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRestorePlansAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gkebackup.v1.IRestorePlan[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRestorePlans.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRestorePlans.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listRestores', () => { + it('invokes listRestores without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + ]; + client.innerApiCalls.listRestores = stubSimpleCall(expectedResponse); + const [response] = await client.listRestores(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRestores without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + ]; + client.innerApiCalls.listRestores = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRestores( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.v1.IRestore[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRestores with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRestores = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listRestores(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listRestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRestoresStream without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + ]; + client.descriptors.page.listRestores.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRestoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gkebackup.v1.Restore[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.v1.Restore) => { + 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.listRestores.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRestores, request) + ); + assert( + (client.descriptors.page.listRestores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRestoresStream with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRestores.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listRestoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gkebackup.v1.Restore[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.v1.Restore) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listRestores.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRestores, request) + ); + assert( + (client.descriptors.page.listRestores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRestores without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + generateSampleMessage(new protos.google.cloud.gkebackup.v1.Restore()), + ]; + client.descriptors.page.listRestores.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gkebackup.v1.IRestore[] = []; + const iterable = client.listRestoresAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRestores.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRestores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRestores with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRestores.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRestoresAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gkebackup.v1.IRestore[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRestores.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRestores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listVolumeRestores', () => { + it('invokes listVolumeRestores without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + ]; + client.innerApiCalls.listVolumeRestores = + stubSimpleCall(expectedResponse); + const [response] = await client.listVolumeRestores(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVolumeRestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVolumeRestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVolumeRestores without error using callback', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + ]; + client.innerApiCalls.listVolumeRestores = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVolumeRestores( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gkebackup.v1.IVolumeRestore[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVolumeRestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVolumeRestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVolumeRestores with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVolumeRestores = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listVolumeRestores(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listVolumeRestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVolumeRestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVolumeRestoresStream without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + ]; + client.descriptors.page.listVolumeRestores.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listVolumeRestoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gkebackup.v1.VolumeRestore[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.v1.VolumeRestore) => { + 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.listVolumeRestores.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVolumeRestores, request) + ); + assert( + (client.descriptors.page.listVolumeRestores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listVolumeRestoresStream with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVolumeRestores.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listVolumeRestoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gkebackup.v1.VolumeRestore[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gkebackup.v1.VolumeRestore) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listVolumeRestores.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVolumeRestores, request) + ); + assert( + (client.descriptors.page.listVolumeRestores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVolumeRestores without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + generateSampleMessage( + new protos.google.cloud.gkebackup.v1.VolumeRestore() + ), + ]; + client.descriptors.page.listVolumeRestores.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gkebackup.v1.IVolumeRestore[] = []; + const iterable = client.listVolumeRestoresAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listVolumeRestores.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVolumeRestores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVolumeRestores with error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gkebackup.v1.ListVolumeRestoresRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gkebackup.v1.ListVolumeRestoresRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVolumeRestores.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVolumeRestoresAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gkebackup.v1.IVolumeRestore[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listVolumeRestores.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVolumeRestores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('backup', () => { + const fakePath = '/rendered/path/backup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backup_plan: 'backupPlanValue', + backup: 'backupValue', + }; + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', + 'backupPlanValue', + '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('matchBackupPlanFromBackupName', () => { + const result = client.matchBackupPlanFromBackupName(fakePath); + assert.strictEqual(result, 'backupPlanValue'); + 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', () => { + const fakePath = '/rendered/path/backupPlan'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backup_plan: 'backupPlanValue', + }; + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('restore', () => { + const fakePath = '/rendered/path/restore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + restore_plan: 'restorePlanValue', + restore: 'restoreValue', + }; + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.restorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.restorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('restorePath', () => { + const result = client.restorePath( + 'projectValue', + 'locationValue', + 'restorePlanValue', + 'restoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.restorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRestoreName', () => { + const result = client.matchProjectFromRestoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.restorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRestoreName', () => { + const result = client.matchLocationFromRestoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.restorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRestorePlanFromRestoreName', () => { + const result = client.matchRestorePlanFromRestoreName(fakePath); + assert.strictEqual(result, 'restorePlanValue'); + assert( + (client.pathTemplates.restorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRestoreFromRestoreName', () => { + const result = client.matchRestoreFromRestoreName(fakePath); + assert.strictEqual(result, 'restoreValue'); + assert( + (client.pathTemplates.restorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('restorePlan', () => { + const fakePath = '/rendered/path/restorePlan'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + restore_plan: 'restorePlanValue', + }; + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.restorePlanPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.restorePlanPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('restorePlanPath', () => { + const result = client.restorePlanPath( + 'projectValue', + 'locationValue', + 'restorePlanValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.restorePlanPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRestorePlanName', () => { + const result = client.matchProjectFromRestorePlanName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.restorePlanPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRestorePlanName', () => { + const result = client.matchLocationFromRestorePlanName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.restorePlanPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRestorePlanFromRestorePlanName', () => { + const result = client.matchRestorePlanFromRestorePlanName(fakePath); + assert.strictEqual(result, 'restorePlanValue'); + assert( + (client.pathTemplates.restorePlanPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('volumeBackup', () => { + const fakePath = '/rendered/path/volumeBackup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backup_plan: 'backupPlanValue', + backup: 'backupValue', + volume_backup: 'volumeBackupValue', + }; + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.volumeBackupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.volumeBackupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('volumeBackupPath', () => { + const result = client.volumeBackupPath( + 'projectValue', + 'locationValue', + 'backupPlanValue', + 'backupValue', + 'volumeBackupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.volumeBackupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVolumeBackupName', () => { + const result = client.matchProjectFromVolumeBackupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.volumeBackupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVolumeBackupName', () => { + const result = client.matchLocationFromVolumeBackupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.volumeBackupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupPlanFromVolumeBackupName', () => { + const result = client.matchBackupPlanFromVolumeBackupName(fakePath); + assert.strictEqual(result, 'backupPlanValue'); + assert( + (client.pathTemplates.volumeBackupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupFromVolumeBackupName', () => { + const result = client.matchBackupFromVolumeBackupName(fakePath); + assert.strictEqual(result, 'backupValue'); + assert( + (client.pathTemplates.volumeBackupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVolumeBackupFromVolumeBackupName', () => { + const result = client.matchVolumeBackupFromVolumeBackupName(fakePath); + assert.strictEqual(result, 'volumeBackupValue'); + assert( + (client.pathTemplates.volumeBackupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('volumeRestore', () => { + const fakePath = '/rendered/path/volumeRestore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + restore_plan: 'restorePlanValue', + restore: 'restoreValue', + volume_restore: 'volumeRestoreValue', + }; + const client = new backupforgkeModule.v1.BackupForGKEClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.volumeRestorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.volumeRestorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('volumeRestorePath', () => { + const result = client.volumeRestorePath( + 'projectValue', + 'locationValue', + 'restorePlanValue', + 'restoreValue', + 'volumeRestoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.volumeRestorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVolumeRestoreName', () => { + const result = client.matchProjectFromVolumeRestoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.volumeRestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVolumeRestoreName', () => { + const result = client.matchLocationFromVolumeRestoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.volumeRestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRestorePlanFromVolumeRestoreName', () => { + const result = client.matchRestorePlanFromVolumeRestoreName(fakePath); + assert.strictEqual(result, 'restorePlanValue'); + assert( + (client.pathTemplates.volumeRestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRestoreFromVolumeRestoreName', () => { + const result = client.matchRestoreFromVolumeRestoreName(fakePath); + assert.strictEqual(result, 'restoreValue'); + assert( + (client.pathTemplates.volumeRestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVolumeRestoreFromVolumeRestoreName', () => { + const result = client.matchVolumeRestoreFromVolumeRestoreName(fakePath); + assert.strictEqual(result, 'volumeRestoreValue'); + assert( + (client.pathTemplates.volumeRestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-gkebackup/tsconfig.json b/packages/google-cloud-gkebackup/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-gkebackup/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-gkebackup/webpack.config.js b/packages/google-cloud-gkebackup/webpack.config.js new file mode 100644 index 00000000000..5363cd84f67 --- /dev/null +++ b/packages/google-cloud-gkebackup/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: 'BackupForGKE', + filename: './backup-for-g-k-e.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', +};