diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 997feac94a0..4a755266f25 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -11,6 +11,7 @@ "packages/google-cloud-bigquery-dataexchange": "0.3.0", "packages/google-cloud-bigquery-datapolicies": "0.1.0", "packages/google-cloud-bigquery-datatransfer": "3.1.3", + "packages/google-cloud-deploy": "2.2.0", "packages/google-cloud-dataplex": "2.2.0", "packages/google-cloud-certificatemanager": "0.6.0", "packages/google-cloud-gkemulticloud": "0.1.2", diff --git a/packages/google-cloud-deploy/.OwlBot.yaml b/packages/google-cloud-deploy/.OwlBot.yaml new file mode 100644 index 00000000000..c7c8d263f94 --- /dev/null +++ b/packages/google-cloud-deploy/.OwlBot.yaml @@ -0,0 +1,20 @@ +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/deploy/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-deploy/$1 diff --git a/packages/google-cloud-deploy/.eslintignore b/packages/google-cloud-deploy/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-deploy/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-deploy/.eslintrc.json b/packages/google-cloud-deploy/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-deploy/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-deploy/.gitattributes b/packages/google-cloud-deploy/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-deploy/.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-deploy/.gitignore b/packages/google-cloud-deploy/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-deploy/.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-deploy/.jsdoc.js b/packages/google-cloud-deploy/.jsdoc.js new file mode 100644 index 00000000000..1ad417e7a8e --- /dev/null +++ b/packages/google-cloud-deploy/.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/deploy', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-deploy/.mocharc.js b/packages/google-cloud-deploy/.mocharc.js new file mode 100644 index 00000000000..cdb7b752160 --- /dev/null +++ b/packages/google-cloud-deploy/.mocharc.js @@ -0,0 +1,29 @@ +// 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. +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-deploy/.nycrc b/packages/google-cloud-deploy/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-deploy/.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-deploy/.prettierignore b/packages/google-cloud-deploy/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-deploy/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-deploy/.prettierrc.js b/packages/google-cloud-deploy/.prettierrc.js new file mode 100644 index 00000000000..d546a4ad546 --- /dev/null +++ b/packages/google-cloud-deploy/.prettierrc.js @@ -0,0 +1,17 @@ +// 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-deploy/.repo-metadata.json b/packages/google-cloud-deploy/.repo-metadata.json new file mode 100644 index 00000000000..f2a4830c7ee --- /dev/null +++ b/packages/google-cloud-deploy/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "clouddeploy", + "name_pretty": "Google Cloud Deploy", + "product_documentation": "https://cloud.google.com/deploy/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/deploy/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/deploy", + "api_id": "clouddeploy.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "api_shortname": "clouddeploy", + "library_type": "GAPIC_AUTO", + "codeowner_team": "@googleapis/aap-dpes" +} diff --git a/packages/google-cloud-deploy/CHANGELOG.md b/packages/google-cloud-deploy/CHANGELOG.md new file mode 100644 index 00000000000..dbc84ff1f59 --- /dev/null +++ b/packages/google-cloud-deploy/CHANGELOG.md @@ -0,0 +1,65 @@ +# Changelog + +## [2.2.0](https://github.com/googleapis/nodejs-deploy/compare/v2.1.2...v2.2.0) (2022-09-29) + + +### Features + +* Publish new JobRun resource and associated methods for Google Cloud Deploy ([8183015](https://github.com/googleapis/nodejs-deploy/commit/8183015c907f932346fde8c3b6dc981a3e561efe)) + +## [2.1.2](https://github.com/googleapis/nodejs-deploy/compare/v2.1.1...v2.1.2) (2022-09-21) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#64](https://github.com/googleapis/nodejs-deploy/issues/64)) ([286143f](https://github.com/googleapis/nodejs-deploy/commit/286143f2e7aff409f57b57f58239c21fa16dc230)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-deploy/issues/1553)) ([#63](https://github.com/googleapis/nodejs-deploy/issues/63)) ([024a0e4](https://github.com/googleapis/nodejs-deploy/commit/024a0e4e4902950fc9b40bfed77f2c2ceacf2fce)) +* Preserve default values in x-goog-request-params header ([#66](https://github.com/googleapis/nodejs-deploy/issues/66)) ([be84a26](https://github.com/googleapis/nodejs-deploy/commit/be84a262c1292cd804d7c3b4e0690e21ff122460)) +* use google-gax v3.3.0 ([024a0e4](https://github.com/googleapis/nodejs-deploy/commit/024a0e4e4902950fc9b40bfed77f2c2ceacf2fce)) + +## [2.1.1](https://github.com/googleapis/nodejs-deploy/compare/v2.1.0...v2.1.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#59](https://github.com/googleapis/nodejs-deploy/issues/59)) ([21bd8f3](https://github.com/googleapis/nodejs-deploy/commit/21bd8f318612224884e01504e949d59f9f9c5615)) +* change import long to require ([#60](https://github.com/googleapis/nodejs-deploy/issues/60)) ([682372a](https://github.com/googleapis/nodejs-deploy/commit/682372af2f6758cb797743ad08ad474837024219)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-deploy/issues/1546)) ([#62](https://github.com/googleapis/nodejs-deploy/issues/62)) ([d70fc8b](https://github.com/googleapis/nodejs-deploy/commit/d70fc8b1f161cd908385001eb433fb0a1bdae561)) + +## [2.1.0](https://github.com/googleapis/nodejs-deploy/compare/v2.0.0...v2.1.0) (2022-06-30) + + +### Features + +* support regapic LRO ([#55](https://github.com/googleapis/nodejs-deploy/issues/55)) ([5c7ba12](https://github.com/googleapis/nodejs-deploy/commit/5c7ba1270c9f7b386614a1efa4ef4e752b591fda)) + +## [2.0.0](https://github.com/googleapis/nodejs-deploy/compare/v1.0.0...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#50) + +### Build System + +* update library to use Node 12 ([#50](https://github.com/googleapis/nodejs-deploy/issues/50)) ([a688caf](https://github.com/googleapis/nodejs-deploy/commit/a688caf817f5f760d951ad6e9570ee0f4a4c0c5f)) + +## [1.0.0](https://github.com/googleapis/nodejs-deploy/compare/v0.2.0...v1.0.0) (2022-03-23) + + +### Features + +* promote to stable ([#36](https://github.com/googleapis/nodejs-deploy/issues/36)) ([00960ff](https://github.com/googleapis/nodejs-deploy/commit/00960ff75a3d40e9f4a81efb868e56642937e49f)) + +## 0.2.0 (2021-10-07) + + +### Features + +* initial generation of library ([#1](https://www.github.com/googleapis/nodejs-deploy/issues/1)) ([c22e971](https://www.github.com/googleapis/nodejs-deploy/commit/c22e9711390855c0c992d3f89ac47360c7e47daf)) +* initial stub of library ([7b1cddd](https://www.github.com/googleapis/nodejs-deploy/commit/7b1cdddd39f236838bba28d70ab9b24ba66a8aa5)) + + +### Miscellaneous Chores + +* force minor version bump ([ec4abc9](https://www.github.com/googleapis/nodejs-deploy/commit/ec4abc940641181946ae5c27079c9e72b26774cf)) diff --git a/packages/google-cloud-deploy/CODE_OF_CONDUCT.md b/packages/google-cloud-deploy/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-deploy/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-deploy/CONTRIBUTING.md b/packages/google-cloud-deploy/CONTRIBUTING.md new file mode 100644 index 00000000000..94de8fe2a32 --- /dev/null +++ b/packages/google-cloud-deploy/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 Google Cloud Deploy 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=clouddeploy.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-deploy/LICENSE b/packages/google-cloud-deploy/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-deploy/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-deploy/README.md b/packages/google-cloud-deploy/README.md new file mode 100644 index 00000000000..7bc3e533d88 --- /dev/null +++ b/packages/google-cloud-deploy/README.md @@ -0,0 +1,216 @@ +[//]: # "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 + +# [Google Cloud Deploy: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![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/deploy.svg)](https://www.npmjs.org/package/@google-cloud/deploy) + + + + +clouddeploy client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Google Cloud Deploy Node.js Client API Reference][client-docs] +* [Google Cloud Deploy Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +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) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [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 Google Cloud Deploy 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/deploy +``` + + +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + */ +// const parent = 'abc123' +/** + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + */ +// const pageSize = 1234 +/** + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ +// const pageToken = 'abc123' +/** + * Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + */ +// const filter = 'abc123' +/** + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ +// const orderBy = 'abc123' + +// Imports the Deploy library +const {CloudDeployClient} = require('@google-cloud/deploy').v1; + +// Instantiates a client +const deployClient = new CloudDeployClient(); + +async function listDeliveryPipelines() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listDeliveryPipelinesAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +listDeliveryPipelines(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Cloud_deploy.abandon_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js,samples/README.md) | +| Cloud_deploy.approve_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js,samples/README.md) | +| Cloud_deploy.create_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js,samples/README.md) | +| Cloud_deploy.create_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js,samples/README.md) | +| Cloud_deploy.create_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js,samples/README.md) | +| Cloud_deploy.create_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js,samples/README.md) | +| Cloud_deploy.delete_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js,samples/README.md) | +| Cloud_deploy.delete_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js,samples/README.md) | +| Cloud_deploy.get_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js,samples/README.md) | +| Cloud_deploy.get_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js,samples/README.md) | +| Cloud_deploy.get_job_run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js,samples/README.md) | +| Cloud_deploy.get_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js,samples/README.md) | +| Cloud_deploy.get_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js,samples/README.md) | +| Cloud_deploy.get_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js,samples/README.md) | +| Cloud_deploy.list_delivery_pipelines | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js,samples/README.md) | +| Cloud_deploy.list_job_runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js,samples/README.md) | +| Cloud_deploy.list_releases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js,samples/README.md) | +| Cloud_deploy.list_rollouts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js,samples/README.md) | +| Cloud_deploy.list_targets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js,samples/README.md) | +| Cloud_deploy.retry_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js,samples/README.md) | +| Cloud_deploy.update_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js,samples/README.md) | +| Cloud_deploy.update_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/test/quickstart.js,samples/README.md) | + + + +The [Google Cloud Deploy 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/deploy@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/google-cloud-node/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/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/deploy/latest +[product-docs]: https://cloud.google.com/deploy/ +[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=clouddeploy.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-deploy/linkinator.config.json b/packages/google-cloud-deploy/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-deploy/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-deploy/package.json b/packages/google-cloud-deploy/package.json new file mode 100644 index 00000000000..68390f871d9 --- /dev/null +++ b/packages/google-cloud-deploy/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/deploy", + "version": "2.2.0", + "description": "clouddeploy client for Node.js", + "repository": "googleapis/nodejs-deploy", + "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 clouddeploy", + "clouddeploy", + "clouddeploy 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": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.6.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto new file mode 100644 index 00000000000..69f8d522208 --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto @@ -0,0 +1,1986 @@ +// 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.deploy.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "CloudDeployProto"; +option java_package = "com.google.cloud.deploy.v1"; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/Build" + pattern: "projects/{project}/locations/{location}/builds/{build}" +}; +option (google.api.resource_definition) = { + type: "container.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" +}; +option (google.api.resource_definition) = { + type: "clouddeploy.googleapis.com/Operation" + pattern: "projects/{project}/locations/{location}/operations/{operation}" +}; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/WorkerPool" + pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" +}; +option (google.api.resource_definition) = { + type: "gkehub.googleapis.com/Membership" + pattern: "projects/{project}/locations/{location}/memberships/{membership}" +}; + +// CloudDeploy service creates and manages Continuous Delivery operations +// on Google Cloud Platform via Skaffold (https://skaffold.dev). +service CloudDeploy { + option (google.api.default_host) = "clouddeploy.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists DeliveryPipelines in a given project and location. + rpc ListDeliveryPipelines(ListDeliveryPipelinesRequest) returns (ListDeliveryPipelinesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/deliveryPipelines" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single DeliveryPipeline. + rpc GetDeliveryPipeline(GetDeliveryPipelineRequest) returns (DeliveryPipeline) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deliveryPipelines/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new DeliveryPipeline in a given project and location. + rpc CreateDeliveryPipeline(CreateDeliveryPipelineRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/deliveryPipelines" + body: "delivery_pipeline" + }; + option (google.api.method_signature) = "parent,delivery_pipeline,delivery_pipeline_id"; + option (google.longrunning.operation_info) = { + response_type: "DeliveryPipeline" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single DeliveryPipeline. + rpc UpdateDeliveryPipeline(UpdateDeliveryPipelineRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{delivery_pipeline.name=projects/*/locations/*/deliveryPipelines/*}" + body: "delivery_pipeline" + }; + option (google.api.method_signature) = "delivery_pipeline,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "DeliveryPipeline" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single DeliveryPipeline. + rpc DeleteDeliveryPipeline(DeleteDeliveryPipelineRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/deliveryPipelines/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists Targets in a given project and location. + rpc ListTargets(ListTargetsRequest) returns (ListTargetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/targets" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Target. + rpc GetTarget(GetTargetRequest) returns (Target) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/targets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Target in a given project and location. + rpc CreateTarget(CreateTargetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/targets" + body: "target" + }; + option (google.api.method_signature) = "parent,target,target_id"; + option (google.longrunning.operation_info) = { + response_type: "Target" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Target. + rpc UpdateTarget(UpdateTargetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{target.name=projects/*/locations/*/targets/*}" + body: "target" + }; + option (google.api.method_signature) = "target,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Target" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Target. + rpc DeleteTarget(DeleteTargetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/targets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists Releases in a given project and location. + rpc ListReleases(ListReleasesRequest) returns (ListReleasesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Release. + rpc GetRelease(GetReleaseRequest) returns (Release) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Release in a given project and location. + rpc CreateRelease(CreateReleaseRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases" + body: "release" + }; + option (google.api.method_signature) = "parent,release,release_id"; + option (google.longrunning.operation_info) = { + response_type: "Release" + metadata_type: "OperationMetadata" + }; + } + + // Abandons a Release in the Delivery Pipeline. + rpc AbandonRelease(AbandonReleaseRequest) returns (AbandonReleaseResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}:abandon" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Approves a Rollout. + rpc ApproveRollout(ApproveRolloutRequest) returns (ApproveRolloutResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:approve" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Rollouts in a given project and location. + rpc ListRollouts(ListRolloutsRequest) returns (ListRolloutsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Rollout. + rpc GetRollout(GetRolloutRequest) returns (Rollout) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Rollout in a given project and location. + rpc CreateRollout(CreateRolloutRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts" + body: "rollout" + }; + option (google.api.method_signature) = "parent,rollout,rollout_id"; + option (google.longrunning.operation_info) = { + response_type: "Rollout" + metadata_type: "OperationMetadata" + }; + } + + // Retries the specified Job in a Rollout. + rpc RetryJob(RetryJobRequest) returns (RetryJobResponse) { + option (google.api.http) = { + post: "/v1/{rollout=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:retryJob" + body: "*" + }; + option (google.api.method_signature) = "rollout,phase_id,job_id"; + } + + // Lists JobRuns in a given project and location. + rpc ListJobRuns(ListJobRunsRequest) returns (ListJobRunsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}/jobRuns" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single JobRun. + rpc GetJobRun(GetJobRunRequest) returns (JobRun) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*/jobRuns/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the configuration for a location. + rpc GetConfig(GetConfigRequest) returns (Config) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/config}" + }; + option (google.api.method_signature) = "name"; + } +} + +// A `DeliveryPipeline` resource in the Google Cloud Deploy API. +// +// A `DeliveryPipeline` defines a pipeline through which a Skaffold +// configuration can progress. +message DeliveryPipeline { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/DeliveryPipeline" + pattern: "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}" + }; + + // Optional. Name of the `DeliveryPipeline`. Format is projects/{project}/ + // locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Unique identifier of the `DeliveryPipeline`. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of the `DeliveryPipeline`. Max length is 255 characters. + string description = 3; + + // User annotations. These attributes can only be set and used by the + // user, and not by Google Cloud Deploy. + map annotations = 4; + + // Labels are attributes that can be set and used by both the + // user and by Google Cloud Deploy. Labels must meet the following + // constraints: + // + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. + // * All characters must use UTF-8 encoding, and international characters are + // allowed. + // * Keys must start with a lowercase letter or international character. + // * Each resource is limited to a maximum of 64 labels. + // + // Both keys and values are additionally constrained to be <= 128 bytes. + map labels = 5; + + // Output only. Time at which the pipeline was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Most recent time at which the pipeline was updated. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The ordering configuration of the `DeliveryPipeline`. + oneof pipeline { + // SerialPipeline defines a sequential set of stages for a + // `DeliveryPipeline`. + SerialPipeline serial_pipeline = 8; + } + + // Output only. Information around the state of the Delivery Pipeline. + PipelineCondition condition = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 10; + + // When suspended, no new releases or rollouts can be created, + // but in-progress ones will complete. + bool suspended = 12; +} + +// SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`. +message SerialPipeline { + // Each stage specifies configuration for a `Target`. The ordering + // of this list defines the promotion flow. + repeated Stage stages = 1; +} + +// Stage specifies a location to which to deploy. +message Stage { + // The target_id to which this stage points. This field refers exclusively to + // the last segment of a target name. For example, this field would just be + // `my-target` (rather than + // `projects/project/locations/location/targets/my-target`). The location of + // the `Target` is inferred to be the same as the location of the + // `DeliveryPipeline` that contains this `Stage`. + string target_id = 1; + + // Skaffold profiles to use when rendering the manifest for this stage's + // `Target`. + repeated string profiles = 2; + + // Optional. The strategy to use for a `Rollout` to this stage. + Strategy strategy = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Strategy contains deployment strategy information. +message Strategy { + // Deployment strategy details. + oneof deployment_strategy { + // Standard deployment strategy executes a single deploy and allows + // verifying the deployment. + Standard standard = 1; + } +} + +// Standard represents the standard deployment strategy. +message Standard { + // Whether to verify a deployment. + bool verify = 1; +} + +// PipelineReadyCondition contains information around the status of the +// Pipeline. +message PipelineReadyCondition { + // True if the Pipeline is in a valid state. Otherwise at least one condition + // in `PipelineCondition` is in an invalid state. Iterate over those + // conditions and see which condition(s) has status = false to find out what + // is wrong with the Pipeline. + bool status = 3; + + // Last time the condition was updated. + google.protobuf.Timestamp update_time = 4; +} + +// TargetsPresentCondition contains information on any Targets defined in +// the Delivery Pipeline that do not actually exist. +message TargetsPresentCondition { + // True if there aren't any missing Targets. + bool status = 1; + + // The list of Target names that are missing. For example, + // projects/{project_id}/locations/{location_name}/targets/{target_name}. + repeated string missing_targets = 2 [(google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Target" + }]; + + // Last time the condition was updated. + google.protobuf.Timestamp update_time = 4; +} + +// PipelineCondition contains all conditions relevant to a Delivery Pipeline. +message PipelineCondition { + // Details around the Pipeline's overall status. + PipelineReadyCondition pipeline_ready_condition = 1; + + // Detalis around targets enumerated in the pipeline. + TargetsPresentCondition targets_present_condition = 3; +} + +// The request object for `ListDeliveryPipelines`. +message ListDeliveryPipelinesRequest { + // Required. The parent, which owns this collection of pipelines. Format must be + // projects/{project_id}/locations/{location_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; + + // The maximum number of pipelines to return. The service may return + // fewer than this value. If unspecified, at most 50 pipelines will + // be returned. The maximum value is 1000; values above 1000 will be set + // to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListDeliveryPipelines` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters match + // the call that provided the page token. + string page_token = 3; + + // Filter pipelines to be returned. See https://google.aip.dev/160 for more + // details. + string filter = 4; + + // Field to sort by. See https://google.aip.dev/132#ordering for more details. + string order_by = 5; +} + +// The response object from `ListDeliveryPipelines`. +message ListDeliveryPipelinesResponse { + // The `DeliveryPipeline` objects. + repeated DeliveryPipeline delivery_pipelines = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// The request object for `GetDeliveryPipeline` +message GetDeliveryPipelineRequest { + // Required. Name of the `DeliveryPipeline`. Format must be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; +} + +// The request object for `CreateDeliveryPipeline`. +message CreateDeliveryPipelineRequest { + // Required. The parent collection in which the `DeliveryPipeline` should be created. + // Format should be projects/{project_id}/locations/{location_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; + + // Required. ID of the `DeliveryPipeline`. + string delivery_pipeline_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `DeliveryPipeline` to create. + DeliveryPipeline delivery_pipeline = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request object for `UpdateDeliveryPipeline`. +message UpdateDeliveryPipelineRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // `DeliveryPipeline` resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `DeliveryPipeline` to update. + DeliveryPipeline delivery_pipeline = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, updating a `DeliveryPipeline` that does not exist will + // result in the creation of a new `DeliveryPipeline`. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request object for `DeleteDeliveryPipeline`. +message DeleteDeliveryPipelineRequest { + // Required. The name of the `DeliveryPipeline` to delete. Format should be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, then deleting an already deleted or non-existing + // `DeliveryPipeline` will succeed. + bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, validate the request and preview the review, but do not actually + // post it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, all child resources under this pipeline will also be + // deleted. Otherwise, the request will only work if the pipeline has + // no child resources. + bool force = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A `Target` resource in the Google Cloud Deploy API. +// +// A `Target` defines a location to which a Skaffold configuration +// can be deployed. +message Target { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/Target" + pattern: "projects/{project}/locations/{location}/targets/{target}" + }; + + // Optional. Name of the `Target`. Format is + // projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Resource id of the `Target`. + string target_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Unique identifier of the `Target`. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Description of the `Target`. Max length is 255 characters. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User annotations. These attributes can only be set and used by the + // user, and not by Google Cloud Deploy. See + // https://google.aip.dev/128#annotations for more details such as format and + // size limitations. + map annotations = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Labels are attributes that can be set and used by both the + // user and by Google Cloud Deploy. Labels must meet the following + // constraints: + // + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. + // * All characters must use UTF-8 encoding, and international characters are + // allowed. + // * Keys must start with a lowercase letter or international character. + // * Each resource is limited to a maximum of 64 labels. + // + // Both keys and values are additionally constrained to be <= 128 bytes. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether or not the `Target` requires approval. + bool require_approval = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Time at which the `Target` was created. + google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Most recent time at which the `Target` was updated. + google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Destination to which the Skaffold configuration is applied during a + // rollout. + oneof deployment_target { + // Information specifying a GKE Cluster. + GkeCluster gke = 15; + + // Information specifying an Anthos Cluster. + AnthosCluster anthos_cluster = 17; + + // Information specifying a Cloud Run deployment target. + CloudRunLocation run = 18; + } + + // Optional. This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Configurations for all execution that relates to this `Target`. + // Each `ExecutionEnvironmentUsage` value may only be used in a single + // configuration; using the same value multiple times is an error. + // When one or more configurations are specified, they must include the + // `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values. + // When no configurations are specified, execution will use the default + // specified in `DefaultPool`. + repeated ExecutionConfig execution_configs = 16; +} + +// Configuration of the environment to use when calling Skaffold. +message ExecutionConfig { + // Possible usages of this configuration. + enum ExecutionEnvironmentUsage { + // Default value. This value is unused. + EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED = 0; + + // Use for rendering. + RENDER = 1; + + // Use for deploying and deployment hooks. + DEPLOY = 2; + + // Use for deployment verification. + VERIFY = 3; + } + + // Required. Usages when this configuration should be applied. + repeated ExecutionEnvironmentUsage usages = 1 [(google.api.field_behavior) = REQUIRED]; + + // Details of the environment. + oneof execution_environment { + // Optional. Use default Cloud Build pool. + DefaultPool default_pool = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Use private Cloud Build pool. + PrivatePool private_pool = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The resource name of the `WorkerPool`, with the format + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + // If this optional field is unspecified, the default Cloud Build pool will be + // used. + string worker_pool = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + } + ]; + + // Optional. Google service account to use for execution. If unspecified, + // the project execution service account + // (-compute@developer.gserviceaccount.com) is used. + string service_account = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud Storage location in which to store execution outputs. This can + // either be a bucket ("gs://my-bucket") or a path within a bucket + // ("gs://my-bucket/my-dir"). + // If unspecified, a default bucket located in the same region will be used. + string artifact_storage = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Execution timeout for a Cloud Build Execution. This must be between 10m and + // 24h in seconds format. + // If unspecified, a default timeout of 1h is used. + google.protobuf.Duration execution_timeout = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Execution using the default Cloud Build pool. +message DefaultPool { + // Optional. Google service account to use for execution. If unspecified, + // the project execution service account + // (-compute@developer.gserviceaccount.com) will be used. + string service_account = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud Storage location where execution outputs should be stored. This can + // either be a bucket ("gs://my-bucket") or a path within a bucket + // ("gs://my-bucket/my-dir"). + // If unspecified, a default bucket located in the same region will be used. + string artifact_storage = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Execution using a private Cloud Build pool. +message PrivatePool { + // Required. Resource name of the Cloud Build worker pool to use. The format is + // `projects/{project}/locations/{location}/workerPools/{pool}`. + string worker_pool = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + } + ]; + + // Optional. Google service account to use for execution. If unspecified, + // the project execution service account + // (-compute@developer.gserviceaccount.com) will be used. + string service_account = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud Storage location where execution outputs should be stored. This can + // either be a bucket ("gs://my-bucket") or a path within a bucket + // ("gs://my-bucket/my-dir"). + // If unspecified, a default bucket located in the same region will be used. + string artifact_storage = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Information specifying a GKE Cluster. +message GkeCluster { + // Information specifying a GKE Cluster. Format is + // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}. + string cluster = 1 [(google.api.resource_reference) = { + type: "container.googleapis.com/Cluster" + }]; + + // Optional. If true, `cluster` is accessed using the private IP address of the control + // plane endpoint. Otherwise, the default IP address of the control plane + // endpoint is used. The default IP address is the private IP address for + // clusters with private control-plane endpoints and the public IP address + // otherwise. + // + // Only specify this option when `cluster` is a [private GKE + // cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept). + bool internal_ip = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Information specifying an Anthos Cluster. +message AnthosCluster { + // Membership of the GKE Hub-registered cluster to which to apply the Skaffold + // configuration. Format is + // `projects/{project}/locations/{location}/memberships/{membership_name}`. + string membership = 1 [(google.api.resource_reference) = { + type: "gkehub.googleapis.com/Membership" + }]; +} + +// Information specifying where to deploy a Cloud Run Service. +message CloudRunLocation { + // Required. The location for the Cloud Run Service. Format must be + // `projects/{project}/locations/{location}`. + string location = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; +} + +// The request object for `ListTargets`. +message ListTargetsRequest { + // Required. The parent, which owns this collection of targets. Format must be + // projects/{project_id}/locations/{location_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "clouddeploy.googleapis.com/Target" + } + ]; + + // Optional. The maximum number of `Target` objects to return. The service may return + // fewer than this value. If unspecified, at most 50 `Target` objects will be + // returned. The maximum value is 1000; values above 1000 will be set to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListTargets` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters match + // the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter targets to be returned. See https://google.aip.dev/160 for more + // details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response object from `ListTargets`. +message ListTargetsResponse { + // The `Target` objects. + repeated Target targets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// The request object for `GetTarget`. +message GetTargetRequest { + // Required. Name of the `Target`. Format must be + // projects/{project_id}/locations/{location_name}/targets/{target_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Target" + } + ]; +} + +// The request object for `CreateTarget`. +message CreateTargetRequest { + // Required. The parent collection in which the `Target` should be created. + // Format should be + // projects/{project_id}/locations/{location_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "clouddeploy.googleapis.com/Target" + } + ]; + + // Required. ID of the `Target`. + string target_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `Target` to create. + Target target = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request object for `UpdateTarget`. +message UpdateTargetRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Target resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `Target` to update. + Target target = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, updating a `Target` that does not exist will + // result in the creation of a new `Target`. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request object for `DeleteTarget`. +message DeleteTargetRequest { + // Required. The name of the `Target` to delete. Format should be + // projects/{project_id}/locations/{location_name}/targets/{target_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Target" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, then deleting an already deleted or non-existing + // DeliveryPipeline will succeed. + bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, validate the request and preview the review, but do not actually + // post it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A `Release` resource in the Google Cloud Deploy API. +// +// A `Release` defines a specific Skaffold configuration instance +// that can be deployed. +message Release { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/Release" + pattern: "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}" + }; + + // Valid states of the render operation. + enum RenderState { + // The render state is unspecified. + RENDER_STATE_UNSPECIFIED = 0; + + // All rendering operations have completed successfully. + SUCCEEDED = 1; + + // All rendering operations have completed, and one or more have failed. + FAILED = 2; + + // Rendering has started and is not complete. + IN_PROGRESS = 3; + } + + // Details of rendering for a single target. + message TargetRender { + // Valid states of the render operation. + enum TargetRenderState { + // The render operation state is unspecified. + TARGET_RENDER_STATE_UNSPECIFIED = 0; + + // The render operation has completed successfully. + SUCCEEDED = 1; + + // The render operation has failed. + FAILED = 2; + + // The render operation is in progress. + IN_PROGRESS = 3; + } + + // Well-known rendering failures. + enum FailureCause { + // No reason for failure is specified. + FAILURE_CAUSE_UNSPECIFIED = 0; + + // Cloud Build is not available, either because it is not enabled or + // because Google Cloud Deploy has insufficient permissions. See [required + // permission](/deploy/docs/cloud-deploy-service-account#required_permissions). + CLOUD_BUILD_UNAVAILABLE = 1; + + // The render operation did not complete successfully; check Cloud Build + // logs. + EXECUTION_FAILED = 2; + } + + // Output only. The resource name of the Cloud Build `Build` object that is used to + // render the manifest for this target. Format is + // `projects/{project}/locations/{location}/builds/{build}`. + string rendering_build = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // Output only. Current state of the render operation for this Target. + TargetRenderState rendering_state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reason this render failed. This will always be unspecified while the + // render in progress. + FailureCause failure_cause = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the render failure, if available. + string failure_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Optional. Name of the `Release`. Format is projects/{project}/ + // locations/{location}/deliveryPipelines/{deliveryPipeline}/ + // releases/[a-z][a-z0-9\-]{0,62}. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Unique identifier of the `Release`. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of the `Release`. Max length is 255 characters. + string description = 3; + + // User annotations. These attributes can only be set and used by the + // user, and not by Google Cloud Deploy. See + // https://google.aip.dev/128#annotations for more details such as format and + // size limitations. + map annotations = 4; + + // Labels are attributes that can be set and used by both the + // user and by Google Cloud Deploy. Labels must meet the following + // constraints: + // + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. + // * All characters must use UTF-8 encoding, and international characters are + // allowed. + // * Keys must start with a lowercase letter or international character. + // * Each resource is limited to a maximum of 64 labels. + // + // Both keys and values are additionally constrained to be <= 128 bytes. + map labels = 5; + + // Output only. Indicates whether this is an abandoned release. + bool abandoned = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `Release` was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the render began. + google.protobuf.Timestamp render_start_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the render completed. + google.protobuf.Timestamp render_end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cloud Storage URI of tar.gz archive containing Skaffold configuration. + string skaffold_config_uri = 17; + + // Filepath of the Skaffold config inside of the config URI. + string skaffold_config_path = 9; + + // List of artifacts to pass through to Skaffold command. + repeated BuildArtifact build_artifacts = 10; + + // Output only. Snapshot of the parent pipeline taken at release creation time. + DeliveryPipeline delivery_pipeline_snapshot = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Snapshot of the targets taken at release creation time. + repeated Target target_snapshots = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the render operation. + RenderState render_state = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 16; + + // The Skaffold version to use when operating on this release, such as + // "1.20.0". Not all versions are valid; Google Cloud Deploy supports a + // specific set of versions. + // + // If unset, the most recent supported Skaffold version will be used. + string skaffold_version = 19; + + // Output only. Map from target ID to the target artifacts created + // during the render operation. + map target_artifacts = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Map from target ID to details of the render operation for that target. + map target_renders = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Description of an a image to use during Skaffold rendering. +message BuildArtifact { + // Image name in Skaffold configuration. + string image = 3; + + // Image tag to use. This will generally be the full path to an image, such + // as "gcr.io/my-project/busybox:1.2.3" or + // "gcr.io/my-project/busybox@sha256:abc123". + string tag = 2; +} + +// The artifacts produced by a target render operation. +message TargetArtifact { + oneof uri { + // Output only. URI of a directory containing the artifacts. This contains + // deployment configuration used by Skaffold during a rollout, and all + // paths are relative to this location. + string artifact_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. File path of the resolved Skaffold configuration relative to the URI. + string skaffold_config_path = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. File path of the rendered manifest relative to the URI. + string manifest_path = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request object for `ListReleases`. +message ListReleasesRequest { + // Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; + + // Optional. The maximum number of `Release` objects to return. The service may return + // fewer than this value. If unspecified, at most 50 `Release` objects will be + // returned. The maximum value is 1000; values above 1000 will be set to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListReleases` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters match + // the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter releases to be returned. See https://google.aip.dev/160 for more + // details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response object from `ListReleases`. +message ListReleasesResponse { + // The `Release` objects. + repeated Release releases = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// The request object for `GetRelease`. +message GetReleaseRequest { + // Required. Name of the `Release`. Format must be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Release" + } + ]; +} + +// The request object for `CreateRelease`, +message CreateReleaseRequest { + // Required. The parent collection in which the `Release` should be created. + // Format should be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; + + // Required. ID of the `Release`. + string release_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `Release` to create. + Release release = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A `Rollout` resource in the Google Cloud Deploy API. +// +// A `Rollout` contains information around a specific deployment to a `Target`. +message Rollout { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/Rollout" + pattern: "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}" + }; + + // Valid approval states of a `Rollout`. + enum ApprovalState { + // The `Rollout` has an unspecified approval state. + APPROVAL_STATE_UNSPECIFIED = 0; + + // The `Rollout` requires approval. + NEEDS_APPROVAL = 1; + + // The `Rollout` does not require approval. + DOES_NOT_NEED_APPROVAL = 2; + + // The `Rollout` has been approved. + APPROVED = 3; + + // The `Rollout` has been rejected. + REJECTED = 4; + } + + // Valid states of a `Rollout`. + enum State { + // The `Rollout` has an unspecified state. + STATE_UNSPECIFIED = 0; + + // The `Rollout` has completed successfully. + SUCCEEDED = 1; + + // The `Rollout` has failed. + FAILED = 2; + + // The `Rollout` is being deployed. + IN_PROGRESS = 3; + + // The `Rollout` needs approval. + PENDING_APPROVAL = 4; + + // An approver rejected the `Rollout`. + APPROVAL_REJECTED = 5; + + // The `Rollout` is waiting for an earlier Rollout(s) to complete on this + // `Target`. + PENDING = 6; + + // The `Rollout` is waiting for the `Release` to be fully rendered. + PENDING_RELEASE = 7; + } + + // Well-known rollout failures. + enum FailureCause { + // No reason for failure is specified. + FAILURE_CAUSE_UNSPECIFIED = 0; + + // Cloud Build is not available, either because it is not enabled or because + // Cloud Deploy has insufficient permissions. See [required + // permission](/deploy/docs/cloud-deploy-service-account#required_permissions). + CLOUD_BUILD_UNAVAILABLE = 1; + + // The deploy operation did not complete successfully; check Cloud Build + // logs. + EXECUTION_FAILED = 2; + + // Deployment did not complete within the alloted time. + DEADLINE_EXCEEDED = 3; + + // Release is in a failed state. + RELEASE_FAILED = 4; + + // Release is abandoned. + RELEASE_ABANDONED = 5; + + // No skaffold verify configuration was found. + VERIFICATION_CONFIG_NOT_FOUND = 6; + } + + // Optional. Name of the `Rollout`. Format is projects/{project}/ + // locations/{location}/deliveryPipelines/{deliveryPipeline}/ + // releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Unique identifier of the `Rollout`. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of the `Rollout` for user purposes. Max length is 255 + // characters. + string description = 3; + + // User annotations. These attributes can only be set and used by the + // user, and not by Google Cloud Deploy. See + // https://google.aip.dev/128#annotations for more details such as format and + // size limitations. + map annotations = 4; + + // Labels are attributes that can be set and used by both the + // user and by Google Cloud Deploy. Labels must meet the following + // constraints: + // + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. + // * All characters must use UTF-8 encoding, and international characters are + // allowed. + // * Keys must start with a lowercase letter or international character. + // * Each resource is limited to a maximum of 64 labels. + // + // Both keys and values are additionally constrained to be <= 128 bytes. + map labels = 5; + + // Output only. Time at which the `Rollout` was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `Rollout` was approved. + google.protobuf.Timestamp approve_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `Rollout` was enqueued. + google.protobuf.Timestamp enqueue_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `Rollout` started deploying. + google.protobuf.Timestamp deploy_start_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `Rollout` finished deploying. + google.protobuf.Timestamp deploy_end_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The ID of Target to which this `Rollout` is deploying. + string target_id = 18 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Approval state of the `Rollout`. + ApprovalState approval_state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the `Rollout`. + State state = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the rollout failure, if available. + string failure_reason = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource name of the Cloud Build `Build` object that is used to deploy + // the Rollout. Format is + // `projects/{project}/locations/{location}/builds/{build}`. + string deploying_build = 17 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 16; + + // Output only. The reason this rollout failed. This will always be unspecified while the + // rollout is in progress. + FailureCause deploy_failure_cause = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The phases that represent the workflows of this `Rollout`. + repeated Phase phases = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metadata contains information about the rollout. + Metadata metadata = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata includes information associated with a `Rollout`. +message Metadata { + // Output only. The name of the Cloud Run Service that is associated with a `Rollout`. + CloudRunMetadata cloud_run = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// DeployJobRunMetadata surfaces information associated with a `DeployJobRun` to +// the user. +message DeployJobRunMetadata { + // Output only. The name of the Cloud Run Service that is associated with a `DeployJobRun`. + CloudRunMetadata cloud_run = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CloudRunMetadata contains information from a Cloud Run deployment. +message CloudRunMetadata { + // Output only. The name of the Cloud Run Service that is associated with a `Rollout`. + // Format is projects/{project}/locations/{location}/services/{service}. + string service = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Cloud Run Service urls that are associated with a `Rollout`. + repeated string service_urls = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Cloud Run Revision id associated with a `Rollout`. + string revision = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Phase represents a collection of jobs that are logically grouped together +// for a `Rollout`. +message Phase { + // Valid states of a Phase. + enum State { + // The Phase has an unspecified state. + STATE_UNSPECIFIED = 0; + + // The Phase is waiting for an earlier Phase(s) to complete. + PENDING = 1; + + // The Phase is in progress. + IN_PROGRESS = 2; + + // The Phase has succeeded. + SUCCEEDED = 3; + + // The Phase has failed. + FAILED = 4; + + // The Phase was aborted. + ABORTED = 5; + } + + // Output only. The ID of the Phase. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the Phase. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The job composition of this Phase. + oneof jobs { + // Output only. Deployment job composition. + DeploymentJobs deployment_jobs = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Deployment job composition. +message DeploymentJobs { + // Output only. The deploy Job. This is the first job run in the phase. + Job deploy_job = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The verify Job. Runs after a deploy if the deploy succeeds. + Job verify_job = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Job represents an operation for a `Rollout`. +message Job { + // Valid states of a Job. + enum State { + // The Job has an unspecified state. + STATE_UNSPECIFIED = 0; + + // The Job is waiting for an earlier Phase(s) or Job(s) to complete. + PENDING = 1; + + // The Job is disabled. + DISABLED = 2; + + // The Job is in progress. + IN_PROGRESS = 3; + + // The Job succeeded. + SUCCEEDED = 4; + + // The Job failed. + FAILED = 5; + + // The Job was aborted. + ABORTED = 6; + } + + // Output only. The ID of the Job. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the Job. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the `JobRun` responsible for the most recent invocation of this + // Job. + string job_run = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/JobRun" + } + ]; + + // The type of Job. + oneof job_type { + // Output only. A deploy Job. + DeployJob deploy_job = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A verify Job. + VerifyJob verify_job = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// A deploy Job. +message DeployJob { + +} + +// A verify Job. +message VerifyJob { + +} + +// ListRolloutsRequest is the request object used by `ListRollouts`. +message ListRolloutsRequest { + // Required. The `Release` which owns this collection of `Rollout` objects. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Release" + } + ]; + + // Optional. The maximum number of `Rollout` objects to return. The service may return + // fewer than this value. If unspecified, at most 50 `Rollout` objects will be + // returned. The maximum value is 1000; values above 1000 will be set to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListRollouts` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters match + // the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more + // details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// ListRolloutsResponse is the response object reutrned by `ListRollouts`. +message ListRolloutsResponse { + // The `Rollout` objects. + repeated Rollout rollouts = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// GetRolloutRequest is the request object used by `GetRollout`. +message GetRolloutRequest { + // Required. Name of the `Rollout`. Format must be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Rollout" + } + ]; +} + +// CreateRolloutRequest is the request object used by `CreateRollout`. +message CreateRolloutRequest { + // Required. The parent collection in which the `Rollout` should be created. + // Format should be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Release" + } + ]; + + // Required. ID of the `Rollout`. + string rollout_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `Rollout` to create. + Rollout rollout = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [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]; +} + +// The request object used by `ApproveRollout`. +message ApproveRolloutRequest { + // Required. Name of the Rollout. Format is + // projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + // releases/{release}/rollouts/{rollout}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Rollout" + } + ]; + + // Required. True = approve; false = reject + bool approved = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The response object from `ApproveRollout`. +message ApproveRolloutResponse { + +} + +// RetryJobRequest is the request object used by `RetryJob`. +message RetryJobRequest { + // Required. Name of the Rollout. Format is + // projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + // releases/{release}/rollouts/{rollout}. + string rollout = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Rollout" + } + ]; + + // Required. The phase ID the Job to retry belongs to. + string phase_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The job ID for the Job to retry. + string job_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The response object from 'RetryJob'. +message RetryJobResponse { + +} + +// The request object used by `AbandonRelease`. +message AbandonReleaseRequest { + // Required. Name of the Release. Format is + // projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + // releases/{release}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Release" + } + ]; +} + +// The response object for `AbandonRelease`. +message AbandonReleaseResponse { + +} + +// A `JobRun` resource in the Google Cloud Deploy API. +// +// A `JobRun` contains information of a single `Rollout` job evaluation. +message JobRun { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/JobRun" + pattern: "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run}" + }; + + // Valid states of a `JobRun`. + enum State { + // The `JobRun` has an unspecified state. + STATE_UNSPECIFIED = 0; + + // The `JobRun` is in progress. + IN_PROGRESS = 1; + + // The `JobRun` has succeeded. + SUCCEEDED = 2; + + // The `JobRun` has failed. + FAILED = 3; + } + + // Optional. Name of the `JobRun`. Format is projects/{project}/locations/{location}/ + // deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/ + // {rollouts}/jobRuns/{uuid}. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Unique identifier of the `JobRun`. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ID of the `Rollout` phase this `JobRun` belongs in. + string phase_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ID of the `Rollout` job this `JobRun` corresponds to. + string job_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `JobRun` was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `JobRun` was started. + google.protobuf.Timestamp start_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `JobRun` ended. + google.protobuf.Timestamp end_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the `JobRun`. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The `JobRun` type and the information for that type. + oneof job_run { + // Output only. Information specific to a deploy `JobRun`. + DeployJobRun deploy_job_run = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information specific to a verify `JobRun`. + VerifyJobRun verify_job_run = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// DeployJobRun contains information specific to a deploy `JobRun`. +message DeployJobRun { + // Well-known deploy failures. + enum FailureCause { + // No reason for failure is specified. + FAILURE_CAUSE_UNSPECIFIED = 0; + + // Cloud Build is not available, either because it is not enabled or because + // Google Cloud Deploy has insufficient permissions. See [Required + // permission](/deploy/docs/cloud-deploy-service-account#required_permissions). + CLOUD_BUILD_UNAVAILABLE = 1; + + // The deploy operation did not complete successfully; check Cloud Build + // logs. + EXECUTION_FAILED = 2; + + // The deploy build did not complete within the alloted time. + DEADLINE_EXCEEDED = 3; + } + + // Output only. The resource name of the Cloud Build `Build` object that is used to deploy. + // Format is projects/{project}/locations/{location}/builds/{build}. + string build = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // Output only. The reason the deploy failed. This will always be unspecified while the + // deploy is in progress or if it succeeded. + FailureCause failure_cause = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the deploy failure, if available. + string failure_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metadata containing information about the deploy job run. + DeployJobRunMetadata metadata = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// VerifyJobRun contains information specific to a verify `JobRun`. +message VerifyJobRun { + // Well-known verify failures. + enum FailureCause { + // No reason for failure is specified. + FAILURE_CAUSE_UNSPECIFIED = 0; + + // Cloud Build is not available, either because it is not enabled or because + // Google Cloud Deploy has insufficient permissions. See [required + // permission](/deploy/docs/cloud-deploy-service-account#required_permissions). + CLOUD_BUILD_UNAVAILABLE = 1; + + // The verify operation did not complete successfully; check Cloud Build + // logs. + EXECUTION_FAILED = 2; + + // The verify build did not complete within the alloted time. + DEADLINE_EXCEEDED = 3; + + // No Skaffold verify configuration was found. + VERIFICATION_CONFIG_NOT_FOUND = 4; + } + + // Output only. The resource name of the Cloud Build `Build` object that is used to verify. + // Format is projects/{project}/locations/{location}/builds/{build}. + string build = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // Output only. URI of a directory containing the verify artifacts. This contains the + // Skaffold event log. + string artifact_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. File path of the Skaffold event log relative to the artifact URI. + string event_log_path = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The reason the verify failed. This will always be unspecified while the + // verify is in progress or if it succeeded. + FailureCause failure_cause = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the verify failure, if available. + string failure_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ListJobRunsRequest is the request object used by `ListJobRuns`. +message ListJobRunsRequest { + // Required. The `Rollout` which owns this collection of `JobRun` objects. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Rollout" + } + ]; + + // Optional. The maximum number of `JobRun` objects to return. The service may return + // fewer than this value. If unspecified, at most 50 `JobRun` objects will be + // returned. The maximum value is 1000; values above 1000 will be set to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListJobRuns` call. Provide this + // to retrieve the subsequent page. + // + // When paginating, all other provided parameters match the call that provided + // the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to be returned. See https://google.aip.dev/160 for more + // details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// ListJobRunsResponse is the response object returned by `ListJobRuns`. +message ListJobRunsResponse { + // The `JobRun` objects. + repeated JobRun job_runs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. If + // this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached + repeated string unreachable = 3; +} + +// GetJobRunRequest is the request object used by `GetJobRun`. +message GetJobRunRequest { + // Required. Name of the `JobRun`. Format must be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/JobRun" + } + ]; +} + +// Service-wide configuration. +message Config { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/Config" + pattern: "projects/{project}/locations/{location}/config" + }; + + // Name of the configuration. + string name = 1; + + // Output only. All supported versions of Skaffold. + repeated SkaffoldVersion supported_versions = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Default Skaffold version that is assigned when a Release is created without + // specifying a Skaffold version. + string default_skaffold_version = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Details of a supported Skaffold version. +message SkaffoldVersion { + // Release version number. For example, "1.20.3". + string version = 1; + + // Date when this version is expected to no longer be supported. + google.type.Date support_end_date = 2; +} + +// Request to get a configuration. +message GetConfigRequest { + // Required. Name of requested configuration. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Config" + } + ]; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/deliverypipeline_notification_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/deliverypipeline_notification_payload.proto new file mode 100644 index 00000000000..5fff2d0876c --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/deliverypipeline_notification_payload.proto @@ -0,0 +1,38 @@ +// 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.deploy.v1; + +import "google/cloud/deploy/v1/log_enums.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "DeliveryPipelineNotificationPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/deliverypipeline_notification" +// Platform Log event that describes the failure to send delivery pipeline +// status change Pub/Sub notification. +message DeliveryPipelineNotificationEvent { + // Debug message for when a notification fails to send. + string message = 1; + + // The name of the `Delivery Pipeline`. + string delivery_pipeline = 2; + + // Type of this notification, e.g. for a Pub/Sub failure. + Type type = 3; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/jobrun_notification_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/jobrun_notification_payload.proto new file mode 100644 index 00000000000..f1e80d6b325 --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/jobrun_notification_payload.proto @@ -0,0 +1,50 @@ +// 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.deploy.v1; + +import "google/cloud/deploy/v1/log_enums.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "JobRunNotificationPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/jobrun_notification" +// Platform Log event that describes the failure to send JobRun resource update +// Pub/Sub notification. +message JobRunNotificationEvent { + // Debug message for when a notification fails to send. + string message = 1; + + // The name of the `JobRun`. + string job_run = 2; + + // Unique identifier of the `DeliveryPipeline`. + string pipeline_uid = 3; + + // Unique identifier of the `Release`. + string release_uid = 4; + + // Unique identifier of the `Rollout`. + string rollout_uid = 5; + + // ID of the `Target`. + string target_id = 6; + + // Type of this notification, e.g. for a Pub/Sub failure. + Type type = 7; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/log_enums.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/log_enums.proto new file mode 100644 index 00000000000..cd6a32ea4b4 --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/log_enums.proto @@ -0,0 +1,34 @@ +// 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.deploy.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "LogEnumsProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Type indicates the type of the log entry and can be used as a filter. +enum Type { + // Type is unspecified. + TYPE_UNSPECIFIED = 0; + + // A Pub/Sub notification failed to be sent. + TYPE_PUBSUB_NOTIFICATION_FAILURE = 1; + + // Release render status changed notification. + TYPE_RENDER_STATUES_CHANGE = 2; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_notification_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_notification_payload.proto new file mode 100644 index 00000000000..0383b8e566b --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_notification_payload.proto @@ -0,0 +1,38 @@ +// 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.deploy.v1; + +import "google/cloud/deploy/v1/log_enums.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "ReleaseNotificationPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/release_notification" +// Platform Log event that describes the failure to send release status change +// Pub/Sub notification. +message ReleaseNotificationEvent { + // Debug message for when a notification fails to send. + string message = 1; + + // The name of the `Release`. + string release = 2; + + // Type of this notification, e.g. for a Pub/Sub failure. + Type type = 3; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_render_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_render_payload.proto new file mode 100644 index 00000000000..414e72ded34 --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_render_payload.proto @@ -0,0 +1,33 @@ +// 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.deploy.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "ReleaseRenderPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/release_render" +// Platform Log event that describes the render status change. +message ReleaseRenderEvent { + // Debug message for when a render transition occurs. Provides further + // details as rendering progresses through render states. + string message = 1; + + // The name of the `Release`. + string release = 2; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/rollout_notification_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/rollout_notification_payload.proto new file mode 100644 index 00000000000..10f6864f97c --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/rollout_notification_payload.proto @@ -0,0 +1,47 @@ +// 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.deploy.v1; + +import "google/cloud/deploy/v1/log_enums.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "RolloutNotificationPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/rollout_notification" +// Platform Log event that describes the failure to send rollout status change +// Pub/Sub notification. +message RolloutNotificationEvent { + // Debug message for when a notification fails to send. + string message = 1; + + // Unique identifier of the `DeliveryPipeline`. + string pipeline_uid = 2; + + // Unique identifier of the `Release`. + string release_uid = 3; + + // The name of the `Rollout`. + string rollout = 4; + + // Type of this notification, e.g. for a Pub/Sub failure. + Type type = 5; + + // ID of the `Target` that the rollout is deployed to. + string target_id = 6; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/target_notification_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/target_notification_payload.proto new file mode 100644 index 00000000000..d121cdb8ded --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/target_notification_payload.proto @@ -0,0 +1,38 @@ +// 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.deploy.v1; + +import "google/cloud/deploy/v1/log_enums.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "TargetNotificationPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/target_notification" +// Platform Log event that describes the failure to send target status change +// Pub/Sub notification. +message TargetNotificationEvent { + // Debug message for when a notification fails to send. + string message = 1; + + // The name of the `Target`. + string target = 2; + + // Type of this notification, e.g. for a Pub/Sub failure. + Type type = 3; +} diff --git a/packages/google-cloud-deploy/protos/protos.d.ts b/packages/google-cloud-deploy/protos/protos.d.ts new file mode 100644 index 00000000000..5abd859ad50 --- /dev/null +++ b/packages/google-cloud-deploy/protos/protos.d.ts @@ -0,0 +1,14317 @@ +// 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace deploy. */ + namespace deploy { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a CloudDeploy */ + class CloudDeploy extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudDeploy 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 CloudDeploy 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): CloudDeploy; + + /** + * Calls ListDeliveryPipelines. + * @param request ListDeliveryPipelinesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDeliveryPipelinesResponse + */ + public listDeliveryPipelines(request: google.cloud.deploy.v1.IListDeliveryPipelinesRequest, callback: google.cloud.deploy.v1.CloudDeploy.ListDeliveryPipelinesCallback): void; + + /** + * Calls ListDeliveryPipelines. + * @param request ListDeliveryPipelinesRequest message or plain object + * @returns Promise + */ + public listDeliveryPipelines(request: google.cloud.deploy.v1.IListDeliveryPipelinesRequest): Promise; + + /** + * Calls GetDeliveryPipeline. + * @param request GetDeliveryPipelineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeliveryPipeline + */ + public getDeliveryPipeline(request: google.cloud.deploy.v1.IGetDeliveryPipelineRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetDeliveryPipelineCallback): void; + + /** + * Calls GetDeliveryPipeline. + * @param request GetDeliveryPipelineRequest message or plain object + * @returns Promise + */ + public getDeliveryPipeline(request: google.cloud.deploy.v1.IGetDeliveryPipelineRequest): Promise; + + /** + * Calls CreateDeliveryPipeline. + * @param request CreateDeliveryPipelineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDeliveryPipeline(request: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, callback: google.cloud.deploy.v1.CloudDeploy.CreateDeliveryPipelineCallback): void; + + /** + * Calls CreateDeliveryPipeline. + * @param request CreateDeliveryPipelineRequest message or plain object + * @returns Promise + */ + public createDeliveryPipeline(request: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest): Promise; + + /** + * Calls UpdateDeliveryPipeline. + * @param request UpdateDeliveryPipelineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDeliveryPipeline(request: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, callback: google.cloud.deploy.v1.CloudDeploy.UpdateDeliveryPipelineCallback): void; + + /** + * Calls UpdateDeliveryPipeline. + * @param request UpdateDeliveryPipelineRequest message or plain object + * @returns Promise + */ + public updateDeliveryPipeline(request: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest): Promise; + + /** + * Calls DeleteDeliveryPipeline. + * @param request DeleteDeliveryPipelineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDeliveryPipeline(request: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, callback: google.cloud.deploy.v1.CloudDeploy.DeleteDeliveryPipelineCallback): void; + + /** + * Calls DeleteDeliveryPipeline. + * @param request DeleteDeliveryPipelineRequest message or plain object + * @returns Promise + */ + public deleteDeliveryPipeline(request: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest): Promise; + + /** + * Calls ListTargets. + * @param request ListTargetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTargetsResponse + */ + public listTargets(request: google.cloud.deploy.v1.IListTargetsRequest, callback: google.cloud.deploy.v1.CloudDeploy.ListTargetsCallback): void; + + /** + * Calls ListTargets. + * @param request ListTargetsRequest message or plain object + * @returns Promise + */ + public listTargets(request: google.cloud.deploy.v1.IListTargetsRequest): Promise; + + /** + * Calls GetTarget. + * @param request GetTargetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Target + */ + public getTarget(request: google.cloud.deploy.v1.IGetTargetRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetTargetCallback): void; + + /** + * Calls GetTarget. + * @param request GetTargetRequest message or plain object + * @returns Promise + */ + public getTarget(request: google.cloud.deploy.v1.IGetTargetRequest): Promise; + + /** + * Calls CreateTarget. + * @param request CreateTargetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTarget(request: google.cloud.deploy.v1.ICreateTargetRequest, callback: google.cloud.deploy.v1.CloudDeploy.CreateTargetCallback): void; + + /** + * Calls CreateTarget. + * @param request CreateTargetRequest message or plain object + * @returns Promise + */ + public createTarget(request: google.cloud.deploy.v1.ICreateTargetRequest): Promise; + + /** + * Calls UpdateTarget. + * @param request UpdateTargetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTarget(request: google.cloud.deploy.v1.IUpdateTargetRequest, callback: google.cloud.deploy.v1.CloudDeploy.UpdateTargetCallback): void; + + /** + * Calls UpdateTarget. + * @param request UpdateTargetRequest message or plain object + * @returns Promise + */ + public updateTarget(request: google.cloud.deploy.v1.IUpdateTargetRequest): Promise; + + /** + * Calls DeleteTarget. + * @param request DeleteTargetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTarget(request: google.cloud.deploy.v1.IDeleteTargetRequest, callback: google.cloud.deploy.v1.CloudDeploy.DeleteTargetCallback): void; + + /** + * Calls DeleteTarget. + * @param request DeleteTargetRequest message or plain object + * @returns Promise + */ + public deleteTarget(request: google.cloud.deploy.v1.IDeleteTargetRequest): Promise; + + /** + * Calls ListReleases. + * @param request ListReleasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReleasesResponse + */ + public listReleases(request: google.cloud.deploy.v1.IListReleasesRequest, callback: google.cloud.deploy.v1.CloudDeploy.ListReleasesCallback): void; + + /** + * Calls ListReleases. + * @param request ListReleasesRequest message or plain object + * @returns Promise + */ + public listReleases(request: google.cloud.deploy.v1.IListReleasesRequest): Promise; + + /** + * Calls GetRelease. + * @param request GetReleaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Release + */ + public getRelease(request: google.cloud.deploy.v1.IGetReleaseRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetReleaseCallback): void; + + /** + * Calls GetRelease. + * @param request GetReleaseRequest message or plain object + * @returns Promise + */ + public getRelease(request: google.cloud.deploy.v1.IGetReleaseRequest): Promise; + + /** + * Calls CreateRelease. + * @param request CreateReleaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createRelease(request: google.cloud.deploy.v1.ICreateReleaseRequest, callback: google.cloud.deploy.v1.CloudDeploy.CreateReleaseCallback): void; + + /** + * Calls CreateRelease. + * @param request CreateReleaseRequest message or plain object + * @returns Promise + */ + public createRelease(request: google.cloud.deploy.v1.ICreateReleaseRequest): Promise; + + /** + * Calls AbandonRelease. + * @param request AbandonReleaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AbandonReleaseResponse + */ + public abandonRelease(request: google.cloud.deploy.v1.IAbandonReleaseRequest, callback: google.cloud.deploy.v1.CloudDeploy.AbandonReleaseCallback): void; + + /** + * Calls AbandonRelease. + * @param request AbandonReleaseRequest message or plain object + * @returns Promise + */ + public abandonRelease(request: google.cloud.deploy.v1.IAbandonReleaseRequest): Promise; + + /** + * Calls ApproveRollout. + * @param request ApproveRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApproveRolloutResponse + */ + public approveRollout(request: google.cloud.deploy.v1.IApproveRolloutRequest, callback: google.cloud.deploy.v1.CloudDeploy.ApproveRolloutCallback): void; + + /** + * Calls ApproveRollout. + * @param request ApproveRolloutRequest message or plain object + * @returns Promise + */ + public approveRollout(request: google.cloud.deploy.v1.IApproveRolloutRequest): Promise; + + /** + * Calls ListRollouts. + * @param request ListRolloutsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRolloutsResponse + */ + public listRollouts(request: google.cloud.deploy.v1.IListRolloutsRequest, callback: google.cloud.deploy.v1.CloudDeploy.ListRolloutsCallback): void; + + /** + * Calls ListRollouts. + * @param request ListRolloutsRequest message or plain object + * @returns Promise + */ + public listRollouts(request: google.cloud.deploy.v1.IListRolloutsRequest): Promise; + + /** + * Calls GetRollout. + * @param request GetRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Rollout + */ + public getRollout(request: google.cloud.deploy.v1.IGetRolloutRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetRolloutCallback): void; + + /** + * Calls GetRollout. + * @param request GetRolloutRequest message or plain object + * @returns Promise + */ + public getRollout(request: google.cloud.deploy.v1.IGetRolloutRequest): Promise; + + /** + * Calls CreateRollout. + * @param request CreateRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createRollout(request: google.cloud.deploy.v1.ICreateRolloutRequest, callback: google.cloud.deploy.v1.CloudDeploy.CreateRolloutCallback): void; + + /** + * Calls CreateRollout. + * @param request CreateRolloutRequest message or plain object + * @returns Promise + */ + public createRollout(request: google.cloud.deploy.v1.ICreateRolloutRequest): Promise; + + /** + * Calls RetryJob. + * @param request RetryJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RetryJobResponse + */ + public retryJob(request: google.cloud.deploy.v1.IRetryJobRequest, callback: google.cloud.deploy.v1.CloudDeploy.RetryJobCallback): void; + + /** + * Calls RetryJob. + * @param request RetryJobRequest message or plain object + * @returns Promise + */ + public retryJob(request: google.cloud.deploy.v1.IRetryJobRequest): Promise; + + /** + * Calls ListJobRuns. + * @param request ListJobRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobRunsResponse + */ + public listJobRuns(request: google.cloud.deploy.v1.IListJobRunsRequest, callback: google.cloud.deploy.v1.CloudDeploy.ListJobRunsCallback): void; + + /** + * Calls ListJobRuns. + * @param request ListJobRunsRequest message or plain object + * @returns Promise + */ + public listJobRuns(request: google.cloud.deploy.v1.IListJobRunsRequest): Promise; + + /** + * Calls GetJobRun. + * @param request GetJobRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and JobRun + */ + public getJobRun(request: google.cloud.deploy.v1.IGetJobRunRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetJobRunCallback): void; + + /** + * Calls GetJobRun. + * @param request GetJobRunRequest message or plain object + * @returns Promise + */ + public getJobRun(request: google.cloud.deploy.v1.IGetJobRunRequest): Promise; + + /** + * Calls GetConfig. + * @param request GetConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Config + */ + public getConfig(request: google.cloud.deploy.v1.IGetConfigRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetConfigCallback): void; + + /** + * Calls GetConfig. + * @param request GetConfigRequest message or plain object + * @returns Promise + */ + public getConfig(request: google.cloud.deploy.v1.IGetConfigRequest): Promise; + } + + namespace CloudDeploy { + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listDeliveryPipelines}. + * @param error Error, if any + * @param [response] ListDeliveryPipelinesResponse + */ + type ListDeliveryPipelinesCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ListDeliveryPipelinesResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getDeliveryPipeline}. + * @param error Error, if any + * @param [response] DeliveryPipeline + */ + type GetDeliveryPipelineCallback = (error: (Error|null), response?: google.cloud.deploy.v1.DeliveryPipeline) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createDeliveryPipeline}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDeliveryPipelineCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|updateDeliveryPipeline}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDeliveryPipelineCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|deleteDeliveryPipeline}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDeliveryPipelineCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listTargets}. + * @param error Error, if any + * @param [response] ListTargetsResponse + */ + type ListTargetsCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ListTargetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getTarget}. + * @param error Error, if any + * @param [response] Target + */ + type GetTargetCallback = (error: (Error|null), response?: google.cloud.deploy.v1.Target) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createTarget}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTargetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|updateTarget}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTargetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|deleteTarget}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTargetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listReleases}. + * @param error Error, if any + * @param [response] ListReleasesResponse + */ + type ListReleasesCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ListReleasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getRelease}. + * @param error Error, if any + * @param [response] Release + */ + type GetReleaseCallback = (error: (Error|null), response?: google.cloud.deploy.v1.Release) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createRelease}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateReleaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|abandonRelease}. + * @param error Error, if any + * @param [response] AbandonReleaseResponse + */ + type AbandonReleaseCallback = (error: (Error|null), response?: google.cloud.deploy.v1.AbandonReleaseResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|approveRollout}. + * @param error Error, if any + * @param [response] ApproveRolloutResponse + */ + type ApproveRolloutCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ApproveRolloutResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listRollouts}. + * @param error Error, if any + * @param [response] ListRolloutsResponse + */ + type ListRolloutsCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ListRolloutsResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getRollout}. + * @param error Error, if any + * @param [response] Rollout + */ + type GetRolloutCallback = (error: (Error|null), response?: google.cloud.deploy.v1.Rollout) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createRollout}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateRolloutCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|retryJob}. + * @param error Error, if any + * @param [response] RetryJobResponse + */ + type RetryJobCallback = (error: (Error|null), response?: google.cloud.deploy.v1.RetryJobResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listJobRuns}. + * @param error Error, if any + * @param [response] ListJobRunsResponse + */ + type ListJobRunsCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ListJobRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getJobRun}. + * @param error Error, if any + * @param [response] JobRun + */ + type GetJobRunCallback = (error: (Error|null), response?: google.cloud.deploy.v1.JobRun) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getConfig}. + * @param error Error, if any + * @param [response] Config + */ + type GetConfigCallback = (error: (Error|null), response?: google.cloud.deploy.v1.Config) => void; + } + + /** Properties of a DeliveryPipeline. */ + interface IDeliveryPipeline { + + /** DeliveryPipeline name */ + name?: (string|null); + + /** DeliveryPipeline uid */ + uid?: (string|null); + + /** DeliveryPipeline description */ + description?: (string|null); + + /** DeliveryPipeline annotations */ + annotations?: ({ [k: string]: string }|null); + + /** DeliveryPipeline labels */ + labels?: ({ [k: string]: string }|null); + + /** DeliveryPipeline createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DeliveryPipeline updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DeliveryPipeline serialPipeline */ + serialPipeline?: (google.cloud.deploy.v1.ISerialPipeline|null); + + /** DeliveryPipeline condition */ + condition?: (google.cloud.deploy.v1.IPipelineCondition|null); + + /** DeliveryPipeline etag */ + etag?: (string|null); + + /** DeliveryPipeline suspended */ + suspended?: (boolean|null); + } + + /** Represents a DeliveryPipeline. */ + class DeliveryPipeline implements IDeliveryPipeline { + + /** + * Constructs a new DeliveryPipeline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeliveryPipeline); + + /** DeliveryPipeline name. */ + public name: string; + + /** DeliveryPipeline uid. */ + public uid: string; + + /** DeliveryPipeline description. */ + public description: string; + + /** DeliveryPipeline annotations. */ + public annotations: { [k: string]: string }; + + /** DeliveryPipeline labels. */ + public labels: { [k: string]: string }; + + /** DeliveryPipeline createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DeliveryPipeline updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DeliveryPipeline serialPipeline. */ + public serialPipeline?: (google.cloud.deploy.v1.ISerialPipeline|null); + + /** DeliveryPipeline condition. */ + public condition?: (google.cloud.deploy.v1.IPipelineCondition|null); + + /** DeliveryPipeline etag. */ + public etag: string; + + /** DeliveryPipeline suspended. */ + public suspended: boolean; + + /** DeliveryPipeline pipeline. */ + public pipeline?: "serialPipeline"; + + /** + * Creates a new DeliveryPipeline instance using the specified properties. + * @param [properties] Properties to set + * @returns DeliveryPipeline instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeliveryPipeline): google.cloud.deploy.v1.DeliveryPipeline; + + /** + * Encodes the specified DeliveryPipeline message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipeline.verify|verify} messages. + * @param message DeliveryPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeliveryPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeliveryPipeline message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipeline.verify|verify} messages. + * @param message DeliveryPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeliveryPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeliveryPipeline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeliveryPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeliveryPipeline; + + /** + * Decodes a DeliveryPipeline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeliveryPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeliveryPipeline; + + /** + * Verifies a DeliveryPipeline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeliveryPipeline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeliveryPipeline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeliveryPipeline; + + /** + * Creates a plain object from a DeliveryPipeline message. Also converts values to other types if specified. + * @param message DeliveryPipeline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeliveryPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeliveryPipeline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeliveryPipeline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SerialPipeline. */ + interface ISerialPipeline { + + /** SerialPipeline stages */ + stages?: (google.cloud.deploy.v1.IStage[]|null); + } + + /** Represents a SerialPipeline. */ + class SerialPipeline implements ISerialPipeline { + + /** + * Constructs a new SerialPipeline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ISerialPipeline); + + /** SerialPipeline stages. */ + public stages: google.cloud.deploy.v1.IStage[]; + + /** + * Creates a new SerialPipeline instance using the specified properties. + * @param [properties] Properties to set + * @returns SerialPipeline instance + */ + public static create(properties?: google.cloud.deploy.v1.ISerialPipeline): google.cloud.deploy.v1.SerialPipeline; + + /** + * Encodes the specified SerialPipeline message. Does not implicitly {@link google.cloud.deploy.v1.SerialPipeline.verify|verify} messages. + * @param message SerialPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ISerialPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SerialPipeline message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.SerialPipeline.verify|verify} messages. + * @param message SerialPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ISerialPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SerialPipeline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SerialPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.SerialPipeline; + + /** + * Decodes a SerialPipeline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SerialPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.SerialPipeline; + + /** + * Verifies a SerialPipeline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SerialPipeline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SerialPipeline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.SerialPipeline; + + /** + * Creates a plain object from a SerialPipeline message. Also converts values to other types if specified. + * @param message SerialPipeline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.SerialPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SerialPipeline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SerialPipeline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Stage. */ + interface IStage { + + /** Stage targetId */ + targetId?: (string|null); + + /** Stage profiles */ + profiles?: (string[]|null); + + /** Stage strategy */ + strategy?: (google.cloud.deploy.v1.IStrategy|null); + } + + /** Represents a Stage. */ + class Stage implements IStage { + + /** + * Constructs a new Stage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IStage); + + /** Stage targetId. */ + public targetId: string; + + /** Stage profiles. */ + public profiles: string[]; + + /** Stage strategy. */ + public strategy?: (google.cloud.deploy.v1.IStrategy|null); + + /** + * Creates a new Stage instance using the specified properties. + * @param [properties] Properties to set + * @returns Stage instance + */ + public static create(properties?: google.cloud.deploy.v1.IStage): google.cloud.deploy.v1.Stage; + + /** + * Encodes the specified Stage message. Does not implicitly {@link google.cloud.deploy.v1.Stage.verify|verify} messages. + * @param message Stage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IStage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Stage message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Stage.verify|verify} messages. + * @param message Stage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IStage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Stage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Stage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Stage; + + /** + * Decodes a Stage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Stage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Stage; + + /** + * Verifies a Stage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Stage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Stage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Stage; + + /** + * Creates a plain object from a Stage message. Also converts values to other types if specified. + * @param message Stage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Stage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Stage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Stage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Strategy. */ + interface IStrategy { + + /** Strategy standard */ + standard?: (google.cloud.deploy.v1.IStandard|null); + } + + /** Represents a Strategy. */ + class Strategy implements IStrategy { + + /** + * Constructs a new Strategy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IStrategy); + + /** Strategy standard. */ + public standard?: (google.cloud.deploy.v1.IStandard|null); + + /** Strategy deploymentStrategy. */ + public deploymentStrategy?: "standard"; + + /** + * Creates a new Strategy instance using the specified properties. + * @param [properties] Properties to set + * @returns Strategy instance + */ + public static create(properties?: google.cloud.deploy.v1.IStrategy): google.cloud.deploy.v1.Strategy; + + /** + * Encodes the specified Strategy message. Does not implicitly {@link google.cloud.deploy.v1.Strategy.verify|verify} messages. + * @param message Strategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Strategy message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Strategy.verify|verify} messages. + * @param message Strategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Strategy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Strategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Strategy; + + /** + * Decodes a Strategy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Strategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Strategy; + + /** + * Verifies a Strategy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Strategy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Strategy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Strategy; + + /** + * Creates a plain object from a Strategy message. Also converts values to other types if specified. + * @param message Strategy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Strategy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Strategy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Strategy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Standard. */ + interface IStandard { + + /** Standard verify */ + verify?: (boolean|null); + } + + /** Represents a Standard. */ + class Standard implements IStandard { + + /** + * Constructs a new Standard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IStandard); + + /** Standard verify. */ + public verify: boolean; + + /** + * Creates a new Standard instance using the specified properties. + * @param [properties] Properties to set + * @returns Standard instance + */ + public static create(properties?: google.cloud.deploy.v1.IStandard): google.cloud.deploy.v1.Standard; + + /** + * Encodes the specified Standard message. Does not implicitly {@link google.cloud.deploy.v1.Standard.verify|verify} messages. + * @param message Standard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IStandard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Standard message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Standard.verify|verify} messages. + * @param message Standard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IStandard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Standard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Standard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Standard; + + /** + * Decodes a Standard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Standard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Standard; + + /** + * Verifies a Standard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Standard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Standard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Standard; + + /** + * Creates a plain object from a Standard message. Also converts values to other types if specified. + * @param message Standard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Standard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Standard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Standard + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PipelineReadyCondition. */ + interface IPipelineReadyCondition { + + /** PipelineReadyCondition status */ + status?: (boolean|null); + + /** PipelineReadyCondition updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PipelineReadyCondition. */ + class PipelineReadyCondition implements IPipelineReadyCondition { + + /** + * Constructs a new PipelineReadyCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IPipelineReadyCondition); + + /** PipelineReadyCondition status. */ + public status: boolean; + + /** PipelineReadyCondition updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PipelineReadyCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns PipelineReadyCondition instance + */ + public static create(properties?: google.cloud.deploy.v1.IPipelineReadyCondition): google.cloud.deploy.v1.PipelineReadyCondition; + + /** + * Encodes the specified PipelineReadyCondition message. Does not implicitly {@link google.cloud.deploy.v1.PipelineReadyCondition.verify|verify} messages. + * @param message PipelineReadyCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IPipelineReadyCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PipelineReadyCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PipelineReadyCondition.verify|verify} messages. + * @param message PipelineReadyCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IPipelineReadyCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PipelineReadyCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PipelineReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.PipelineReadyCondition; + + /** + * Decodes a PipelineReadyCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PipelineReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.PipelineReadyCondition; + + /** + * Verifies a PipelineReadyCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PipelineReadyCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PipelineReadyCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.PipelineReadyCondition; + + /** + * Creates a plain object from a PipelineReadyCondition message. Also converts values to other types if specified. + * @param message PipelineReadyCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.PipelineReadyCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PipelineReadyCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PipelineReadyCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetsPresentCondition. */ + interface ITargetsPresentCondition { + + /** TargetsPresentCondition status */ + status?: (boolean|null); + + /** TargetsPresentCondition missingTargets */ + missingTargets?: (string[]|null); + + /** TargetsPresentCondition updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TargetsPresentCondition. */ + class TargetsPresentCondition implements ITargetsPresentCondition { + + /** + * Constructs a new TargetsPresentCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ITargetsPresentCondition); + + /** TargetsPresentCondition status. */ + public status: boolean; + + /** TargetsPresentCondition missingTargets. */ + public missingTargets: string[]; + + /** TargetsPresentCondition updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TargetsPresentCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetsPresentCondition instance + */ + public static create(properties?: google.cloud.deploy.v1.ITargetsPresentCondition): google.cloud.deploy.v1.TargetsPresentCondition; + + /** + * Encodes the specified TargetsPresentCondition message. Does not implicitly {@link google.cloud.deploy.v1.TargetsPresentCondition.verify|verify} messages. + * @param message TargetsPresentCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ITargetsPresentCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetsPresentCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetsPresentCondition.verify|verify} messages. + * @param message TargetsPresentCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ITargetsPresentCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetsPresentCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetsPresentCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.TargetsPresentCondition; + + /** + * Decodes a TargetsPresentCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetsPresentCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.TargetsPresentCondition; + + /** + * Verifies a TargetsPresentCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetsPresentCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetsPresentCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.TargetsPresentCondition; + + /** + * Creates a plain object from a TargetsPresentCondition message. Also converts values to other types if specified. + * @param message TargetsPresentCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.TargetsPresentCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetsPresentCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetsPresentCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PipelineCondition. */ + interface IPipelineCondition { + + /** PipelineCondition pipelineReadyCondition */ + pipelineReadyCondition?: (google.cloud.deploy.v1.IPipelineReadyCondition|null); + + /** PipelineCondition targetsPresentCondition */ + targetsPresentCondition?: (google.cloud.deploy.v1.ITargetsPresentCondition|null); + } + + /** Represents a PipelineCondition. */ + class PipelineCondition implements IPipelineCondition { + + /** + * Constructs a new PipelineCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IPipelineCondition); + + /** PipelineCondition pipelineReadyCondition. */ + public pipelineReadyCondition?: (google.cloud.deploy.v1.IPipelineReadyCondition|null); + + /** PipelineCondition targetsPresentCondition. */ + public targetsPresentCondition?: (google.cloud.deploy.v1.ITargetsPresentCondition|null); + + /** + * Creates a new PipelineCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns PipelineCondition instance + */ + public static create(properties?: google.cloud.deploy.v1.IPipelineCondition): google.cloud.deploy.v1.PipelineCondition; + + /** + * Encodes the specified PipelineCondition message. Does not implicitly {@link google.cloud.deploy.v1.PipelineCondition.verify|verify} messages. + * @param message PipelineCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IPipelineCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PipelineCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PipelineCondition.verify|verify} messages. + * @param message PipelineCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IPipelineCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PipelineCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PipelineCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.PipelineCondition; + + /** + * Decodes a PipelineCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PipelineCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.PipelineCondition; + + /** + * Verifies a PipelineCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PipelineCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PipelineCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.PipelineCondition; + + /** + * Creates a plain object from a PipelineCondition message. Also converts values to other types if specified. + * @param message PipelineCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.PipelineCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PipelineCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PipelineCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeliveryPipelinesRequest. */ + interface IListDeliveryPipelinesRequest { + + /** ListDeliveryPipelinesRequest parent */ + parent?: (string|null); + + /** ListDeliveryPipelinesRequest pageSize */ + pageSize?: (number|null); + + /** ListDeliveryPipelinesRequest pageToken */ + pageToken?: (string|null); + + /** ListDeliveryPipelinesRequest filter */ + filter?: (string|null); + + /** ListDeliveryPipelinesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDeliveryPipelinesRequest. */ + class ListDeliveryPipelinesRequest implements IListDeliveryPipelinesRequest { + + /** + * Constructs a new ListDeliveryPipelinesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListDeliveryPipelinesRequest); + + /** ListDeliveryPipelinesRequest parent. */ + public parent: string; + + /** ListDeliveryPipelinesRequest pageSize. */ + public pageSize: number; + + /** ListDeliveryPipelinesRequest pageToken. */ + public pageToken: string; + + /** ListDeliveryPipelinesRequest filter. */ + public filter: string; + + /** ListDeliveryPipelinesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDeliveryPipelinesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeliveryPipelinesRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IListDeliveryPipelinesRequest): google.cloud.deploy.v1.ListDeliveryPipelinesRequest; + + /** + * Encodes the specified ListDeliveryPipelinesRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesRequest.verify|verify} messages. + * @param message ListDeliveryPipelinesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListDeliveryPipelinesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeliveryPipelinesRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesRequest.verify|verify} messages. + * @param message ListDeliveryPipelinesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListDeliveryPipelinesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeliveryPipelinesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeliveryPipelinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListDeliveryPipelinesRequest; + + /** + * Decodes a ListDeliveryPipelinesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeliveryPipelinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListDeliveryPipelinesRequest; + + /** + * Verifies a ListDeliveryPipelinesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeliveryPipelinesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeliveryPipelinesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListDeliveryPipelinesRequest; + + /** + * Creates a plain object from a ListDeliveryPipelinesRequest message. Also converts values to other types if specified. + * @param message ListDeliveryPipelinesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListDeliveryPipelinesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeliveryPipelinesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeliveryPipelinesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeliveryPipelinesResponse. */ + interface IListDeliveryPipelinesResponse { + + /** ListDeliveryPipelinesResponse deliveryPipelines */ + deliveryPipelines?: (google.cloud.deploy.v1.IDeliveryPipeline[]|null); + + /** ListDeliveryPipelinesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListDeliveryPipelinesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListDeliveryPipelinesResponse. */ + class ListDeliveryPipelinesResponse implements IListDeliveryPipelinesResponse { + + /** + * Constructs a new ListDeliveryPipelinesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListDeliveryPipelinesResponse); + + /** ListDeliveryPipelinesResponse deliveryPipelines. */ + public deliveryPipelines: google.cloud.deploy.v1.IDeliveryPipeline[]; + + /** ListDeliveryPipelinesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDeliveryPipelinesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListDeliveryPipelinesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeliveryPipelinesResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IListDeliveryPipelinesResponse): google.cloud.deploy.v1.ListDeliveryPipelinesResponse; + + /** + * Encodes the specified ListDeliveryPipelinesResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesResponse.verify|verify} messages. + * @param message ListDeliveryPipelinesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListDeliveryPipelinesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeliveryPipelinesResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesResponse.verify|verify} messages. + * @param message ListDeliveryPipelinesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListDeliveryPipelinesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeliveryPipelinesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeliveryPipelinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListDeliveryPipelinesResponse; + + /** + * Decodes a ListDeliveryPipelinesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeliveryPipelinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListDeliveryPipelinesResponse; + + /** + * Verifies a ListDeliveryPipelinesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeliveryPipelinesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeliveryPipelinesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListDeliveryPipelinesResponse; + + /** + * Creates a plain object from a ListDeliveryPipelinesResponse message. Also converts values to other types if specified. + * @param message ListDeliveryPipelinesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListDeliveryPipelinesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeliveryPipelinesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeliveryPipelinesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDeliveryPipelineRequest. */ + interface IGetDeliveryPipelineRequest { + + /** GetDeliveryPipelineRequest name */ + name?: (string|null); + } + + /** Represents a GetDeliveryPipelineRequest. */ + class GetDeliveryPipelineRequest implements IGetDeliveryPipelineRequest { + + /** + * Constructs a new GetDeliveryPipelineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetDeliveryPipelineRequest); + + /** GetDeliveryPipelineRequest name. */ + public name: string; + + /** + * Creates a new GetDeliveryPipelineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDeliveryPipelineRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetDeliveryPipelineRequest): google.cloud.deploy.v1.GetDeliveryPipelineRequest; + + /** + * Encodes the specified GetDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetDeliveryPipelineRequest.verify|verify} messages. + * @param message GetDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetDeliveryPipelineRequest.verify|verify} messages. + * @param message GetDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDeliveryPipelineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetDeliveryPipelineRequest; + + /** + * Decodes a GetDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetDeliveryPipelineRequest; + + /** + * Verifies a GetDeliveryPipelineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDeliveryPipelineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetDeliveryPipelineRequest; + + /** + * Creates a plain object from a GetDeliveryPipelineRequest message. Also converts values to other types if specified. + * @param message GetDeliveryPipelineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetDeliveryPipelineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDeliveryPipelineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDeliveryPipelineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDeliveryPipelineRequest. */ + interface ICreateDeliveryPipelineRequest { + + /** CreateDeliveryPipelineRequest parent */ + parent?: (string|null); + + /** CreateDeliveryPipelineRequest deliveryPipelineId */ + deliveryPipelineId?: (string|null); + + /** CreateDeliveryPipelineRequest deliveryPipeline */ + deliveryPipeline?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** CreateDeliveryPipelineRequest requestId */ + requestId?: (string|null); + + /** CreateDeliveryPipelineRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateDeliveryPipelineRequest. */ + class CreateDeliveryPipelineRequest implements ICreateDeliveryPipelineRequest { + + /** + * Constructs a new CreateDeliveryPipelineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest); + + /** CreateDeliveryPipelineRequest parent. */ + public parent: string; + + /** CreateDeliveryPipelineRequest deliveryPipelineId. */ + public deliveryPipelineId: string; + + /** CreateDeliveryPipelineRequest deliveryPipeline. */ + public deliveryPipeline?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** CreateDeliveryPipelineRequest requestId. */ + public requestId: string; + + /** CreateDeliveryPipelineRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateDeliveryPipelineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDeliveryPipelineRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest): google.cloud.deploy.v1.CreateDeliveryPipelineRequest; + + /** + * Encodes the specified CreateDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateDeliveryPipelineRequest.verify|verify} messages. + * @param message CreateDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateDeliveryPipelineRequest.verify|verify} messages. + * @param message CreateDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDeliveryPipelineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CreateDeliveryPipelineRequest; + + /** + * Decodes a CreateDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CreateDeliveryPipelineRequest; + + /** + * Verifies a CreateDeliveryPipelineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDeliveryPipelineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CreateDeliveryPipelineRequest; + + /** + * Creates a plain object from a CreateDeliveryPipelineRequest message. Also converts values to other types if specified. + * @param message CreateDeliveryPipelineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CreateDeliveryPipelineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDeliveryPipelineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDeliveryPipelineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDeliveryPipelineRequest. */ + interface IUpdateDeliveryPipelineRequest { + + /** UpdateDeliveryPipelineRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDeliveryPipelineRequest deliveryPipeline */ + deliveryPipeline?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** UpdateDeliveryPipelineRequest requestId */ + requestId?: (string|null); + + /** UpdateDeliveryPipelineRequest allowMissing */ + allowMissing?: (boolean|null); + + /** UpdateDeliveryPipelineRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateDeliveryPipelineRequest. */ + class UpdateDeliveryPipelineRequest implements IUpdateDeliveryPipelineRequest { + + /** + * Constructs a new UpdateDeliveryPipelineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest); + + /** UpdateDeliveryPipelineRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDeliveryPipelineRequest deliveryPipeline. */ + public deliveryPipeline?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** UpdateDeliveryPipelineRequest requestId. */ + public requestId: string; + + /** UpdateDeliveryPipelineRequest allowMissing. */ + public allowMissing: boolean; + + /** UpdateDeliveryPipelineRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateDeliveryPipelineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDeliveryPipelineRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest): google.cloud.deploy.v1.UpdateDeliveryPipelineRequest; + + /** + * Encodes the specified UpdateDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.verify|verify} messages. + * @param message UpdateDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.verify|verify} messages. + * @param message UpdateDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDeliveryPipelineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.UpdateDeliveryPipelineRequest; + + /** + * Decodes an UpdateDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.UpdateDeliveryPipelineRequest; + + /** + * Verifies an UpdateDeliveryPipelineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDeliveryPipelineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.UpdateDeliveryPipelineRequest; + + /** + * Creates a plain object from an UpdateDeliveryPipelineRequest message. Also converts values to other types if specified. + * @param message UpdateDeliveryPipelineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.UpdateDeliveryPipelineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDeliveryPipelineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDeliveryPipelineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDeliveryPipelineRequest. */ + interface IDeleteDeliveryPipelineRequest { + + /** DeleteDeliveryPipelineRequest name */ + name?: (string|null); + + /** DeleteDeliveryPipelineRequest requestId */ + requestId?: (string|null); + + /** DeleteDeliveryPipelineRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeleteDeliveryPipelineRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteDeliveryPipelineRequest force */ + force?: (boolean|null); + + /** DeleteDeliveryPipelineRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteDeliveryPipelineRequest. */ + class DeleteDeliveryPipelineRequest implements IDeleteDeliveryPipelineRequest { + + /** + * Constructs a new DeleteDeliveryPipelineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest); + + /** DeleteDeliveryPipelineRequest name. */ + public name: string; + + /** DeleteDeliveryPipelineRequest requestId. */ + public requestId: string; + + /** DeleteDeliveryPipelineRequest allowMissing. */ + public allowMissing: boolean; + + /** DeleteDeliveryPipelineRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteDeliveryPipelineRequest force. */ + public force: boolean; + + /** DeleteDeliveryPipelineRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteDeliveryPipelineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDeliveryPipelineRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest): google.cloud.deploy.v1.DeleteDeliveryPipelineRequest; + + /** + * Encodes the specified DeleteDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeliveryPipelineRequest.verify|verify} messages. + * @param message DeleteDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeliveryPipelineRequest.verify|verify} messages. + * @param message DeleteDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDeliveryPipelineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeleteDeliveryPipelineRequest; + + /** + * Decodes a DeleteDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeleteDeliveryPipelineRequest; + + /** + * Verifies a DeleteDeliveryPipelineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDeliveryPipelineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeleteDeliveryPipelineRequest; + + /** + * Creates a plain object from a DeleteDeliveryPipelineRequest message. Also converts values to other types if specified. + * @param message DeleteDeliveryPipelineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeleteDeliveryPipelineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDeliveryPipelineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDeliveryPipelineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Target. */ + interface ITarget { + + /** Target name */ + name?: (string|null); + + /** Target targetId */ + targetId?: (string|null); + + /** Target uid */ + uid?: (string|null); + + /** Target description */ + description?: (string|null); + + /** Target annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Target labels */ + labels?: ({ [k: string]: string }|null); + + /** Target requireApproval */ + requireApproval?: (boolean|null); + + /** Target createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Target updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Target gke */ + gke?: (google.cloud.deploy.v1.IGkeCluster|null); + + /** Target anthosCluster */ + anthosCluster?: (google.cloud.deploy.v1.IAnthosCluster|null); + + /** Target run */ + run?: (google.cloud.deploy.v1.ICloudRunLocation|null); + + /** Target etag */ + etag?: (string|null); + + /** Target executionConfigs */ + executionConfigs?: (google.cloud.deploy.v1.IExecutionConfig[]|null); + } + + /** Represents a Target. */ + class Target implements ITarget { + + /** + * Constructs a new Target. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ITarget); + + /** Target name. */ + public name: string; + + /** Target targetId. */ + public targetId: string; + + /** Target uid. */ + public uid: string; + + /** Target description. */ + public description: string; + + /** Target annotations. */ + public annotations: { [k: string]: string }; + + /** Target labels. */ + public labels: { [k: string]: string }; + + /** Target requireApproval. */ + public requireApproval: boolean; + + /** Target createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Target updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Target gke. */ + public gke?: (google.cloud.deploy.v1.IGkeCluster|null); + + /** Target anthosCluster. */ + public anthosCluster?: (google.cloud.deploy.v1.IAnthosCluster|null); + + /** Target run. */ + public run?: (google.cloud.deploy.v1.ICloudRunLocation|null); + + /** Target etag. */ + public etag: string; + + /** Target executionConfigs. */ + public executionConfigs: google.cloud.deploy.v1.IExecutionConfig[]; + + /** Target deploymentTarget. */ + public deploymentTarget?: ("gke"|"anthosCluster"|"run"); + + /** + * Creates a new Target instance using the specified properties. + * @param [properties] Properties to set + * @returns Target instance + */ + public static create(properties?: google.cloud.deploy.v1.ITarget): google.cloud.deploy.v1.Target; + + /** + * Encodes the specified Target message. Does not implicitly {@link google.cloud.deploy.v1.Target.verify|verify} messages. + * @param message Target message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ITarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Target message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Target.verify|verify} messages. + * @param message Target message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ITarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Target message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Target; + + /** + * Decodes a Target message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Target; + + /** + * Verifies a Target message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Target message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Target + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Target; + + /** + * Creates a plain object from a Target message. Also converts values to other types if specified. + * @param message Target + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Target, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Target to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Target + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecutionConfig. */ + interface IExecutionConfig { + + /** ExecutionConfig usages */ + usages?: (google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage[]|null); + + /** ExecutionConfig defaultPool */ + defaultPool?: (google.cloud.deploy.v1.IDefaultPool|null); + + /** ExecutionConfig privatePool */ + privatePool?: (google.cloud.deploy.v1.IPrivatePool|null); + + /** ExecutionConfig workerPool */ + workerPool?: (string|null); + + /** ExecutionConfig serviceAccount */ + serviceAccount?: (string|null); + + /** ExecutionConfig artifactStorage */ + artifactStorage?: (string|null); + + /** ExecutionConfig executionTimeout */ + executionTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents an ExecutionConfig. */ + class ExecutionConfig implements IExecutionConfig { + + /** + * Constructs a new ExecutionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IExecutionConfig); + + /** ExecutionConfig usages. */ + public usages: google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage[]; + + /** ExecutionConfig defaultPool. */ + public defaultPool?: (google.cloud.deploy.v1.IDefaultPool|null); + + /** ExecutionConfig privatePool. */ + public privatePool?: (google.cloud.deploy.v1.IPrivatePool|null); + + /** ExecutionConfig workerPool. */ + public workerPool: string; + + /** ExecutionConfig serviceAccount. */ + public serviceAccount: string; + + /** ExecutionConfig artifactStorage. */ + public artifactStorage: string; + + /** ExecutionConfig executionTimeout. */ + public executionTimeout?: (google.protobuf.IDuration|null); + + /** ExecutionConfig executionEnvironment. */ + public executionEnvironment?: ("defaultPool"|"privatePool"); + + /** + * Creates a new ExecutionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutionConfig instance + */ + public static create(properties?: google.cloud.deploy.v1.IExecutionConfig): google.cloud.deploy.v1.ExecutionConfig; + + /** + * Encodes the specified ExecutionConfig message. Does not implicitly {@link google.cloud.deploy.v1.ExecutionConfig.verify|verify} messages. + * @param message ExecutionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IExecutionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutionConfig message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ExecutionConfig.verify|verify} messages. + * @param message ExecutionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IExecutionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ExecutionConfig; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ExecutionConfig; + + /** + * Verifies an ExecutionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecutionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ExecutionConfig; + + /** + * Creates a plain object from an ExecutionConfig message. Also converts values to other types if specified. + * @param message ExecutionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ExecutionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecutionConfig { + + /** ExecutionEnvironmentUsage enum. */ + enum ExecutionEnvironmentUsage { + EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED = 0, + RENDER = 1, + DEPLOY = 2, + VERIFY = 3 + } + } + + /** Properties of a DefaultPool. */ + interface IDefaultPool { + + /** DefaultPool serviceAccount */ + serviceAccount?: (string|null); + + /** DefaultPool artifactStorage */ + artifactStorage?: (string|null); + } + + /** Represents a DefaultPool. */ + class DefaultPool implements IDefaultPool { + + /** + * Constructs a new DefaultPool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDefaultPool); + + /** DefaultPool serviceAccount. */ + public serviceAccount: string; + + /** DefaultPool artifactStorage. */ + public artifactStorage: string; + + /** + * Creates a new DefaultPool instance using the specified properties. + * @param [properties] Properties to set + * @returns DefaultPool instance + */ + public static create(properties?: google.cloud.deploy.v1.IDefaultPool): google.cloud.deploy.v1.DefaultPool; + + /** + * Encodes the specified DefaultPool message. Does not implicitly {@link google.cloud.deploy.v1.DefaultPool.verify|verify} messages. + * @param message DefaultPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDefaultPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DefaultPool message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DefaultPool.verify|verify} messages. + * @param message DefaultPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDefaultPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DefaultPool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DefaultPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DefaultPool; + + /** + * Decodes a DefaultPool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DefaultPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DefaultPool; + + /** + * Verifies a DefaultPool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DefaultPool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DefaultPool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DefaultPool; + + /** + * Creates a plain object from a DefaultPool message. Also converts values to other types if specified. + * @param message DefaultPool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DefaultPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DefaultPool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DefaultPool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrivatePool. */ + interface IPrivatePool { + + /** PrivatePool workerPool */ + workerPool?: (string|null); + + /** PrivatePool serviceAccount */ + serviceAccount?: (string|null); + + /** PrivatePool artifactStorage */ + artifactStorage?: (string|null); + } + + /** Represents a PrivatePool. */ + class PrivatePool implements IPrivatePool { + + /** + * Constructs a new PrivatePool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IPrivatePool); + + /** PrivatePool workerPool. */ + public workerPool: string; + + /** PrivatePool serviceAccount. */ + public serviceAccount: string; + + /** PrivatePool artifactStorage. */ + public artifactStorage: string; + + /** + * Creates a new PrivatePool instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivatePool instance + */ + public static create(properties?: google.cloud.deploy.v1.IPrivatePool): google.cloud.deploy.v1.PrivatePool; + + /** + * Encodes the specified PrivatePool message. Does not implicitly {@link google.cloud.deploy.v1.PrivatePool.verify|verify} messages. + * @param message PrivatePool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IPrivatePool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivatePool message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PrivatePool.verify|verify} messages. + * @param message PrivatePool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IPrivatePool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivatePool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivatePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.PrivatePool; + + /** + * Decodes a PrivatePool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivatePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.PrivatePool; + + /** + * Verifies a PrivatePool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrivatePool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivatePool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.PrivatePool; + + /** + * Creates a plain object from a PrivatePool message. Also converts values to other types if specified. + * @param message PrivatePool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.PrivatePool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivatePool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivatePool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GkeCluster. */ + interface IGkeCluster { + + /** GkeCluster cluster */ + cluster?: (string|null); + + /** GkeCluster internalIp */ + internalIp?: (boolean|null); + } + + /** Represents a GkeCluster. */ + class GkeCluster implements IGkeCluster { + + /** + * Constructs a new GkeCluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGkeCluster); + + /** GkeCluster cluster. */ + public cluster: string; + + /** GkeCluster internalIp. */ + public internalIp: boolean; + + /** + * Creates a new GkeCluster instance using the specified properties. + * @param [properties] Properties to set + * @returns GkeCluster instance + */ + public static create(properties?: google.cloud.deploy.v1.IGkeCluster): google.cloud.deploy.v1.GkeCluster; + + /** + * Encodes the specified GkeCluster message. Does not implicitly {@link google.cloud.deploy.v1.GkeCluster.verify|verify} messages. + * @param message GkeCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGkeCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GkeCluster message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GkeCluster.verify|verify} messages. + * @param message GkeCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGkeCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GkeCluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GkeCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GkeCluster; + + /** + * Decodes a GkeCluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GkeCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GkeCluster; + + /** + * Verifies a GkeCluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GkeCluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GkeCluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GkeCluster; + + /** + * Creates a plain object from a GkeCluster message. Also converts values to other types if specified. + * @param message GkeCluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GkeCluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GkeCluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GkeCluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnthosCluster. */ + interface IAnthosCluster { + + /** AnthosCluster membership */ + membership?: (string|null); + } + + /** Represents an AnthosCluster. */ + class AnthosCluster implements IAnthosCluster { + + /** + * Constructs a new AnthosCluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IAnthosCluster); + + /** AnthosCluster membership. */ + public membership: string; + + /** + * Creates a new AnthosCluster instance using the specified properties. + * @param [properties] Properties to set + * @returns AnthosCluster instance + */ + public static create(properties?: google.cloud.deploy.v1.IAnthosCluster): google.cloud.deploy.v1.AnthosCluster; + + /** + * Encodes the specified AnthosCluster message. Does not implicitly {@link google.cloud.deploy.v1.AnthosCluster.verify|verify} messages. + * @param message AnthosCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IAnthosCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnthosCluster message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AnthosCluster.verify|verify} messages. + * @param message AnthosCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IAnthosCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnthosCluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnthosCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.AnthosCluster; + + /** + * Decodes an AnthosCluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnthosCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.AnthosCluster; + + /** + * Verifies an AnthosCluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnthosCluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnthosCluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.AnthosCluster; + + /** + * Creates a plain object from an AnthosCluster message. Also converts values to other types if specified. + * @param message AnthosCluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.AnthosCluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnthosCluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnthosCluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudRunLocation. */ + interface ICloudRunLocation { + + /** CloudRunLocation location */ + location?: (string|null); + } + + /** Represents a CloudRunLocation. */ + class CloudRunLocation implements ICloudRunLocation { + + /** + * Constructs a new CloudRunLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICloudRunLocation); + + /** CloudRunLocation location. */ + public location: string; + + /** + * Creates a new CloudRunLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudRunLocation instance + */ + public static create(properties?: google.cloud.deploy.v1.ICloudRunLocation): google.cloud.deploy.v1.CloudRunLocation; + + /** + * Encodes the specified CloudRunLocation message. Does not implicitly {@link google.cloud.deploy.v1.CloudRunLocation.verify|verify} messages. + * @param message CloudRunLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICloudRunLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudRunLocation message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CloudRunLocation.verify|verify} messages. + * @param message CloudRunLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICloudRunLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudRunLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudRunLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CloudRunLocation; + + /** + * Decodes a CloudRunLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudRunLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CloudRunLocation; + + /** + * Verifies a CloudRunLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudRunLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudRunLocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CloudRunLocation; + + /** + * Creates a plain object from a CloudRunLocation message. Also converts values to other types if specified. + * @param message CloudRunLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CloudRunLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudRunLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudRunLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTargetsRequest. */ + interface IListTargetsRequest { + + /** ListTargetsRequest parent */ + parent?: (string|null); + + /** ListTargetsRequest pageSize */ + pageSize?: (number|null); + + /** ListTargetsRequest pageToken */ + pageToken?: (string|null); + + /** ListTargetsRequest filter */ + filter?: (string|null); + + /** ListTargetsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListTargetsRequest. */ + class ListTargetsRequest implements IListTargetsRequest { + + /** + * Constructs a new ListTargetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListTargetsRequest); + + /** ListTargetsRequest parent. */ + public parent: string; + + /** ListTargetsRequest pageSize. */ + public pageSize: number; + + /** ListTargetsRequest pageToken. */ + public pageToken: string; + + /** ListTargetsRequest filter. */ + public filter: string; + + /** ListTargetsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListTargetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetsRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IListTargetsRequest): google.cloud.deploy.v1.ListTargetsRequest; + + /** + * Encodes the specified ListTargetsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsRequest.verify|verify} messages. + * @param message ListTargetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListTargetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsRequest.verify|verify} messages. + * @param message ListTargetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListTargetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListTargetsRequest; + + /** + * Decodes a ListTargetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListTargetsRequest; + + /** + * Verifies a ListTargetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListTargetsRequest; + + /** + * Creates a plain object from a ListTargetsRequest message. Also converts values to other types if specified. + * @param message ListTargetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListTargetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTargetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTargetsResponse. */ + interface IListTargetsResponse { + + /** ListTargetsResponse targets */ + targets?: (google.cloud.deploy.v1.ITarget[]|null); + + /** ListTargetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListTargetsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListTargetsResponse. */ + class ListTargetsResponse implements IListTargetsResponse { + + /** + * Constructs a new ListTargetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListTargetsResponse); + + /** ListTargetsResponse targets. */ + public targets: google.cloud.deploy.v1.ITarget[]; + + /** ListTargetsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListTargetsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListTargetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetsResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IListTargetsResponse): google.cloud.deploy.v1.ListTargetsResponse; + + /** + * Encodes the specified ListTargetsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsResponse.verify|verify} messages. + * @param message ListTargetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListTargetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsResponse.verify|verify} messages. + * @param message ListTargetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListTargetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListTargetsResponse; + + /** + * Decodes a ListTargetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListTargetsResponse; + + /** + * Verifies a ListTargetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListTargetsResponse; + + /** + * Creates a plain object from a ListTargetsResponse message. Also converts values to other types if specified. + * @param message ListTargetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListTargetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTargetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTargetRequest. */ + interface IGetTargetRequest { + + /** GetTargetRequest name */ + name?: (string|null); + } + + /** Represents a GetTargetRequest. */ + class GetTargetRequest implements IGetTargetRequest { + + /** + * Constructs a new GetTargetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetTargetRequest); + + /** GetTargetRequest name. */ + public name: string; + + /** + * Creates a new GetTargetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTargetRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetTargetRequest): google.cloud.deploy.v1.GetTargetRequest; + + /** + * Encodes the specified GetTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetTargetRequest.verify|verify} messages. + * @param message GetTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetTargetRequest.verify|verify} messages. + * @param message GetTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTargetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetTargetRequest; + + /** + * Decodes a GetTargetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetTargetRequest; + + /** + * Verifies a GetTargetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTargetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTargetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetTargetRequest; + + /** + * Creates a plain object from a GetTargetRequest message. Also converts values to other types if specified. + * @param message GetTargetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetTargetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTargetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTargetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTargetRequest. */ + interface ICreateTargetRequest { + + /** CreateTargetRequest parent */ + parent?: (string|null); + + /** CreateTargetRequest targetId */ + targetId?: (string|null); + + /** CreateTargetRequest target */ + target?: (google.cloud.deploy.v1.ITarget|null); + + /** CreateTargetRequest requestId */ + requestId?: (string|null); + + /** CreateTargetRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateTargetRequest. */ + class CreateTargetRequest implements ICreateTargetRequest { + + /** + * Constructs a new CreateTargetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICreateTargetRequest); + + /** CreateTargetRequest parent. */ + public parent: string; + + /** CreateTargetRequest targetId. */ + public targetId: string; + + /** CreateTargetRequest target. */ + public target?: (google.cloud.deploy.v1.ITarget|null); + + /** CreateTargetRequest requestId. */ + public requestId: string; + + /** CreateTargetRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateTargetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTargetRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.ICreateTargetRequest): google.cloud.deploy.v1.CreateTargetRequest; + + /** + * Encodes the specified CreateTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateTargetRequest.verify|verify} messages. + * @param message CreateTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICreateTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateTargetRequest.verify|verify} messages. + * @param message CreateTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICreateTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTargetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CreateTargetRequest; + + /** + * Decodes a CreateTargetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CreateTargetRequest; + + /** + * Verifies a CreateTargetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTargetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTargetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CreateTargetRequest; + + /** + * Creates a plain object from a CreateTargetRequest message. Also converts values to other types if specified. + * @param message CreateTargetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CreateTargetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTargetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTargetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTargetRequest. */ + interface IUpdateTargetRequest { + + /** UpdateTargetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTargetRequest target */ + target?: (google.cloud.deploy.v1.ITarget|null); + + /** UpdateTargetRequest requestId */ + requestId?: (string|null); + + /** UpdateTargetRequest allowMissing */ + allowMissing?: (boolean|null); + + /** UpdateTargetRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateTargetRequest. */ + class UpdateTargetRequest implements IUpdateTargetRequest { + + /** + * Constructs a new UpdateTargetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IUpdateTargetRequest); + + /** UpdateTargetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTargetRequest target. */ + public target?: (google.cloud.deploy.v1.ITarget|null); + + /** UpdateTargetRequest requestId. */ + public requestId: string; + + /** UpdateTargetRequest allowMissing. */ + public allowMissing: boolean; + + /** UpdateTargetRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateTargetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTargetRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IUpdateTargetRequest): google.cloud.deploy.v1.UpdateTargetRequest; + + /** + * Encodes the specified UpdateTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.UpdateTargetRequest.verify|verify} messages. + * @param message UpdateTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IUpdateTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.UpdateTargetRequest.verify|verify} messages. + * @param message UpdateTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IUpdateTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTargetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.UpdateTargetRequest; + + /** + * Decodes an UpdateTargetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.UpdateTargetRequest; + + /** + * Verifies an UpdateTargetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateTargetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTargetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.UpdateTargetRequest; + + /** + * Creates a plain object from an UpdateTargetRequest message. Also converts values to other types if specified. + * @param message UpdateTargetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.UpdateTargetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTargetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTargetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTargetRequest. */ + interface IDeleteTargetRequest { + + /** DeleteTargetRequest name */ + name?: (string|null); + + /** DeleteTargetRequest requestId */ + requestId?: (string|null); + + /** DeleteTargetRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeleteTargetRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteTargetRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteTargetRequest. */ + class DeleteTargetRequest implements IDeleteTargetRequest { + + /** + * Constructs a new DeleteTargetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeleteTargetRequest); + + /** DeleteTargetRequest name. */ + public name: string; + + /** DeleteTargetRequest requestId. */ + public requestId: string; + + /** DeleteTargetRequest allowMissing. */ + public allowMissing: boolean; + + /** DeleteTargetRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteTargetRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteTargetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTargetRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeleteTargetRequest): google.cloud.deploy.v1.DeleteTargetRequest; + + /** + * Encodes the specified DeleteTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.DeleteTargetRequest.verify|verify} messages. + * @param message DeleteTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeleteTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeleteTargetRequest.verify|verify} messages. + * @param message DeleteTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeleteTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTargetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeleteTargetRequest; + + /** + * Decodes a DeleteTargetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeleteTargetRequest; + + /** + * Verifies a DeleteTargetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTargetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTargetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeleteTargetRequest; + + /** + * Creates a plain object from a DeleteTargetRequest message. Also converts values to other types if specified. + * @param message DeleteTargetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeleteTargetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTargetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTargetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Release. */ + interface IRelease { + + /** Release name */ + name?: (string|null); + + /** Release uid */ + uid?: (string|null); + + /** Release description */ + description?: (string|null); + + /** Release annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Release labels */ + labels?: ({ [k: string]: string }|null); + + /** Release abandoned */ + abandoned?: (boolean|null); + + /** Release createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Release renderStartTime */ + renderStartTime?: (google.protobuf.ITimestamp|null); + + /** Release renderEndTime */ + renderEndTime?: (google.protobuf.ITimestamp|null); + + /** Release skaffoldConfigUri */ + skaffoldConfigUri?: (string|null); + + /** Release skaffoldConfigPath */ + skaffoldConfigPath?: (string|null); + + /** Release buildArtifacts */ + buildArtifacts?: (google.cloud.deploy.v1.IBuildArtifact[]|null); + + /** Release deliveryPipelineSnapshot */ + deliveryPipelineSnapshot?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** Release targetSnapshots */ + targetSnapshots?: (google.cloud.deploy.v1.ITarget[]|null); + + /** Release renderState */ + renderState?: (google.cloud.deploy.v1.Release.RenderState|keyof typeof google.cloud.deploy.v1.Release.RenderState|null); + + /** Release etag */ + etag?: (string|null); + + /** Release skaffoldVersion */ + skaffoldVersion?: (string|null); + + /** Release targetArtifacts */ + targetArtifacts?: ({ [k: string]: google.cloud.deploy.v1.ITargetArtifact }|null); + + /** Release targetRenders */ + targetRenders?: ({ [k: string]: google.cloud.deploy.v1.Release.ITargetRender }|null); + } + + /** Represents a Release. */ + class Release implements IRelease { + + /** + * Constructs a new Release. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRelease); + + /** Release name. */ + public name: string; + + /** Release uid. */ + public uid: string; + + /** Release description. */ + public description: string; + + /** Release annotations. */ + public annotations: { [k: string]: string }; + + /** Release labels. */ + public labels: { [k: string]: string }; + + /** Release abandoned. */ + public abandoned: boolean; + + /** Release createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Release renderStartTime. */ + public renderStartTime?: (google.protobuf.ITimestamp|null); + + /** Release renderEndTime. */ + public renderEndTime?: (google.protobuf.ITimestamp|null); + + /** Release skaffoldConfigUri. */ + public skaffoldConfigUri: string; + + /** Release skaffoldConfigPath. */ + public skaffoldConfigPath: string; + + /** Release buildArtifacts. */ + public buildArtifacts: google.cloud.deploy.v1.IBuildArtifact[]; + + /** Release deliveryPipelineSnapshot. */ + public deliveryPipelineSnapshot?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** Release targetSnapshots. */ + public targetSnapshots: google.cloud.deploy.v1.ITarget[]; + + /** Release renderState. */ + public renderState: (google.cloud.deploy.v1.Release.RenderState|keyof typeof google.cloud.deploy.v1.Release.RenderState); + + /** Release etag. */ + public etag: string; + + /** Release skaffoldVersion. */ + public skaffoldVersion: string; + + /** Release targetArtifacts. */ + public targetArtifacts: { [k: string]: google.cloud.deploy.v1.ITargetArtifact }; + + /** Release targetRenders. */ + public targetRenders: { [k: string]: google.cloud.deploy.v1.Release.ITargetRender }; + + /** + * Creates a new Release instance using the specified properties. + * @param [properties] Properties to set + * @returns Release instance + */ + public static create(properties?: google.cloud.deploy.v1.IRelease): google.cloud.deploy.v1.Release; + + /** + * Encodes the specified Release message. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @param message Release message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRelease, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Release message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @param message Release message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRelease, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Release message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release; + + /** + * Decodes a Release message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release; + + /** + * Verifies a Release message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Release message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Release + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release; + + /** + * Creates a plain object from a Release message. Also converts values to other types if specified. + * @param message Release + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Release, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Release to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Release + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Release { + + /** RenderState enum. */ + enum RenderState { + RENDER_STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2, + IN_PROGRESS = 3 + } + + /** Properties of a TargetRender. */ + interface ITargetRender { + + /** TargetRender renderingBuild */ + renderingBuild?: (string|null); + + /** TargetRender renderingState */ + renderingState?: (google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|keyof typeof google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|null); + + /** TargetRender failureCause */ + failureCause?: (google.cloud.deploy.v1.Release.TargetRender.FailureCause|keyof typeof google.cloud.deploy.v1.Release.TargetRender.FailureCause|null); + + /** TargetRender failureMessage */ + failureMessage?: (string|null); + } + + /** Represents a TargetRender. */ + class TargetRender implements ITargetRender { + + /** + * Constructs a new TargetRender. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.Release.ITargetRender); + + /** TargetRender renderingBuild. */ + public renderingBuild: string; + + /** TargetRender renderingState. */ + public renderingState: (google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|keyof typeof google.cloud.deploy.v1.Release.TargetRender.TargetRenderState); + + /** TargetRender failureCause. */ + public failureCause: (google.cloud.deploy.v1.Release.TargetRender.FailureCause|keyof typeof google.cloud.deploy.v1.Release.TargetRender.FailureCause); + + /** TargetRender failureMessage. */ + public failureMessage: string; + + /** + * Creates a new TargetRender instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetRender instance + */ + public static create(properties?: google.cloud.deploy.v1.Release.ITargetRender): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Encodes the specified TargetRender message. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @param message TargetRender message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.Release.ITargetRender, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetRender message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @param message TargetRender message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.Release.ITargetRender, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetRender message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Decodes a TargetRender message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Verifies a TargetRender message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetRender message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetRender + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Creates a plain object from a TargetRender message. Also converts values to other types if specified. + * @param message TargetRender + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Release.TargetRender, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetRender to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetRender + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TargetRender { + + /** TargetRenderState enum. */ + enum TargetRenderState { + TARGET_RENDER_STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2, + IN_PROGRESS = 3 + } + + /** FailureCause enum. */ + enum FailureCause { + FAILURE_CAUSE_UNSPECIFIED = 0, + CLOUD_BUILD_UNAVAILABLE = 1, + EXECUTION_FAILED = 2 + } + } + } + + /** Properties of a BuildArtifact. */ + interface IBuildArtifact { + + /** BuildArtifact image */ + image?: (string|null); + + /** BuildArtifact tag */ + tag?: (string|null); + } + + /** Represents a BuildArtifact. */ + class BuildArtifact implements IBuildArtifact { + + /** + * Constructs a new BuildArtifact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IBuildArtifact); + + /** BuildArtifact image. */ + public image: string; + + /** BuildArtifact tag. */ + public tag: string; + + /** + * Creates a new BuildArtifact instance using the specified properties. + * @param [properties] Properties to set + * @returns BuildArtifact instance + */ + public static create(properties?: google.cloud.deploy.v1.IBuildArtifact): google.cloud.deploy.v1.BuildArtifact; + + /** + * Encodes the specified BuildArtifact message. Does not implicitly {@link google.cloud.deploy.v1.BuildArtifact.verify|verify} messages. + * @param message BuildArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IBuildArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuildArtifact message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.BuildArtifact.verify|verify} messages. + * @param message BuildArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IBuildArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuildArtifact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuildArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.BuildArtifact; + + /** + * Decodes a BuildArtifact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuildArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.BuildArtifact; + + /** + * Verifies a BuildArtifact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuildArtifact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuildArtifact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.BuildArtifact; + + /** + * Creates a plain object from a BuildArtifact message. Also converts values to other types if specified. + * @param message BuildArtifact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.BuildArtifact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuildArtifact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BuildArtifact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetArtifact. */ + interface ITargetArtifact { + + /** TargetArtifact artifactUri */ + artifactUri?: (string|null); + + /** TargetArtifact skaffoldConfigPath */ + skaffoldConfigPath?: (string|null); + + /** TargetArtifact manifestPath */ + manifestPath?: (string|null); + } + + /** Represents a TargetArtifact. */ + class TargetArtifact implements ITargetArtifact { + + /** + * Constructs a new TargetArtifact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ITargetArtifact); + + /** TargetArtifact artifactUri. */ + public artifactUri?: (string|null); + + /** TargetArtifact skaffoldConfigPath. */ + public skaffoldConfigPath: string; + + /** TargetArtifact manifestPath. */ + public manifestPath: string; + + /** TargetArtifact uri. */ + public uri?: "artifactUri"; + + /** + * Creates a new TargetArtifact instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetArtifact instance + */ + public static create(properties?: google.cloud.deploy.v1.ITargetArtifact): google.cloud.deploy.v1.TargetArtifact; + + /** + * Encodes the specified TargetArtifact message. Does not implicitly {@link google.cloud.deploy.v1.TargetArtifact.verify|verify} messages. + * @param message TargetArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ITargetArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetArtifact message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetArtifact.verify|verify} messages. + * @param message TargetArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ITargetArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetArtifact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.TargetArtifact; + + /** + * Decodes a TargetArtifact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.TargetArtifact; + + /** + * Verifies a TargetArtifact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetArtifact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetArtifact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.TargetArtifact; + + /** + * Creates a plain object from a TargetArtifact message. Also converts values to other types if specified. + * @param message TargetArtifact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.TargetArtifact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetArtifact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetArtifact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReleasesRequest. */ + interface IListReleasesRequest { + + /** ListReleasesRequest parent */ + parent?: (string|null); + + /** ListReleasesRequest pageSize */ + pageSize?: (number|null); + + /** ListReleasesRequest pageToken */ + pageToken?: (string|null); + + /** ListReleasesRequest filter */ + filter?: (string|null); + + /** ListReleasesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListReleasesRequest. */ + class ListReleasesRequest implements IListReleasesRequest { + + /** + * Constructs a new ListReleasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListReleasesRequest); + + /** ListReleasesRequest parent. */ + public parent: string; + + /** ListReleasesRequest pageSize. */ + public pageSize: number; + + /** ListReleasesRequest pageToken. */ + public pageToken: string; + + /** ListReleasesRequest filter. */ + public filter: string; + + /** ListReleasesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListReleasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReleasesRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IListReleasesRequest): google.cloud.deploy.v1.ListReleasesRequest; + + /** + * Encodes the specified ListReleasesRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesRequest.verify|verify} messages. + * @param message ListReleasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListReleasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReleasesRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesRequest.verify|verify} messages. + * @param message ListReleasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListReleasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReleasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReleasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListReleasesRequest; + + /** + * Decodes a ListReleasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReleasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListReleasesRequest; + + /** + * Verifies a ListReleasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReleasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReleasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListReleasesRequest; + + /** + * Creates a plain object from a ListReleasesRequest message. Also converts values to other types if specified. + * @param message ListReleasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListReleasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReleasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReleasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReleasesResponse. */ + interface IListReleasesResponse { + + /** ListReleasesResponse releases */ + releases?: (google.cloud.deploy.v1.IRelease[]|null); + + /** ListReleasesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListReleasesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListReleasesResponse. */ + class ListReleasesResponse implements IListReleasesResponse { + + /** + * Constructs a new ListReleasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListReleasesResponse); + + /** ListReleasesResponse releases. */ + public releases: google.cloud.deploy.v1.IRelease[]; + + /** ListReleasesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListReleasesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListReleasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReleasesResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IListReleasesResponse): google.cloud.deploy.v1.ListReleasesResponse; + + /** + * Encodes the specified ListReleasesResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesResponse.verify|verify} messages. + * @param message ListReleasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListReleasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReleasesResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesResponse.verify|verify} messages. + * @param message ListReleasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListReleasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReleasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReleasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListReleasesResponse; + + /** + * Decodes a ListReleasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReleasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListReleasesResponse; + + /** + * Verifies a ListReleasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReleasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReleasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListReleasesResponse; + + /** + * Creates a plain object from a ListReleasesResponse message. Also converts values to other types if specified. + * @param message ListReleasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListReleasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReleasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReleasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetReleaseRequest. */ + interface IGetReleaseRequest { + + /** GetReleaseRequest name */ + name?: (string|null); + } + + /** Represents a GetReleaseRequest. */ + class GetReleaseRequest implements IGetReleaseRequest { + + /** + * Constructs a new GetReleaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetReleaseRequest); + + /** GetReleaseRequest name. */ + public name: string; + + /** + * Creates a new GetReleaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetReleaseRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetReleaseRequest): google.cloud.deploy.v1.GetReleaseRequest; + + /** + * Encodes the specified GetReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetReleaseRequest.verify|verify} messages. + * @param message GetReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetReleaseRequest.verify|verify} messages. + * @param message GetReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetReleaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetReleaseRequest; + + /** + * Decodes a GetReleaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetReleaseRequest; + + /** + * Verifies a GetReleaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetReleaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetReleaseRequest; + + /** + * Creates a plain object from a GetReleaseRequest message. Also converts values to other types if specified. + * @param message GetReleaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetReleaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetReleaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetReleaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateReleaseRequest. */ + interface ICreateReleaseRequest { + + /** CreateReleaseRequest parent */ + parent?: (string|null); + + /** CreateReleaseRequest releaseId */ + releaseId?: (string|null); + + /** CreateReleaseRequest release */ + release?: (google.cloud.deploy.v1.IRelease|null); + + /** CreateReleaseRequest requestId */ + requestId?: (string|null); + + /** CreateReleaseRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateReleaseRequest. */ + class CreateReleaseRequest implements ICreateReleaseRequest { + + /** + * Constructs a new CreateReleaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICreateReleaseRequest); + + /** CreateReleaseRequest parent. */ + public parent: string; + + /** CreateReleaseRequest releaseId. */ + public releaseId: string; + + /** CreateReleaseRequest release. */ + public release?: (google.cloud.deploy.v1.IRelease|null); + + /** CreateReleaseRequest requestId. */ + public requestId: string; + + /** CreateReleaseRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateReleaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReleaseRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.ICreateReleaseRequest): google.cloud.deploy.v1.CreateReleaseRequest; + + /** + * Encodes the specified CreateReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateReleaseRequest.verify|verify} messages. + * @param message CreateReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICreateReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateReleaseRequest.verify|verify} messages. + * @param message CreateReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICreateReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReleaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CreateReleaseRequest; + + /** + * Decodes a CreateReleaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CreateReleaseRequest; + + /** + * Verifies a CreateReleaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReleaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CreateReleaseRequest; + + /** + * Creates a plain object from a CreateReleaseRequest message. Also converts values to other types if specified. + * @param message CreateReleaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CreateReleaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReleaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateReleaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Rollout. */ + interface IRollout { + + /** Rollout name */ + name?: (string|null); + + /** Rollout uid */ + uid?: (string|null); + + /** Rollout description */ + description?: (string|null); + + /** Rollout annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Rollout labels */ + labels?: ({ [k: string]: string }|null); + + /** Rollout createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Rollout approveTime */ + approveTime?: (google.protobuf.ITimestamp|null); + + /** Rollout enqueueTime */ + enqueueTime?: (google.protobuf.ITimestamp|null); + + /** Rollout deployStartTime */ + deployStartTime?: (google.protobuf.ITimestamp|null); + + /** Rollout deployEndTime */ + deployEndTime?: (google.protobuf.ITimestamp|null); + + /** Rollout targetId */ + targetId?: (string|null); + + /** Rollout approvalState */ + approvalState?: (google.cloud.deploy.v1.Rollout.ApprovalState|keyof typeof google.cloud.deploy.v1.Rollout.ApprovalState|null); + + /** Rollout state */ + state?: (google.cloud.deploy.v1.Rollout.State|keyof typeof google.cloud.deploy.v1.Rollout.State|null); + + /** Rollout failureReason */ + failureReason?: (string|null); + + /** Rollout deployingBuild */ + deployingBuild?: (string|null); + + /** Rollout etag */ + etag?: (string|null); + + /** Rollout deployFailureCause */ + deployFailureCause?: (google.cloud.deploy.v1.Rollout.FailureCause|keyof typeof google.cloud.deploy.v1.Rollout.FailureCause|null); + + /** Rollout phases */ + phases?: (google.cloud.deploy.v1.IPhase[]|null); + + /** Rollout metadata */ + metadata?: (google.cloud.deploy.v1.IMetadata|null); + } + + /** Represents a Rollout. */ + class Rollout implements IRollout { + + /** + * Constructs a new Rollout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRollout); + + /** Rollout name. */ + public name: string; + + /** Rollout uid. */ + public uid: string; + + /** Rollout description. */ + public description: string; + + /** Rollout annotations. */ + public annotations: { [k: string]: string }; + + /** Rollout labels. */ + public labels: { [k: string]: string }; + + /** Rollout createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Rollout approveTime. */ + public approveTime?: (google.protobuf.ITimestamp|null); + + /** Rollout enqueueTime. */ + public enqueueTime?: (google.protobuf.ITimestamp|null); + + /** Rollout deployStartTime. */ + public deployStartTime?: (google.protobuf.ITimestamp|null); + + /** Rollout deployEndTime. */ + public deployEndTime?: (google.protobuf.ITimestamp|null); + + /** Rollout targetId. */ + public targetId: string; + + /** Rollout approvalState. */ + public approvalState: (google.cloud.deploy.v1.Rollout.ApprovalState|keyof typeof google.cloud.deploy.v1.Rollout.ApprovalState); + + /** Rollout state. */ + public state: (google.cloud.deploy.v1.Rollout.State|keyof typeof google.cloud.deploy.v1.Rollout.State); + + /** Rollout failureReason. */ + public failureReason: string; + + /** Rollout deployingBuild. */ + public deployingBuild: string; + + /** Rollout etag. */ + public etag: string; + + /** Rollout deployFailureCause. */ + public deployFailureCause: (google.cloud.deploy.v1.Rollout.FailureCause|keyof typeof google.cloud.deploy.v1.Rollout.FailureCause); + + /** Rollout phases. */ + public phases: google.cloud.deploy.v1.IPhase[]; + + /** Rollout metadata. */ + public metadata?: (google.cloud.deploy.v1.IMetadata|null); + + /** + * Creates a new Rollout instance using the specified properties. + * @param [properties] Properties to set + * @returns Rollout instance + */ + public static create(properties?: google.cloud.deploy.v1.IRollout): google.cloud.deploy.v1.Rollout; + + /** + * Encodes the specified Rollout message. Does not implicitly {@link google.cloud.deploy.v1.Rollout.verify|verify} messages. + * @param message Rollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rollout message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Rollout.verify|verify} messages. + * @param message Rollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rollout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Rollout; + + /** + * Decodes a Rollout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Rollout; + + /** + * Verifies a Rollout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Rollout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rollout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Rollout; + + /** + * Creates a plain object from a Rollout message. Also converts values to other types if specified. + * @param message Rollout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Rollout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rollout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Rollout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Rollout { + + /** ApprovalState enum. */ + enum ApprovalState { + APPROVAL_STATE_UNSPECIFIED = 0, + NEEDS_APPROVAL = 1, + DOES_NOT_NEED_APPROVAL = 2, + APPROVED = 3, + REJECTED = 4 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2, + IN_PROGRESS = 3, + PENDING_APPROVAL = 4, + APPROVAL_REJECTED = 5, + PENDING = 6, + PENDING_RELEASE = 7 + } + + /** FailureCause enum. */ + enum FailureCause { + FAILURE_CAUSE_UNSPECIFIED = 0, + CLOUD_BUILD_UNAVAILABLE = 1, + EXECUTION_FAILED = 2, + DEADLINE_EXCEEDED = 3, + RELEASE_FAILED = 4, + RELEASE_ABANDONED = 5, + VERIFICATION_CONFIG_NOT_FOUND = 6 + } + } + + /** Properties of a Metadata. */ + interface IMetadata { + + /** Metadata cloudRun */ + cloudRun?: (google.cloud.deploy.v1.ICloudRunMetadata|null); + } + + /** Represents a Metadata. */ + class Metadata implements IMetadata { + + /** + * Constructs a new Metadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IMetadata); + + /** Metadata cloudRun. */ + public cloudRun?: (google.cloud.deploy.v1.ICloudRunMetadata|null); + + /** + * Creates a new Metadata instance using the specified properties. + * @param [properties] Properties to set + * @returns Metadata instance + */ + public static create(properties?: google.cloud.deploy.v1.IMetadata): google.cloud.deploy.v1.Metadata; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.deploy.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Metadata; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Metadata; + + /** + * Verifies a Metadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Metadata; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @param message Metadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployJobRunMetadata. */ + interface IDeployJobRunMetadata { + + /** DeployJobRunMetadata cloudRun */ + cloudRun?: (google.cloud.deploy.v1.ICloudRunMetadata|null); + } + + /** Represents a DeployJobRunMetadata. */ + class DeployJobRunMetadata implements IDeployJobRunMetadata { + + /** + * Constructs a new DeployJobRunMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeployJobRunMetadata); + + /** DeployJobRunMetadata cloudRun. */ + public cloudRun?: (google.cloud.deploy.v1.ICloudRunMetadata|null); + + /** + * Creates a new DeployJobRunMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployJobRunMetadata instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeployJobRunMetadata): google.cloud.deploy.v1.DeployJobRunMetadata; + + /** + * Encodes the specified DeployJobRunMetadata message. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRunMetadata.verify|verify} messages. + * @param message DeployJobRunMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeployJobRunMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployJobRunMetadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRunMetadata.verify|verify} messages. + * @param message DeployJobRunMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeployJobRunMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployJobRunMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployJobRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeployJobRunMetadata; + + /** + * Decodes a DeployJobRunMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployJobRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeployJobRunMetadata; + + /** + * Verifies a DeployJobRunMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployJobRunMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployJobRunMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeployJobRunMetadata; + + /** + * Creates a plain object from a DeployJobRunMetadata message. Also converts values to other types if specified. + * @param message DeployJobRunMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeployJobRunMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployJobRunMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployJobRunMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudRunMetadata. */ + interface ICloudRunMetadata { + + /** CloudRunMetadata service */ + service?: (string|null); + + /** CloudRunMetadata serviceUrls */ + serviceUrls?: (string[]|null); + + /** CloudRunMetadata revision */ + revision?: (string|null); + } + + /** Represents a CloudRunMetadata. */ + class CloudRunMetadata implements ICloudRunMetadata { + + /** + * Constructs a new CloudRunMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICloudRunMetadata); + + /** CloudRunMetadata service. */ + public service: string; + + /** CloudRunMetadata serviceUrls. */ + public serviceUrls: string[]; + + /** CloudRunMetadata revision. */ + public revision: string; + + /** + * Creates a new CloudRunMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudRunMetadata instance + */ + public static create(properties?: google.cloud.deploy.v1.ICloudRunMetadata): google.cloud.deploy.v1.CloudRunMetadata; + + /** + * Encodes the specified CloudRunMetadata message. Does not implicitly {@link google.cloud.deploy.v1.CloudRunMetadata.verify|verify} messages. + * @param message CloudRunMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICloudRunMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudRunMetadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CloudRunMetadata.verify|verify} messages. + * @param message CloudRunMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICloudRunMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudRunMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CloudRunMetadata; + + /** + * Decodes a CloudRunMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CloudRunMetadata; + + /** + * Verifies a CloudRunMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudRunMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudRunMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CloudRunMetadata; + + /** + * Creates a plain object from a CloudRunMetadata message. Also converts values to other types if specified. + * @param message CloudRunMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CloudRunMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudRunMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudRunMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Phase. */ + interface IPhase { + + /** Phase id */ + id?: (string|null); + + /** Phase state */ + state?: (google.cloud.deploy.v1.Phase.State|keyof typeof google.cloud.deploy.v1.Phase.State|null); + + /** Phase deploymentJobs */ + deploymentJobs?: (google.cloud.deploy.v1.IDeploymentJobs|null); + } + + /** Represents a Phase. */ + class Phase implements IPhase { + + /** + * Constructs a new Phase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IPhase); + + /** Phase id. */ + public id: string; + + /** Phase state. */ + public state: (google.cloud.deploy.v1.Phase.State|keyof typeof google.cloud.deploy.v1.Phase.State); + + /** Phase deploymentJobs. */ + public deploymentJobs?: (google.cloud.deploy.v1.IDeploymentJobs|null); + + /** Phase jobs. */ + public jobs?: "deploymentJobs"; + + /** + * Creates a new Phase instance using the specified properties. + * @param [properties] Properties to set + * @returns Phase instance + */ + public static create(properties?: google.cloud.deploy.v1.IPhase): google.cloud.deploy.v1.Phase; + + /** + * Encodes the specified Phase message. Does not implicitly {@link google.cloud.deploy.v1.Phase.verify|verify} messages. + * @param message Phase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IPhase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Phase message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Phase.verify|verify} messages. + * @param message Phase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IPhase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Phase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Phase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Phase; + + /** + * Decodes a Phase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Phase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Phase; + + /** + * Verifies a Phase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Phase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Phase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Phase; + + /** + * Creates a plain object from a Phase message. Also converts values to other types if specified. + * @param message Phase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Phase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Phase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Phase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Phase { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + IN_PROGRESS = 2, + SUCCEEDED = 3, + FAILED = 4, + ABORTED = 5 + } + } + + /** Properties of a DeploymentJobs. */ + interface IDeploymentJobs { + + /** DeploymentJobs deployJob */ + deployJob?: (google.cloud.deploy.v1.IJob|null); + + /** DeploymentJobs verifyJob */ + verifyJob?: (google.cloud.deploy.v1.IJob|null); + } + + /** Represents a DeploymentJobs. */ + class DeploymentJobs implements IDeploymentJobs { + + /** + * Constructs a new DeploymentJobs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeploymentJobs); + + /** DeploymentJobs deployJob. */ + public deployJob?: (google.cloud.deploy.v1.IJob|null); + + /** DeploymentJobs verifyJob. */ + public verifyJob?: (google.cloud.deploy.v1.IJob|null); + + /** + * Creates a new DeploymentJobs instance using the specified properties. + * @param [properties] Properties to set + * @returns DeploymentJobs instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeploymentJobs): google.cloud.deploy.v1.DeploymentJobs; + + /** + * Encodes the specified DeploymentJobs message. Does not implicitly {@link google.cloud.deploy.v1.DeploymentJobs.verify|verify} messages. + * @param message DeploymentJobs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeploymentJobs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeploymentJobs message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeploymentJobs.verify|verify} messages. + * @param message DeploymentJobs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeploymentJobs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeploymentJobs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeploymentJobs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeploymentJobs; + + /** + * Decodes a DeploymentJobs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeploymentJobs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeploymentJobs; + + /** + * Verifies a DeploymentJobs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeploymentJobs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeploymentJobs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeploymentJobs; + + /** + * Creates a plain object from a DeploymentJobs message. Also converts values to other types if specified. + * @param message DeploymentJobs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeploymentJobs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeploymentJobs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeploymentJobs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Job. */ + interface IJob { + + /** Job id */ + id?: (string|null); + + /** Job state */ + state?: (google.cloud.deploy.v1.Job.State|keyof typeof google.cloud.deploy.v1.Job.State|null); + + /** Job jobRun */ + jobRun?: (string|null); + + /** Job deployJob */ + deployJob?: (google.cloud.deploy.v1.IDeployJob|null); + + /** Job verifyJob */ + verifyJob?: (google.cloud.deploy.v1.IVerifyJob|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IJob); + + /** Job id. */ + public id: string; + + /** Job state. */ + public state: (google.cloud.deploy.v1.Job.State|keyof typeof google.cloud.deploy.v1.Job.State); + + /** Job jobRun. */ + public jobRun: string; + + /** Job deployJob. */ + public deployJob?: (google.cloud.deploy.v1.IDeployJob|null); + + /** Job verifyJob. */ + public verifyJob?: (google.cloud.deploy.v1.IVerifyJob|null); + + /** Job jobType. */ + public jobType?: ("deployJob"|"verifyJob"); + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.deploy.v1.IJob): google.cloud.deploy.v1.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.deploy.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Job { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + DISABLED = 2, + IN_PROGRESS = 3, + SUCCEEDED = 4, + FAILED = 5, + ABORTED = 6 + } + } + + /** Properties of a DeployJob. */ + interface IDeployJob { + } + + /** Represents a DeployJob. */ + class DeployJob implements IDeployJob { + + /** + * Constructs a new DeployJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeployJob); + + /** + * Creates a new DeployJob instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployJob instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeployJob): google.cloud.deploy.v1.DeployJob; + + /** + * Encodes the specified DeployJob message. Does not implicitly {@link google.cloud.deploy.v1.DeployJob.verify|verify} messages. + * @param message DeployJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeployJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployJob message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJob.verify|verify} messages. + * @param message DeployJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeployJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeployJob; + + /** + * Decodes a DeployJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeployJob; + + /** + * Verifies a DeployJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeployJob; + + /** + * Creates a plain object from a DeployJob message. Also converts values to other types if specified. + * @param message DeployJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeployJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VerifyJob. */ + interface IVerifyJob { + } + + /** Represents a VerifyJob. */ + class VerifyJob implements IVerifyJob { + + /** + * Constructs a new VerifyJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IVerifyJob); + + /** + * Creates a new VerifyJob instance using the specified properties. + * @param [properties] Properties to set + * @returns VerifyJob instance + */ + public static create(properties?: google.cloud.deploy.v1.IVerifyJob): google.cloud.deploy.v1.VerifyJob; + + /** + * Encodes the specified VerifyJob message. Does not implicitly {@link google.cloud.deploy.v1.VerifyJob.verify|verify} messages. + * @param message VerifyJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IVerifyJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VerifyJob message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.VerifyJob.verify|verify} messages. + * @param message VerifyJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IVerifyJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VerifyJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VerifyJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.VerifyJob; + + /** + * Decodes a VerifyJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VerifyJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.VerifyJob; + + /** + * Verifies a VerifyJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VerifyJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VerifyJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.VerifyJob; + + /** + * Creates a plain object from a VerifyJob message. Also converts values to other types if specified. + * @param message VerifyJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.VerifyJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VerifyJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VerifyJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRolloutsRequest. */ + interface IListRolloutsRequest { + + /** ListRolloutsRequest parent */ + parent?: (string|null); + + /** ListRolloutsRequest pageSize */ + pageSize?: (number|null); + + /** ListRolloutsRequest pageToken */ + pageToken?: (string|null); + + /** ListRolloutsRequest filter */ + filter?: (string|null); + + /** ListRolloutsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListRolloutsRequest. */ + class ListRolloutsRequest implements IListRolloutsRequest { + + /** + * Constructs a new ListRolloutsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListRolloutsRequest); + + /** ListRolloutsRequest parent. */ + public parent: string; + + /** ListRolloutsRequest pageSize. */ + public pageSize: number; + + /** ListRolloutsRequest pageToken. */ + public pageToken: string; + + /** ListRolloutsRequest filter. */ + public filter: string; + + /** ListRolloutsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListRolloutsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRolloutsRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IListRolloutsRequest): google.cloud.deploy.v1.ListRolloutsRequest; + + /** + * Encodes the specified ListRolloutsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsRequest.verify|verify} messages. + * @param message ListRolloutsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListRolloutsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRolloutsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsRequest.verify|verify} messages. + * @param message ListRolloutsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListRolloutsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRolloutsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRolloutsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListRolloutsRequest; + + /** + * Decodes a ListRolloutsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRolloutsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListRolloutsRequest; + + /** + * Verifies a ListRolloutsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRolloutsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRolloutsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListRolloutsRequest; + + /** + * Creates a plain object from a ListRolloutsRequest message. Also converts values to other types if specified. + * @param message ListRolloutsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListRolloutsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRolloutsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRolloutsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRolloutsResponse. */ + interface IListRolloutsResponse { + + /** ListRolloutsResponse rollouts */ + rollouts?: (google.cloud.deploy.v1.IRollout[]|null); + + /** ListRolloutsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListRolloutsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListRolloutsResponse. */ + class ListRolloutsResponse implements IListRolloutsResponse { + + /** + * Constructs a new ListRolloutsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListRolloutsResponse); + + /** ListRolloutsResponse rollouts. */ + public rollouts: google.cloud.deploy.v1.IRollout[]; + + /** ListRolloutsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListRolloutsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListRolloutsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRolloutsResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IListRolloutsResponse): google.cloud.deploy.v1.ListRolloutsResponse; + + /** + * Encodes the specified ListRolloutsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsResponse.verify|verify} messages. + * @param message ListRolloutsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListRolloutsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRolloutsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsResponse.verify|verify} messages. + * @param message ListRolloutsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListRolloutsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRolloutsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRolloutsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListRolloutsResponse; + + /** + * Decodes a ListRolloutsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRolloutsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListRolloutsResponse; + + /** + * Verifies a ListRolloutsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRolloutsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRolloutsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListRolloutsResponse; + + /** + * Creates a plain object from a ListRolloutsResponse message. Also converts values to other types if specified. + * @param message ListRolloutsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListRolloutsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRolloutsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRolloutsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRolloutRequest. */ + interface IGetRolloutRequest { + + /** GetRolloutRequest name */ + name?: (string|null); + } + + /** Represents a GetRolloutRequest. */ + class GetRolloutRequest implements IGetRolloutRequest { + + /** + * Constructs a new GetRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetRolloutRequest); + + /** GetRolloutRequest name. */ + public name: string; + + /** + * Creates a new GetRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRolloutRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetRolloutRequest): google.cloud.deploy.v1.GetRolloutRequest; + + /** + * Encodes the specified GetRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetRolloutRequest.verify|verify} messages. + * @param message GetRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetRolloutRequest.verify|verify} messages. + * @param message GetRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetRolloutRequest; + + /** + * Decodes a GetRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetRolloutRequest; + + /** + * Verifies a GetRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetRolloutRequest; + + /** + * Creates a plain object from a GetRolloutRequest message. Also converts values to other types if specified. + * @param message GetRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateRolloutRequest. */ + interface ICreateRolloutRequest { + + /** CreateRolloutRequest parent */ + parent?: (string|null); + + /** CreateRolloutRequest rolloutId */ + rolloutId?: (string|null); + + /** CreateRolloutRequest rollout */ + rollout?: (google.cloud.deploy.v1.IRollout|null); + + /** CreateRolloutRequest requestId */ + requestId?: (string|null); + + /** CreateRolloutRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateRolloutRequest. */ + class CreateRolloutRequest implements ICreateRolloutRequest { + + /** + * Constructs a new CreateRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICreateRolloutRequest); + + /** CreateRolloutRequest parent. */ + public parent: string; + + /** CreateRolloutRequest rolloutId. */ + public rolloutId: string; + + /** CreateRolloutRequest rollout. */ + public rollout?: (google.cloud.deploy.v1.IRollout|null); + + /** CreateRolloutRequest requestId. */ + public requestId: string; + + /** CreateRolloutRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRolloutRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.ICreateRolloutRequest): google.cloud.deploy.v1.CreateRolloutRequest; + + /** + * Encodes the specified CreateRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateRolloutRequest.verify|verify} messages. + * @param message CreateRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICreateRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateRolloutRequest.verify|verify} messages. + * @param message CreateRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICreateRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CreateRolloutRequest; + + /** + * Decodes a CreateRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CreateRolloutRequest; + + /** + * Verifies a CreateRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CreateRolloutRequest; + + /** + * Creates a plain object from a CreateRolloutRequest message. Also converts values to other types if specified. + * @param message CreateRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CreateRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.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.deploy.v1.IOperationMetadata): google.cloud.deploy.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.deploy.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.deploy.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.deploy.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.deploy.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.deploy.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.deploy.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.deploy.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.deploy.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 an ApproveRolloutRequest. */ + interface IApproveRolloutRequest { + + /** ApproveRolloutRequest name */ + name?: (string|null); + + /** ApproveRolloutRequest approved */ + approved?: (boolean|null); + } + + /** Represents an ApproveRolloutRequest. */ + class ApproveRolloutRequest implements IApproveRolloutRequest { + + /** + * Constructs a new ApproveRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IApproveRolloutRequest); + + /** ApproveRolloutRequest name. */ + public name: string; + + /** ApproveRolloutRequest approved. */ + public approved: boolean; + + /** + * Creates a new ApproveRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApproveRolloutRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IApproveRolloutRequest): google.cloud.deploy.v1.ApproveRolloutRequest; + + /** + * Encodes the specified ApproveRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutRequest.verify|verify} messages. + * @param message ApproveRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IApproveRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApproveRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutRequest.verify|verify} messages. + * @param message ApproveRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IApproveRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApproveRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApproveRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ApproveRolloutRequest; + + /** + * Decodes an ApproveRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApproveRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ApproveRolloutRequest; + + /** + * Verifies an ApproveRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApproveRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApproveRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ApproveRolloutRequest; + + /** + * Creates a plain object from an ApproveRolloutRequest message. Also converts values to other types if specified. + * @param message ApproveRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ApproveRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApproveRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApproveRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApproveRolloutResponse. */ + interface IApproveRolloutResponse { + } + + /** Represents an ApproveRolloutResponse. */ + class ApproveRolloutResponse implements IApproveRolloutResponse { + + /** + * Constructs a new ApproveRolloutResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IApproveRolloutResponse); + + /** + * Creates a new ApproveRolloutResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ApproveRolloutResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IApproveRolloutResponse): google.cloud.deploy.v1.ApproveRolloutResponse; + + /** + * Encodes the specified ApproveRolloutResponse message. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutResponse.verify|verify} messages. + * @param message ApproveRolloutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IApproveRolloutResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApproveRolloutResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutResponse.verify|verify} messages. + * @param message ApproveRolloutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IApproveRolloutResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApproveRolloutResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApproveRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ApproveRolloutResponse; + + /** + * Decodes an ApproveRolloutResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApproveRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ApproveRolloutResponse; + + /** + * Verifies an ApproveRolloutResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApproveRolloutResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApproveRolloutResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ApproveRolloutResponse; + + /** + * Creates a plain object from an ApproveRolloutResponse message. Also converts values to other types if specified. + * @param message ApproveRolloutResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ApproveRolloutResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApproveRolloutResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApproveRolloutResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetryJobRequest. */ + interface IRetryJobRequest { + + /** RetryJobRequest rollout */ + rollout?: (string|null); + + /** RetryJobRequest phaseId */ + phaseId?: (string|null); + + /** RetryJobRequest jobId */ + jobId?: (string|null); + } + + /** Represents a RetryJobRequest. */ + class RetryJobRequest implements IRetryJobRequest { + + /** + * Constructs a new RetryJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRetryJobRequest); + + /** RetryJobRequest rollout. */ + public rollout: string; + + /** RetryJobRequest phaseId. */ + public phaseId: string; + + /** RetryJobRequest jobId. */ + public jobId: string; + + /** + * Creates a new RetryJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetryJobRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IRetryJobRequest): google.cloud.deploy.v1.RetryJobRequest; + + /** + * Encodes the specified RetryJobRequest message. Does not implicitly {@link google.cloud.deploy.v1.RetryJobRequest.verify|verify} messages. + * @param message RetryJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRetryJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetryJobRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RetryJobRequest.verify|verify} messages. + * @param message RetryJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRetryJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetryJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetryJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.RetryJobRequest; + + /** + * Decodes a RetryJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetryJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.RetryJobRequest; + + /** + * Verifies a RetryJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetryJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetryJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.RetryJobRequest; + + /** + * Creates a plain object from a RetryJobRequest message. Also converts values to other types if specified. + * @param message RetryJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.RetryJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetryJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetryJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetryJobResponse. */ + interface IRetryJobResponse { + } + + /** Represents a RetryJobResponse. */ + class RetryJobResponse implements IRetryJobResponse { + + /** + * Constructs a new RetryJobResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRetryJobResponse); + + /** + * Creates a new RetryJobResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RetryJobResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IRetryJobResponse): google.cloud.deploy.v1.RetryJobResponse; + + /** + * Encodes the specified RetryJobResponse message. Does not implicitly {@link google.cloud.deploy.v1.RetryJobResponse.verify|verify} messages. + * @param message RetryJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRetryJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetryJobResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RetryJobResponse.verify|verify} messages. + * @param message RetryJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRetryJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetryJobResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetryJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.RetryJobResponse; + + /** + * Decodes a RetryJobResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetryJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.RetryJobResponse; + + /** + * Verifies a RetryJobResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetryJobResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetryJobResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.RetryJobResponse; + + /** + * Creates a plain object from a RetryJobResponse message. Also converts values to other types if specified. + * @param message RetryJobResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.RetryJobResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetryJobResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetryJobResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AbandonReleaseRequest. */ + interface IAbandonReleaseRequest { + + /** AbandonReleaseRequest name */ + name?: (string|null); + } + + /** Represents an AbandonReleaseRequest. */ + class AbandonReleaseRequest implements IAbandonReleaseRequest { + + /** + * Constructs a new AbandonReleaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IAbandonReleaseRequest); + + /** AbandonReleaseRequest name. */ + public name: string; + + /** + * Creates a new AbandonReleaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AbandonReleaseRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IAbandonReleaseRequest): google.cloud.deploy.v1.AbandonReleaseRequest; + + /** + * Encodes the specified AbandonReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseRequest.verify|verify} messages. + * @param message AbandonReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IAbandonReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AbandonReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseRequest.verify|verify} messages. + * @param message AbandonReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IAbandonReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AbandonReleaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AbandonReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.AbandonReleaseRequest; + + /** + * Decodes an AbandonReleaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AbandonReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.AbandonReleaseRequest; + + /** + * Verifies an AbandonReleaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AbandonReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AbandonReleaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.AbandonReleaseRequest; + + /** + * Creates a plain object from an AbandonReleaseRequest message. Also converts values to other types if specified. + * @param message AbandonReleaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.AbandonReleaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AbandonReleaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AbandonReleaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AbandonReleaseResponse. */ + interface IAbandonReleaseResponse { + } + + /** Represents an AbandonReleaseResponse. */ + class AbandonReleaseResponse implements IAbandonReleaseResponse { + + /** + * Constructs a new AbandonReleaseResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IAbandonReleaseResponse); + + /** + * Creates a new AbandonReleaseResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AbandonReleaseResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IAbandonReleaseResponse): google.cloud.deploy.v1.AbandonReleaseResponse; + + /** + * Encodes the specified AbandonReleaseResponse message. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseResponse.verify|verify} messages. + * @param message AbandonReleaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IAbandonReleaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AbandonReleaseResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseResponse.verify|verify} messages. + * @param message AbandonReleaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IAbandonReleaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AbandonReleaseResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AbandonReleaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.AbandonReleaseResponse; + + /** + * Decodes an AbandonReleaseResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AbandonReleaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.AbandonReleaseResponse; + + /** + * Verifies an AbandonReleaseResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AbandonReleaseResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AbandonReleaseResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.AbandonReleaseResponse; + + /** + * Creates a plain object from an AbandonReleaseResponse message. Also converts values to other types if specified. + * @param message AbandonReleaseResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.AbandonReleaseResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AbandonReleaseResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AbandonReleaseResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobRun. */ + interface IJobRun { + + /** JobRun name */ + name?: (string|null); + + /** JobRun uid */ + uid?: (string|null); + + /** JobRun phaseId */ + phaseId?: (string|null); + + /** JobRun jobId */ + jobId?: (string|null); + + /** JobRun createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** JobRun startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** JobRun endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** JobRun state */ + state?: (google.cloud.deploy.v1.JobRun.State|keyof typeof google.cloud.deploy.v1.JobRun.State|null); + + /** JobRun deployJobRun */ + deployJobRun?: (google.cloud.deploy.v1.IDeployJobRun|null); + + /** JobRun verifyJobRun */ + verifyJobRun?: (google.cloud.deploy.v1.IVerifyJobRun|null); + + /** JobRun etag */ + etag?: (string|null); + } + + /** Represents a JobRun. */ + class JobRun implements IJobRun { + + /** + * Constructs a new JobRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IJobRun); + + /** JobRun name. */ + public name: string; + + /** JobRun uid. */ + public uid: string; + + /** JobRun phaseId. */ + public phaseId: string; + + /** JobRun jobId. */ + public jobId: string; + + /** JobRun createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** JobRun startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** JobRun endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** JobRun state. */ + public state: (google.cloud.deploy.v1.JobRun.State|keyof typeof google.cloud.deploy.v1.JobRun.State); + + /** JobRun deployJobRun. */ + public deployJobRun?: (google.cloud.deploy.v1.IDeployJobRun|null); + + /** JobRun verifyJobRun. */ + public verifyJobRun?: (google.cloud.deploy.v1.IVerifyJobRun|null); + + /** JobRun etag. */ + public etag: string; + + /** JobRun jobRun. */ + public jobRun?: ("deployJobRun"|"verifyJobRun"); + + /** + * Creates a new JobRun instance using the specified properties. + * @param [properties] Properties to set + * @returns JobRun instance + */ + public static create(properties?: google.cloud.deploy.v1.IJobRun): google.cloud.deploy.v1.JobRun; + + /** + * Encodes the specified JobRun message. Does not implicitly {@link google.cloud.deploy.v1.JobRun.verify|verify} messages. + * @param message JobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.JobRun.verify|verify} messages. + * @param message JobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.JobRun; + + /** + * Decodes a JobRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.JobRun; + + /** + * Verifies a JobRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.JobRun; + + /** + * Creates a plain object from a JobRun message. Also converts values to other types if specified. + * @param message JobRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.JobRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobRun { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + IN_PROGRESS = 1, + SUCCEEDED = 2, + FAILED = 3 + } + } + + /** Properties of a DeployJobRun. */ + interface IDeployJobRun { + + /** DeployJobRun build */ + build?: (string|null); + + /** DeployJobRun failureCause */ + failureCause?: (google.cloud.deploy.v1.DeployJobRun.FailureCause|keyof typeof google.cloud.deploy.v1.DeployJobRun.FailureCause|null); + + /** DeployJobRun failureMessage */ + failureMessage?: (string|null); + + /** DeployJobRun metadata */ + metadata?: (google.cloud.deploy.v1.IDeployJobRunMetadata|null); + } + + /** Represents a DeployJobRun. */ + class DeployJobRun implements IDeployJobRun { + + /** + * Constructs a new DeployJobRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeployJobRun); + + /** DeployJobRun build. */ + public build: string; + + /** DeployJobRun failureCause. */ + public failureCause: (google.cloud.deploy.v1.DeployJobRun.FailureCause|keyof typeof google.cloud.deploy.v1.DeployJobRun.FailureCause); + + /** DeployJobRun failureMessage. */ + public failureMessage: string; + + /** DeployJobRun metadata. */ + public metadata?: (google.cloud.deploy.v1.IDeployJobRunMetadata|null); + + /** + * Creates a new DeployJobRun instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployJobRun instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeployJobRun): google.cloud.deploy.v1.DeployJobRun; + + /** + * Encodes the specified DeployJobRun message. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRun.verify|verify} messages. + * @param message DeployJobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeployJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployJobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRun.verify|verify} messages. + * @param message DeployJobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeployJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployJobRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeployJobRun; + + /** + * Decodes a DeployJobRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeployJobRun; + + /** + * Verifies a DeployJobRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployJobRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployJobRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeployJobRun; + + /** + * Creates a plain object from a DeployJobRun message. Also converts values to other types if specified. + * @param message DeployJobRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeployJobRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployJobRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployJobRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DeployJobRun { + + /** FailureCause enum. */ + enum FailureCause { + FAILURE_CAUSE_UNSPECIFIED = 0, + CLOUD_BUILD_UNAVAILABLE = 1, + EXECUTION_FAILED = 2, + DEADLINE_EXCEEDED = 3 + } + } + + /** Properties of a VerifyJobRun. */ + interface IVerifyJobRun { + + /** VerifyJobRun build */ + build?: (string|null); + + /** VerifyJobRun artifactUri */ + artifactUri?: (string|null); + + /** VerifyJobRun eventLogPath */ + eventLogPath?: (string|null); + + /** VerifyJobRun failureCause */ + failureCause?: (google.cloud.deploy.v1.VerifyJobRun.FailureCause|keyof typeof google.cloud.deploy.v1.VerifyJobRun.FailureCause|null); + + /** VerifyJobRun failureMessage */ + failureMessage?: (string|null); + } + + /** Represents a VerifyJobRun. */ + class VerifyJobRun implements IVerifyJobRun { + + /** + * Constructs a new VerifyJobRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IVerifyJobRun); + + /** VerifyJobRun build. */ + public build: string; + + /** VerifyJobRun artifactUri. */ + public artifactUri: string; + + /** VerifyJobRun eventLogPath. */ + public eventLogPath: string; + + /** VerifyJobRun failureCause. */ + public failureCause: (google.cloud.deploy.v1.VerifyJobRun.FailureCause|keyof typeof google.cloud.deploy.v1.VerifyJobRun.FailureCause); + + /** VerifyJobRun failureMessage. */ + public failureMessage: string; + + /** + * Creates a new VerifyJobRun instance using the specified properties. + * @param [properties] Properties to set + * @returns VerifyJobRun instance + */ + public static create(properties?: google.cloud.deploy.v1.IVerifyJobRun): google.cloud.deploy.v1.VerifyJobRun; + + /** + * Encodes the specified VerifyJobRun message. Does not implicitly {@link google.cloud.deploy.v1.VerifyJobRun.verify|verify} messages. + * @param message VerifyJobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IVerifyJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VerifyJobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.VerifyJobRun.verify|verify} messages. + * @param message VerifyJobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IVerifyJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VerifyJobRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VerifyJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.VerifyJobRun; + + /** + * Decodes a VerifyJobRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VerifyJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.VerifyJobRun; + + /** + * Verifies a VerifyJobRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VerifyJobRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VerifyJobRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.VerifyJobRun; + + /** + * Creates a plain object from a VerifyJobRun message. Also converts values to other types if specified. + * @param message VerifyJobRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.VerifyJobRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VerifyJobRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VerifyJobRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VerifyJobRun { + + /** FailureCause enum. */ + enum FailureCause { + FAILURE_CAUSE_UNSPECIFIED = 0, + CLOUD_BUILD_UNAVAILABLE = 1, + EXECUTION_FAILED = 2, + DEADLINE_EXCEEDED = 3, + VERIFICATION_CONFIG_NOT_FOUND = 4 + } + } + + /** Properties of a ListJobRunsRequest. */ + interface IListJobRunsRequest { + + /** ListJobRunsRequest parent */ + parent?: (string|null); + + /** ListJobRunsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListJobRunsRequest filter */ + filter?: (string|null); + + /** ListJobRunsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListJobRunsRequest. */ + class ListJobRunsRequest implements IListJobRunsRequest { + + /** + * Constructs a new ListJobRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListJobRunsRequest); + + /** ListJobRunsRequest parent. */ + public parent: string; + + /** ListJobRunsRequest pageSize. */ + public pageSize: number; + + /** ListJobRunsRequest pageToken. */ + public pageToken: string; + + /** ListJobRunsRequest filter. */ + public filter: string; + + /** ListJobRunsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListJobRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobRunsRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IListJobRunsRequest): google.cloud.deploy.v1.ListJobRunsRequest; + + /** + * Encodes the specified ListJobRunsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsRequest.verify|verify} messages. + * @param message ListJobRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListJobRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobRunsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsRequest.verify|verify} messages. + * @param message ListJobRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListJobRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListJobRunsRequest; + + /** + * Decodes a ListJobRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListJobRunsRequest; + + /** + * Verifies a ListJobRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListJobRunsRequest; + + /** + * Creates a plain object from a ListJobRunsRequest message. Also converts values to other types if specified. + * @param message ListJobRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListJobRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobRunsResponse. */ + interface IListJobRunsResponse { + + /** ListJobRunsResponse jobRuns */ + jobRuns?: (google.cloud.deploy.v1.IJobRun[]|null); + + /** ListJobRunsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobRunsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListJobRunsResponse. */ + class ListJobRunsResponse implements IListJobRunsResponse { + + /** + * Constructs a new ListJobRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListJobRunsResponse); + + /** ListJobRunsResponse jobRuns. */ + public jobRuns: google.cloud.deploy.v1.IJobRun[]; + + /** ListJobRunsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobRunsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListJobRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobRunsResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IListJobRunsResponse): google.cloud.deploy.v1.ListJobRunsResponse; + + /** + * Encodes the specified ListJobRunsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsResponse.verify|verify} messages. + * @param message ListJobRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListJobRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobRunsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsResponse.verify|verify} messages. + * @param message ListJobRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListJobRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListJobRunsResponse; + + /** + * Decodes a ListJobRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListJobRunsResponse; + + /** + * Verifies a ListJobRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListJobRunsResponse; + + /** + * Creates a plain object from a ListJobRunsResponse message. Also converts values to other types if specified. + * @param message ListJobRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListJobRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRunRequest. */ + interface IGetJobRunRequest { + + /** GetJobRunRequest name */ + name?: (string|null); + } + + /** Represents a GetJobRunRequest. */ + class GetJobRunRequest implements IGetJobRunRequest { + + /** + * Constructs a new GetJobRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetJobRunRequest); + + /** GetJobRunRequest name. */ + public name: string; + + /** + * Creates a new GetJobRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRunRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetJobRunRequest): google.cloud.deploy.v1.GetJobRunRequest; + + /** + * Encodes the specified GetJobRunRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetJobRunRequest.verify|verify} messages. + * @param message GetJobRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetJobRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRunRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetJobRunRequest.verify|verify} messages. + * @param message GetJobRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetJobRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetJobRunRequest; + + /** + * Decodes a GetJobRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetJobRunRequest; + + /** + * Verifies a GetJobRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetJobRunRequest; + + /** + * Creates a plain object from a GetJobRunRequest message. Also converts values to other types if specified. + * @param message GetJobRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetJobRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Config. */ + interface IConfig { + + /** Config name */ + name?: (string|null); + + /** Config supportedVersions */ + supportedVersions?: (google.cloud.deploy.v1.ISkaffoldVersion[]|null); + + /** Config defaultSkaffoldVersion */ + defaultSkaffoldVersion?: (string|null); + } + + /** Represents a Config. */ + class Config implements IConfig { + + /** + * Constructs a new Config. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IConfig); + + /** Config name. */ + public name: string; + + /** Config supportedVersions. */ + public supportedVersions: google.cloud.deploy.v1.ISkaffoldVersion[]; + + /** Config defaultSkaffoldVersion. */ + public defaultSkaffoldVersion: string; + + /** + * Creates a new Config instance using the specified properties. + * @param [properties] Properties to set + * @returns Config instance + */ + public static create(properties?: google.cloud.deploy.v1.IConfig): google.cloud.deploy.v1.Config; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.deploy.v1.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Config message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Config; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Config; + + /** + * Verifies a Config message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Config + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Config; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @param message Config + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Config, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Config to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Config + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SkaffoldVersion. */ + interface ISkaffoldVersion { + + /** SkaffoldVersion version */ + version?: (string|null); + + /** SkaffoldVersion supportEndDate */ + supportEndDate?: (google.type.IDate|null); + } + + /** Represents a SkaffoldVersion. */ + class SkaffoldVersion implements ISkaffoldVersion { + + /** + * Constructs a new SkaffoldVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ISkaffoldVersion); + + /** SkaffoldVersion version. */ + public version: string; + + /** SkaffoldVersion supportEndDate. */ + public supportEndDate?: (google.type.IDate|null); + + /** + * Creates a new SkaffoldVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SkaffoldVersion instance + */ + public static create(properties?: google.cloud.deploy.v1.ISkaffoldVersion): google.cloud.deploy.v1.SkaffoldVersion; + + /** + * Encodes the specified SkaffoldVersion message. Does not implicitly {@link google.cloud.deploy.v1.SkaffoldVersion.verify|verify} messages. + * @param message SkaffoldVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ISkaffoldVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SkaffoldVersion message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.SkaffoldVersion.verify|verify} messages. + * @param message SkaffoldVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ISkaffoldVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SkaffoldVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SkaffoldVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.SkaffoldVersion; + + /** + * Decodes a SkaffoldVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SkaffoldVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.SkaffoldVersion; + + /** + * Verifies a SkaffoldVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SkaffoldVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SkaffoldVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.SkaffoldVersion; + + /** + * Creates a plain object from a SkaffoldVersion message. Also converts values to other types if specified. + * @param message SkaffoldVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.SkaffoldVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SkaffoldVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SkaffoldVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConfigRequest. */ + interface IGetConfigRequest { + + /** GetConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetConfigRequest. */ + class GetConfigRequest implements IGetConfigRequest { + + /** + * Constructs a new GetConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetConfigRequest); + + /** GetConfigRequest name. */ + public name: string; + + /** + * Creates a new GetConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConfigRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetConfigRequest): google.cloud.deploy.v1.GetConfigRequest; + + /** + * Encodes the specified GetConfigRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetConfigRequest.verify|verify} messages. + * @param message GetConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConfigRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetConfigRequest.verify|verify} messages. + * @param message GetConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetConfigRequest; + + /** + * Decodes a GetConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetConfigRequest; + + /** + * Verifies a GetConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetConfigRequest; + + /** + * Creates a plain object from a GetConfigRequest message. Also converts values to other types if specified. + * @param message GetConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeliveryPipelineNotificationEvent. */ + interface IDeliveryPipelineNotificationEvent { + + /** DeliveryPipelineNotificationEvent message */ + message?: (string|null); + + /** DeliveryPipelineNotificationEvent deliveryPipeline */ + deliveryPipeline?: (string|null); + + /** DeliveryPipelineNotificationEvent type */ + type?: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type|null); + } + + /** Represents a DeliveryPipelineNotificationEvent. */ + class DeliveryPipelineNotificationEvent implements IDeliveryPipelineNotificationEvent { + + /** + * Constructs a new DeliveryPipelineNotificationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent); + + /** DeliveryPipelineNotificationEvent message. */ + public message: string; + + /** DeliveryPipelineNotificationEvent deliveryPipeline. */ + public deliveryPipeline: string; + + /** DeliveryPipelineNotificationEvent type. */ + public type: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type); + + /** + * Creates a new DeliveryPipelineNotificationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns DeliveryPipelineNotificationEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent): google.cloud.deploy.v1.DeliveryPipelineNotificationEvent; + + /** + * Encodes the specified DeliveryPipelineNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * @param message DeliveryPipelineNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeliveryPipelineNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * @param message DeliveryPipelineNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeliveryPipelineNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeliveryPipelineNotificationEvent; + + /** + * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeliveryPipelineNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeliveryPipelineNotificationEvent; + + /** + * Verifies a DeliveryPipelineNotificationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeliveryPipelineNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeliveryPipelineNotificationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeliveryPipelineNotificationEvent; + + /** + * Creates a plain object from a DeliveryPipelineNotificationEvent message. Also converts values to other types if specified. + * @param message DeliveryPipelineNotificationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeliveryPipelineNotificationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeliveryPipelineNotificationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeliveryPipelineNotificationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + TYPE_PUBSUB_NOTIFICATION_FAILURE = 1, + TYPE_RENDER_STATUES_CHANGE = 2 + } + + /** Properties of a JobRunNotificationEvent. */ + interface IJobRunNotificationEvent { + + /** JobRunNotificationEvent message */ + message?: (string|null); + + /** JobRunNotificationEvent jobRun */ + jobRun?: (string|null); + + /** JobRunNotificationEvent pipelineUid */ + pipelineUid?: (string|null); + + /** JobRunNotificationEvent releaseUid */ + releaseUid?: (string|null); + + /** JobRunNotificationEvent rolloutUid */ + rolloutUid?: (string|null); + + /** JobRunNotificationEvent targetId */ + targetId?: (string|null); + + /** JobRunNotificationEvent type */ + type?: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type|null); + } + + /** Represents a JobRunNotificationEvent. */ + class JobRunNotificationEvent implements IJobRunNotificationEvent { + + /** + * Constructs a new JobRunNotificationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IJobRunNotificationEvent); + + /** JobRunNotificationEvent message. */ + public message: string; + + /** JobRunNotificationEvent jobRun. */ + public jobRun: string; + + /** JobRunNotificationEvent pipelineUid. */ + public pipelineUid: string; + + /** JobRunNotificationEvent releaseUid. */ + public releaseUid: string; + + /** JobRunNotificationEvent rolloutUid. */ + public rolloutUid: string; + + /** JobRunNotificationEvent targetId. */ + public targetId: string; + + /** JobRunNotificationEvent type. */ + public type: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type); + + /** + * Creates a new JobRunNotificationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns JobRunNotificationEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.IJobRunNotificationEvent): google.cloud.deploy.v1.JobRunNotificationEvent; + + /** + * Encodes the specified JobRunNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.JobRunNotificationEvent.verify|verify} messages. + * @param message JobRunNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IJobRunNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobRunNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.JobRunNotificationEvent.verify|verify} messages. + * @param message JobRunNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IJobRunNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobRunNotificationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobRunNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.JobRunNotificationEvent; + + /** + * Decodes a JobRunNotificationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobRunNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.JobRunNotificationEvent; + + /** + * Verifies a JobRunNotificationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobRunNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobRunNotificationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.JobRunNotificationEvent; + + /** + * Creates a plain object from a JobRunNotificationEvent message. Also converts values to other types if specified. + * @param message JobRunNotificationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.JobRunNotificationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobRunNotificationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobRunNotificationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReleaseNotificationEvent. */ + interface IReleaseNotificationEvent { + + /** ReleaseNotificationEvent message */ + message?: (string|null); + + /** ReleaseNotificationEvent release */ + release?: (string|null); + + /** ReleaseNotificationEvent type */ + type?: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type|null); + } + + /** Represents a ReleaseNotificationEvent. */ + class ReleaseNotificationEvent implements IReleaseNotificationEvent { + + /** + * Constructs a new ReleaseNotificationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IReleaseNotificationEvent); + + /** ReleaseNotificationEvent message. */ + public message: string; + + /** ReleaseNotificationEvent release. */ + public release: string; + + /** ReleaseNotificationEvent type. */ + public type: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type); + + /** + * Creates a new ReleaseNotificationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns ReleaseNotificationEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.IReleaseNotificationEvent): google.cloud.deploy.v1.ReleaseNotificationEvent; + + /** + * Encodes the specified ReleaseNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.ReleaseNotificationEvent.verify|verify} messages. + * @param message ReleaseNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IReleaseNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReleaseNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ReleaseNotificationEvent.verify|verify} messages. + * @param message ReleaseNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IReleaseNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReleaseNotificationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReleaseNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ReleaseNotificationEvent; + + /** + * Decodes a ReleaseNotificationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReleaseNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ReleaseNotificationEvent; + + /** + * Verifies a ReleaseNotificationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReleaseNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReleaseNotificationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ReleaseNotificationEvent; + + /** + * Creates a plain object from a ReleaseNotificationEvent message. Also converts values to other types if specified. + * @param message ReleaseNotificationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ReleaseNotificationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReleaseNotificationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReleaseNotificationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReleaseRenderEvent. */ + interface IReleaseRenderEvent { + + /** ReleaseRenderEvent message */ + message?: (string|null); + + /** ReleaseRenderEvent release */ + release?: (string|null); + } + + /** Represents a ReleaseRenderEvent. */ + class ReleaseRenderEvent implements IReleaseRenderEvent { + + /** + * Constructs a new ReleaseRenderEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IReleaseRenderEvent); + + /** ReleaseRenderEvent message. */ + public message: string; + + /** ReleaseRenderEvent release. */ + public release: string; + + /** + * Creates a new ReleaseRenderEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns ReleaseRenderEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.IReleaseRenderEvent): google.cloud.deploy.v1.ReleaseRenderEvent; + + /** + * Encodes the specified ReleaseRenderEvent message. Does not implicitly {@link google.cloud.deploy.v1.ReleaseRenderEvent.verify|verify} messages. + * @param message ReleaseRenderEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IReleaseRenderEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReleaseRenderEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ReleaseRenderEvent.verify|verify} messages. + * @param message ReleaseRenderEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IReleaseRenderEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReleaseRenderEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReleaseRenderEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ReleaseRenderEvent; + + /** + * Decodes a ReleaseRenderEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReleaseRenderEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ReleaseRenderEvent; + + /** + * Verifies a ReleaseRenderEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReleaseRenderEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReleaseRenderEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ReleaseRenderEvent; + + /** + * Creates a plain object from a ReleaseRenderEvent message. Also converts values to other types if specified. + * @param message ReleaseRenderEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ReleaseRenderEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReleaseRenderEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReleaseRenderEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RolloutNotificationEvent. */ + interface IRolloutNotificationEvent { + + /** RolloutNotificationEvent message */ + message?: (string|null); + + /** RolloutNotificationEvent pipelineUid */ + pipelineUid?: (string|null); + + /** RolloutNotificationEvent releaseUid */ + releaseUid?: (string|null); + + /** RolloutNotificationEvent rollout */ + rollout?: (string|null); + + /** RolloutNotificationEvent type */ + type?: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type|null); + + /** RolloutNotificationEvent targetId */ + targetId?: (string|null); + } + + /** Represents a RolloutNotificationEvent. */ + class RolloutNotificationEvent implements IRolloutNotificationEvent { + + /** + * Constructs a new RolloutNotificationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRolloutNotificationEvent); + + /** RolloutNotificationEvent message. */ + public message: string; + + /** RolloutNotificationEvent pipelineUid. */ + public pipelineUid: string; + + /** RolloutNotificationEvent releaseUid. */ + public releaseUid: string; + + /** RolloutNotificationEvent rollout. */ + public rollout: string; + + /** RolloutNotificationEvent type. */ + public type: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type); + + /** RolloutNotificationEvent targetId. */ + public targetId: string; + + /** + * Creates a new RolloutNotificationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns RolloutNotificationEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.IRolloutNotificationEvent): google.cloud.deploy.v1.RolloutNotificationEvent; + + /** + * Encodes the specified RolloutNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.RolloutNotificationEvent.verify|verify} messages. + * @param message RolloutNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRolloutNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RolloutNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RolloutNotificationEvent.verify|verify} messages. + * @param message RolloutNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRolloutNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RolloutNotificationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RolloutNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.RolloutNotificationEvent; + + /** + * Decodes a RolloutNotificationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RolloutNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.RolloutNotificationEvent; + + /** + * Verifies a RolloutNotificationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RolloutNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RolloutNotificationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.RolloutNotificationEvent; + + /** + * Creates a plain object from a RolloutNotificationEvent message. Also converts values to other types if specified. + * @param message RolloutNotificationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.RolloutNotificationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RolloutNotificationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RolloutNotificationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetNotificationEvent. */ + interface ITargetNotificationEvent { + + /** TargetNotificationEvent message */ + message?: (string|null); + + /** TargetNotificationEvent target */ + target?: (string|null); + + /** TargetNotificationEvent type */ + type?: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type|null); + } + + /** Represents a TargetNotificationEvent. */ + class TargetNotificationEvent implements ITargetNotificationEvent { + + /** + * Constructs a new TargetNotificationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ITargetNotificationEvent); + + /** TargetNotificationEvent message. */ + public message: string; + + /** TargetNotificationEvent target. */ + public target: string; + + /** TargetNotificationEvent type. */ + public type: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type); + + /** + * Creates a new TargetNotificationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetNotificationEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.ITargetNotificationEvent): google.cloud.deploy.v1.TargetNotificationEvent; + + /** + * Encodes the specified TargetNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.TargetNotificationEvent.verify|verify} messages. + * @param message TargetNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ITargetNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetNotificationEvent.verify|verify} messages. + * @param message TargetNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ITargetNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetNotificationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.TargetNotificationEvent; + + /** + * Decodes a TargetNotificationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.TargetNotificationEvent; + + /** + * Verifies a TargetNotificationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetNotificationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.TargetNotificationEvent; + + /** + * Creates a plain object from a TargetNotificationEvent message. Also converts values to other types if specified. + * @param message TargetNotificationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.TargetNotificationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetNotificationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetNotificationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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; + } + } + + /** 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 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; + } + + /** 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; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @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-deploy/protos/protos.js b/packages/google-cloud-deploy/protos/protos.js new file mode 100644 index 00000000000..4ff10bf8582 --- /dev/null +++ b/packages/google-cloud-deploy/protos/protos.js @@ -0,0 +1,36309 @@ +// 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_deploy_protos || ($protobuf.roots._google_cloud_deploy_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.deploy = (function() { + + /** + * Namespace deploy. + * @memberof google.cloud + * @namespace + */ + var deploy = {}; + + deploy.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.deploy + * @namespace + */ + var v1 = {}; + + v1.CloudDeploy = (function() { + + /** + * Constructs a new CloudDeploy service. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CloudDeploy + * @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 CloudDeploy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudDeploy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudDeploy; + + /** + * Creates new CloudDeploy service using the specified rpc implementation. + * @function create + * @memberof google.cloud.deploy.v1.CloudDeploy + * @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 {CloudDeploy} RPC service. Useful where requests and/or responses are streamed. + */ + CloudDeploy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listDeliveryPipelines}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ListDeliveryPipelinesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} [response] ListDeliveryPipelinesResponse + */ + + /** + * Calls ListDeliveryPipelines. + * @function listDeliveryPipelines + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest} request ListDeliveryPipelinesRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ListDeliveryPipelinesCallback} callback Node-style callback called with the error, if any, and ListDeliveryPipelinesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.listDeliveryPipelines = function listDeliveryPipelines(request, callback) { + return this.rpcCall(listDeliveryPipelines, $root.google.cloud.deploy.v1.ListDeliveryPipelinesRequest, $root.google.cloud.deploy.v1.ListDeliveryPipelinesResponse, request, callback); + }, "name", { value: "ListDeliveryPipelines" }); + + /** + * Calls ListDeliveryPipelines. + * @function listDeliveryPipelines + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest} request ListDeliveryPipelinesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getDeliveryPipeline}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetDeliveryPipelineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.DeliveryPipeline} [response] DeliveryPipeline + */ + + /** + * Calls GetDeliveryPipeline. + * @function getDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest} request GetDeliveryPipelineRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetDeliveryPipelineCallback} callback Node-style callback called with the error, if any, and DeliveryPipeline + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getDeliveryPipeline = function getDeliveryPipeline(request, callback) { + return this.rpcCall(getDeliveryPipeline, $root.google.cloud.deploy.v1.GetDeliveryPipelineRequest, $root.google.cloud.deploy.v1.DeliveryPipeline, request, callback); + }, "name", { value: "GetDeliveryPipeline" }); + + /** + * Calls GetDeliveryPipeline. + * @function getDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest} request GetDeliveryPipelineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createDeliveryPipeline}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef CreateDeliveryPipelineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDeliveryPipeline. + * @function createDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest} request CreateDeliveryPipelineRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.CreateDeliveryPipelineCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.createDeliveryPipeline = function createDeliveryPipeline(request, callback) { + return this.rpcCall(createDeliveryPipeline, $root.google.cloud.deploy.v1.CreateDeliveryPipelineRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDeliveryPipeline" }); + + /** + * Calls CreateDeliveryPipeline. + * @function createDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest} request CreateDeliveryPipelineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|updateDeliveryPipeline}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef UpdateDeliveryPipelineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDeliveryPipeline. + * @function updateDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest} request UpdateDeliveryPipelineRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.UpdateDeliveryPipelineCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.updateDeliveryPipeline = function updateDeliveryPipeline(request, callback) { + return this.rpcCall(updateDeliveryPipeline, $root.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDeliveryPipeline" }); + + /** + * Calls UpdateDeliveryPipeline. + * @function updateDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest} request UpdateDeliveryPipelineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|deleteDeliveryPipeline}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef DeleteDeliveryPipelineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDeliveryPipeline. + * @function deleteDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest} request DeleteDeliveryPipelineRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.DeleteDeliveryPipelineCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.deleteDeliveryPipeline = function deleteDeliveryPipeline(request, callback) { + return this.rpcCall(deleteDeliveryPipeline, $root.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDeliveryPipeline" }); + + /** + * Calls DeleteDeliveryPipeline. + * @function deleteDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest} request DeleteDeliveryPipelineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listTargets}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ListTargetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ListTargetsResponse} [response] ListTargetsResponse + */ + + /** + * Calls ListTargets. + * @function listTargets + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListTargetsRequest} request ListTargetsRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ListTargetsCallback} callback Node-style callback called with the error, if any, and ListTargetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.listTargets = function listTargets(request, callback) { + return this.rpcCall(listTargets, $root.google.cloud.deploy.v1.ListTargetsRequest, $root.google.cloud.deploy.v1.ListTargetsResponse, request, callback); + }, "name", { value: "ListTargets" }); + + /** + * Calls ListTargets. + * @function listTargets + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListTargetsRequest} request ListTargetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getTarget}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetTargetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.Target} [response] Target + */ + + /** + * Calls GetTarget. + * @function getTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetTargetRequest} request GetTargetRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetTargetCallback} callback Node-style callback called with the error, if any, and Target + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getTarget = function getTarget(request, callback) { + return this.rpcCall(getTarget, $root.google.cloud.deploy.v1.GetTargetRequest, $root.google.cloud.deploy.v1.Target, request, callback); + }, "name", { value: "GetTarget" }); + + /** + * Calls GetTarget. + * @function getTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetTargetRequest} request GetTargetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createTarget}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef CreateTargetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTarget. + * @function createTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateTargetRequest} request CreateTargetRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.CreateTargetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.createTarget = function createTarget(request, callback) { + return this.rpcCall(createTarget, $root.google.cloud.deploy.v1.CreateTargetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTarget" }); + + /** + * Calls CreateTarget. + * @function createTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateTargetRequest} request CreateTargetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|updateTarget}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef UpdateTargetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateTarget. + * @function updateTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IUpdateTargetRequest} request UpdateTargetRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.UpdateTargetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.updateTarget = function updateTarget(request, callback) { + return this.rpcCall(updateTarget, $root.google.cloud.deploy.v1.UpdateTargetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTarget" }); + + /** + * Calls UpdateTarget. + * @function updateTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IUpdateTargetRequest} request UpdateTargetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|deleteTarget}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef DeleteTargetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteTarget. + * @function deleteTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IDeleteTargetRequest} request DeleteTargetRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.DeleteTargetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.deleteTarget = function deleteTarget(request, callback) { + return this.rpcCall(deleteTarget, $root.google.cloud.deploy.v1.DeleteTargetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTarget" }); + + /** + * Calls DeleteTarget. + * @function deleteTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IDeleteTargetRequest} request DeleteTargetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listReleases}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ListReleasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ListReleasesResponse} [response] ListReleasesResponse + */ + + /** + * Calls ListReleases. + * @function listReleases + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListReleasesRequest} request ListReleasesRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ListReleasesCallback} callback Node-style callback called with the error, if any, and ListReleasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.listReleases = function listReleases(request, callback) { + return this.rpcCall(listReleases, $root.google.cloud.deploy.v1.ListReleasesRequest, $root.google.cloud.deploy.v1.ListReleasesResponse, request, callback); + }, "name", { value: "ListReleases" }); + + /** + * Calls ListReleases. + * @function listReleases + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListReleasesRequest} request ListReleasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getRelease}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetReleaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.Release} [response] Release + */ + + /** + * Calls GetRelease. + * @function getRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetReleaseRequest} request GetReleaseRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetReleaseCallback} callback Node-style callback called with the error, if any, and Release + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getRelease = function getRelease(request, callback) { + return this.rpcCall(getRelease, $root.google.cloud.deploy.v1.GetReleaseRequest, $root.google.cloud.deploy.v1.Release, request, callback); + }, "name", { value: "GetRelease" }); + + /** + * Calls GetRelease. + * @function getRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetReleaseRequest} request GetReleaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createRelease}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef CreateReleaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateRelease. + * @function createRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateReleaseRequest} request CreateReleaseRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.CreateReleaseCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.createRelease = function createRelease(request, callback) { + return this.rpcCall(createRelease, $root.google.cloud.deploy.v1.CreateReleaseRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateRelease" }); + + /** + * Calls CreateRelease. + * @function createRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateReleaseRequest} request CreateReleaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|abandonRelease}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef AbandonReleaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.AbandonReleaseResponse} [response] AbandonReleaseResponse + */ + + /** + * Calls AbandonRelease. + * @function abandonRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest} request AbandonReleaseRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.AbandonReleaseCallback} callback Node-style callback called with the error, if any, and AbandonReleaseResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.abandonRelease = function abandonRelease(request, callback) { + return this.rpcCall(abandonRelease, $root.google.cloud.deploy.v1.AbandonReleaseRequest, $root.google.cloud.deploy.v1.AbandonReleaseResponse, request, callback); + }, "name", { value: "AbandonRelease" }); + + /** + * Calls AbandonRelease. + * @function abandonRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest} request AbandonReleaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|approveRollout}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ApproveRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ApproveRolloutResponse} [response] ApproveRolloutResponse + */ + + /** + * Calls ApproveRollout. + * @function approveRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IApproveRolloutRequest} request ApproveRolloutRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ApproveRolloutCallback} callback Node-style callback called with the error, if any, and ApproveRolloutResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.approveRollout = function approveRollout(request, callback) { + return this.rpcCall(approveRollout, $root.google.cloud.deploy.v1.ApproveRolloutRequest, $root.google.cloud.deploy.v1.ApproveRolloutResponse, request, callback); + }, "name", { value: "ApproveRollout" }); + + /** + * Calls ApproveRollout. + * @function approveRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IApproveRolloutRequest} request ApproveRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listRollouts}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ListRolloutsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ListRolloutsResponse} [response] ListRolloutsResponse + */ + + /** + * Calls ListRollouts. + * @function listRollouts + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListRolloutsRequest} request ListRolloutsRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ListRolloutsCallback} callback Node-style callback called with the error, if any, and ListRolloutsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.listRollouts = function listRollouts(request, callback) { + return this.rpcCall(listRollouts, $root.google.cloud.deploy.v1.ListRolloutsRequest, $root.google.cloud.deploy.v1.ListRolloutsResponse, request, callback); + }, "name", { value: "ListRollouts" }); + + /** + * Calls ListRollouts. + * @function listRollouts + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListRolloutsRequest} request ListRolloutsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getRollout}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.Rollout} [response] Rollout + */ + + /** + * Calls GetRollout. + * @function getRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetRolloutRequest} request GetRolloutRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetRolloutCallback} callback Node-style callback called with the error, if any, and Rollout + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getRollout = function getRollout(request, callback) { + return this.rpcCall(getRollout, $root.google.cloud.deploy.v1.GetRolloutRequest, $root.google.cloud.deploy.v1.Rollout, request, callback); + }, "name", { value: "GetRollout" }); + + /** + * Calls GetRollout. + * @function getRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetRolloutRequest} request GetRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createRollout}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef CreateRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateRollout. + * @function createRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateRolloutRequest} request CreateRolloutRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.CreateRolloutCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.createRollout = function createRollout(request, callback) { + return this.rpcCall(createRollout, $root.google.cloud.deploy.v1.CreateRolloutRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateRollout" }); + + /** + * Calls CreateRollout. + * @function createRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateRolloutRequest} request CreateRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|retryJob}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef RetryJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.RetryJobResponse} [response] RetryJobResponse + */ + + /** + * Calls RetryJob. + * @function retryJob + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IRetryJobRequest} request RetryJobRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.RetryJobCallback} callback Node-style callback called with the error, if any, and RetryJobResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.retryJob = function retryJob(request, callback) { + return this.rpcCall(retryJob, $root.google.cloud.deploy.v1.RetryJobRequest, $root.google.cloud.deploy.v1.RetryJobResponse, request, callback); + }, "name", { value: "RetryJob" }); + + /** + * Calls RetryJob. + * @function retryJob + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IRetryJobRequest} request RetryJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listJobRuns}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ListJobRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ListJobRunsResponse} [response] ListJobRunsResponse + */ + + /** + * Calls ListJobRuns. + * @function listJobRuns + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListJobRunsRequest} request ListJobRunsRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ListJobRunsCallback} callback Node-style callback called with the error, if any, and ListJobRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.listJobRuns = function listJobRuns(request, callback) { + return this.rpcCall(listJobRuns, $root.google.cloud.deploy.v1.ListJobRunsRequest, $root.google.cloud.deploy.v1.ListJobRunsResponse, request, callback); + }, "name", { value: "ListJobRuns" }); + + /** + * Calls ListJobRuns. + * @function listJobRuns + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListJobRunsRequest} request ListJobRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getJobRun}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetJobRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.JobRun} [response] JobRun + */ + + /** + * Calls GetJobRun. + * @function getJobRun + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetJobRunRequest} request GetJobRunRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetJobRunCallback} callback Node-style callback called with the error, if any, and JobRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getJobRun = function getJobRun(request, callback) { + return this.rpcCall(getJobRun, $root.google.cloud.deploy.v1.GetJobRunRequest, $root.google.cloud.deploy.v1.JobRun, request, callback); + }, "name", { value: "GetJobRun" }); + + /** + * Calls GetJobRun. + * @function getJobRun + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetJobRunRequest} request GetJobRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getConfig}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.Config} [response] Config + */ + + /** + * Calls GetConfig. + * @function getConfig + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetConfigRequest} request GetConfigRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetConfigCallback} callback Node-style callback called with the error, if any, and Config + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getConfig = function getConfig(request, callback) { + return this.rpcCall(getConfig, $root.google.cloud.deploy.v1.GetConfigRequest, $root.google.cloud.deploy.v1.Config, request, callback); + }, "name", { value: "GetConfig" }); + + /** + * Calls GetConfig. + * @function getConfig + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetConfigRequest} request GetConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudDeploy; + })(); + + v1.DeliveryPipeline = (function() { + + /** + * Properties of a DeliveryPipeline. + * @memberof google.cloud.deploy.v1 + * @interface IDeliveryPipeline + * @property {string|null} [name] DeliveryPipeline name + * @property {string|null} [uid] DeliveryPipeline uid + * @property {string|null} [description] DeliveryPipeline description + * @property {Object.|null} [annotations] DeliveryPipeline annotations + * @property {Object.|null} [labels] DeliveryPipeline labels + * @property {google.protobuf.ITimestamp|null} [createTime] DeliveryPipeline createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] DeliveryPipeline updateTime + * @property {google.cloud.deploy.v1.ISerialPipeline|null} [serialPipeline] DeliveryPipeline serialPipeline + * @property {google.cloud.deploy.v1.IPipelineCondition|null} [condition] DeliveryPipeline condition + * @property {string|null} [etag] DeliveryPipeline etag + * @property {boolean|null} [suspended] DeliveryPipeline suspended + */ + + /** + * Constructs a new DeliveryPipeline. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeliveryPipeline. + * @implements IDeliveryPipeline + * @constructor + * @param {google.cloud.deploy.v1.IDeliveryPipeline=} [properties] Properties to set + */ + function DeliveryPipeline(properties) { + this.annotations = {}; + 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]]; + } + + /** + * DeliveryPipeline name. + * @member {string} name + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.name = ""; + + /** + * DeliveryPipeline uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.uid = ""; + + /** + * DeliveryPipeline description. + * @member {string} description + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.description = ""; + + /** + * DeliveryPipeline annotations. + * @member {Object.} annotations + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.annotations = $util.emptyObject; + + /** + * DeliveryPipeline labels. + * @member {Object.} labels + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.labels = $util.emptyObject; + + /** + * DeliveryPipeline createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.createTime = null; + + /** + * DeliveryPipeline updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.updateTime = null; + + /** + * DeliveryPipeline serialPipeline. + * @member {google.cloud.deploy.v1.ISerialPipeline|null|undefined} serialPipeline + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.serialPipeline = null; + + /** + * DeliveryPipeline condition. + * @member {google.cloud.deploy.v1.IPipelineCondition|null|undefined} condition + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.condition = null; + + /** + * DeliveryPipeline etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.etag = ""; + + /** + * DeliveryPipeline suspended. + * @member {boolean} suspended + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.suspended = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeliveryPipeline pipeline. + * @member {"serialPipeline"|undefined} pipeline + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + Object.defineProperty(DeliveryPipeline.prototype, "pipeline", { + get: $util.oneOfGetter($oneOfFields = ["serialPipeline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeliveryPipeline instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipeline=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeliveryPipeline} DeliveryPipeline instance + */ + DeliveryPipeline.create = function create(properties) { + return new DeliveryPipeline(properties); + }; + + /** + * Encodes the specified DeliveryPipeline message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipeline.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipeline} message DeliveryPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryPipeline.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serialPipeline != null && Object.hasOwnProperty.call(message, "serialPipeline")) + $root.google.cloud.deploy.v1.SerialPipeline.encode(message.serialPipeline, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.cloud.deploy.v1.PipelineCondition.encode(message.condition, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.suspended != null && Object.hasOwnProperty.call(message, "suspended")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.suspended); + return writer; + }; + + /** + * Encodes the specified DeliveryPipeline message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipeline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipeline} message DeliveryPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryPipeline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeliveryPipeline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeliveryPipeline} DeliveryPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryPipeline.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeliveryPipeline(), 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.description = reader.string(); + break; + } + case 4: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.serialPipeline = $root.google.cloud.deploy.v1.SerialPipeline.decode(reader, reader.uint32()); + break; + } + case 11: { + message.condition = $root.google.cloud.deploy.v1.PipelineCondition.decode(reader, reader.uint32()); + break; + } + case 10: { + message.etag = reader.string(); + break; + } + case 12: { + message.suspended = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeliveryPipeline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeliveryPipeline} DeliveryPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryPipeline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeliveryPipeline message. + * @function verify + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeliveryPipeline.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.serialPipeline != null && message.hasOwnProperty("serialPipeline")) { + properties.pipeline = 1; + { + var error = $root.google.cloud.deploy.v1.SerialPipeline.verify(message.serialPipeline); + if (error) + return "serialPipeline." + error; + } + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.cloud.deploy.v1.PipelineCondition.verify(message.condition); + if (error) + return "condition." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.suspended != null && message.hasOwnProperty("suspended")) + if (typeof message.suspended !== "boolean") + return "suspended: boolean expected"; + return null; + }; + + /** + * Creates a DeliveryPipeline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeliveryPipeline} DeliveryPipeline + */ + DeliveryPipeline.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeliveryPipeline) + return object; + var message = new $root.google.cloud.deploy.v1.DeliveryPipeline(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.description != null) + message.description = String(object.description); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.deploy.v1.DeliveryPipeline.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.deploy.v1.DeliveryPipeline.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.DeliveryPipeline.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.deploy.v1.DeliveryPipeline.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.serialPipeline != null) { + if (typeof object.serialPipeline !== "object") + throw TypeError(".google.cloud.deploy.v1.DeliveryPipeline.serialPipeline: object expected"); + message.serialPipeline = $root.google.cloud.deploy.v1.SerialPipeline.fromObject(object.serialPipeline); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.deploy.v1.DeliveryPipeline.condition: object expected"); + message.condition = $root.google.cloud.deploy.v1.PipelineCondition.fromObject(object.condition); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.suspended != null) + message.suspended = Boolean(object.suspended); + return message; + }; + + /** + * Creates a plain object from a DeliveryPipeline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {google.cloud.deploy.v1.DeliveryPipeline} message DeliveryPipeline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeliveryPipeline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.condition = null; + object.suspended = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.serialPipeline != null && message.hasOwnProperty("serialPipeline")) { + object.serialPipeline = $root.google.cloud.deploy.v1.SerialPipeline.toObject(message.serialPipeline, options); + if (options.oneofs) + object.pipeline = "serialPipeline"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.cloud.deploy.v1.PipelineCondition.toObject(message.condition, options); + if (message.suspended != null && message.hasOwnProperty("suspended")) + object.suspended = message.suspended; + return object; + }; + + /** + * Converts this DeliveryPipeline to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + * @returns {Object.} JSON object + */ + DeliveryPipeline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeliveryPipeline + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeliveryPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeliveryPipeline"; + }; + + return DeliveryPipeline; + })(); + + v1.SerialPipeline = (function() { + + /** + * Properties of a SerialPipeline. + * @memberof google.cloud.deploy.v1 + * @interface ISerialPipeline + * @property {Array.|null} [stages] SerialPipeline stages + */ + + /** + * Constructs a new SerialPipeline. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a SerialPipeline. + * @implements ISerialPipeline + * @constructor + * @param {google.cloud.deploy.v1.ISerialPipeline=} [properties] Properties to set + */ + function SerialPipeline(properties) { + this.stages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SerialPipeline stages. + * @member {Array.} stages + * @memberof google.cloud.deploy.v1.SerialPipeline + * @instance + */ + SerialPipeline.prototype.stages = $util.emptyArray; + + /** + * Creates a new SerialPipeline instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {google.cloud.deploy.v1.ISerialPipeline=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.SerialPipeline} SerialPipeline instance + */ + SerialPipeline.create = function create(properties) { + return new SerialPipeline(properties); + }; + + /** + * Encodes the specified SerialPipeline message. Does not implicitly {@link google.cloud.deploy.v1.SerialPipeline.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {google.cloud.deploy.v1.ISerialPipeline} message SerialPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerialPipeline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stages != null && message.stages.length) + for (var i = 0; i < message.stages.length; ++i) + $root.google.cloud.deploy.v1.Stage.encode(message.stages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SerialPipeline message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.SerialPipeline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {google.cloud.deploy.v1.ISerialPipeline} message SerialPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerialPipeline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SerialPipeline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.SerialPipeline} SerialPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerialPipeline.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.SerialPipeline(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.stages && message.stages.length)) + message.stages = []; + message.stages.push($root.google.cloud.deploy.v1.Stage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SerialPipeline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.SerialPipeline} SerialPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerialPipeline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerialPipeline message. + * @function verify + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerialPipeline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stages != null && message.hasOwnProperty("stages")) { + if (!Array.isArray(message.stages)) + return "stages: array expected"; + for (var i = 0; i < message.stages.length; ++i) { + var error = $root.google.cloud.deploy.v1.Stage.verify(message.stages[i]); + if (error) + return "stages." + error; + } + } + return null; + }; + + /** + * Creates a SerialPipeline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.SerialPipeline} SerialPipeline + */ + SerialPipeline.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.SerialPipeline) + return object; + var message = new $root.google.cloud.deploy.v1.SerialPipeline(); + if (object.stages) { + if (!Array.isArray(object.stages)) + throw TypeError(".google.cloud.deploy.v1.SerialPipeline.stages: array expected"); + message.stages = []; + for (var i = 0; i < object.stages.length; ++i) { + if (typeof object.stages[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.SerialPipeline.stages: object expected"); + message.stages[i] = $root.google.cloud.deploy.v1.Stage.fromObject(object.stages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SerialPipeline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {google.cloud.deploy.v1.SerialPipeline} message SerialPipeline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerialPipeline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stages = []; + if (message.stages && message.stages.length) { + object.stages = []; + for (var j = 0; j < message.stages.length; ++j) + object.stages[j] = $root.google.cloud.deploy.v1.Stage.toObject(message.stages[j], options); + } + return object; + }; + + /** + * Converts this SerialPipeline to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.SerialPipeline + * @instance + * @returns {Object.} JSON object + */ + SerialPipeline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SerialPipeline + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SerialPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.SerialPipeline"; + }; + + return SerialPipeline; + })(); + + v1.Stage = (function() { + + /** + * Properties of a Stage. + * @memberof google.cloud.deploy.v1 + * @interface IStage + * @property {string|null} [targetId] Stage targetId + * @property {Array.|null} [profiles] Stage profiles + * @property {google.cloud.deploy.v1.IStrategy|null} [strategy] Stage strategy + */ + + /** + * Constructs a new Stage. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Stage. + * @implements IStage + * @constructor + * @param {google.cloud.deploy.v1.IStage=} [properties] Properties to set + */ + function Stage(properties) { + this.profiles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Stage targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.Stage + * @instance + */ + Stage.prototype.targetId = ""; + + /** + * Stage profiles. + * @member {Array.} profiles + * @memberof google.cloud.deploy.v1.Stage + * @instance + */ + Stage.prototype.profiles = $util.emptyArray; + + /** + * Stage strategy. + * @member {google.cloud.deploy.v1.IStrategy|null|undefined} strategy + * @memberof google.cloud.deploy.v1.Stage + * @instance + */ + Stage.prototype.strategy = null; + + /** + * Creates a new Stage instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {google.cloud.deploy.v1.IStage=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Stage} Stage instance + */ + Stage.create = function create(properties) { + return new Stage(properties); + }; + + /** + * Encodes the specified Stage message. Does not implicitly {@link google.cloud.deploy.v1.Stage.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {google.cloud.deploy.v1.IStage} message Stage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetId); + if (message.profiles != null && message.profiles.length) + for (var i = 0; i < message.profiles.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.profiles[i]); + if (message.strategy != null && Object.hasOwnProperty.call(message, "strategy")) + $root.google.cloud.deploy.v1.Strategy.encode(message.strategy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Stage message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Stage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {google.cloud.deploy.v1.IStage} message Stage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Stage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Stage} Stage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Stage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.targetId = reader.string(); + break; + } + case 2: { + if (!(message.profiles && message.profiles.length)) + message.profiles = []; + message.profiles.push(reader.string()); + break; + } + case 5: { + message.strategy = $root.google.cloud.deploy.v1.Strategy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Stage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Stage} Stage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Stage message. + * @function verify + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Stage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: string expected"; + if (message.profiles != null && message.hasOwnProperty("profiles")) { + if (!Array.isArray(message.profiles)) + return "profiles: array expected"; + for (var i = 0; i < message.profiles.length; ++i) + if (!$util.isString(message.profiles[i])) + return "profiles: string[] expected"; + } + if (message.strategy != null && message.hasOwnProperty("strategy")) { + var error = $root.google.cloud.deploy.v1.Strategy.verify(message.strategy); + if (error) + return "strategy." + error; + } + return null; + }; + + /** + * Creates a Stage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Stage} Stage + */ + Stage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Stage) + return object; + var message = new $root.google.cloud.deploy.v1.Stage(); + if (object.targetId != null) + message.targetId = String(object.targetId); + if (object.profiles) { + if (!Array.isArray(object.profiles)) + throw TypeError(".google.cloud.deploy.v1.Stage.profiles: array expected"); + message.profiles = []; + for (var i = 0; i < object.profiles.length; ++i) + message.profiles[i] = String(object.profiles[i]); + } + if (object.strategy != null) { + if (typeof object.strategy !== "object") + throw TypeError(".google.cloud.deploy.v1.Stage.strategy: object expected"); + message.strategy = $root.google.cloud.deploy.v1.Strategy.fromObject(object.strategy); + } + return message; + }; + + /** + * Creates a plain object from a Stage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {google.cloud.deploy.v1.Stage} message Stage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.profiles = []; + if (options.defaults) { + object.targetId = ""; + object.strategy = null; + } + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + if (message.profiles && message.profiles.length) { + object.profiles = []; + for (var j = 0; j < message.profiles.length; ++j) + object.profiles[j] = message.profiles[j]; + } + if (message.strategy != null && message.hasOwnProperty("strategy")) + object.strategy = $root.google.cloud.deploy.v1.Strategy.toObject(message.strategy, options); + return object; + }; + + /** + * Converts this Stage to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Stage + * @instance + * @returns {Object.} JSON object + */ + Stage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Stage + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Stage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Stage"; + }; + + return Stage; + })(); + + v1.Strategy = (function() { + + /** + * Properties of a Strategy. + * @memberof google.cloud.deploy.v1 + * @interface IStrategy + * @property {google.cloud.deploy.v1.IStandard|null} [standard] Strategy standard + */ + + /** + * Constructs a new Strategy. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Strategy. + * @implements IStrategy + * @constructor + * @param {google.cloud.deploy.v1.IStrategy=} [properties] Properties to set + */ + function Strategy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Strategy standard. + * @member {google.cloud.deploy.v1.IStandard|null|undefined} standard + * @memberof google.cloud.deploy.v1.Strategy + * @instance + */ + Strategy.prototype.standard = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Strategy deploymentStrategy. + * @member {"standard"|undefined} deploymentStrategy + * @memberof google.cloud.deploy.v1.Strategy + * @instance + */ + Object.defineProperty(Strategy.prototype, "deploymentStrategy", { + get: $util.oneOfGetter($oneOfFields = ["standard"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Strategy instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {google.cloud.deploy.v1.IStrategy=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Strategy} Strategy instance + */ + Strategy.create = function create(properties) { + return new Strategy(properties); + }; + + /** + * Encodes the specified Strategy message. Does not implicitly {@link google.cloud.deploy.v1.Strategy.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {google.cloud.deploy.v1.IStrategy} message Strategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Strategy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.standard != null && Object.hasOwnProperty.call(message, "standard")) + $root.google.cloud.deploy.v1.Standard.encode(message.standard, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Strategy message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Strategy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {google.cloud.deploy.v1.IStrategy} message Strategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Strategy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Strategy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Strategy} Strategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Strategy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Strategy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.standard = $root.google.cloud.deploy.v1.Standard.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Strategy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Strategy} Strategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Strategy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Strategy message. + * @function verify + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Strategy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.standard != null && message.hasOwnProperty("standard")) { + properties.deploymentStrategy = 1; + { + var error = $root.google.cloud.deploy.v1.Standard.verify(message.standard); + if (error) + return "standard." + error; + } + } + return null; + }; + + /** + * Creates a Strategy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Strategy} Strategy + */ + Strategy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Strategy) + return object; + var message = new $root.google.cloud.deploy.v1.Strategy(); + if (object.standard != null) { + if (typeof object.standard !== "object") + throw TypeError(".google.cloud.deploy.v1.Strategy.standard: object expected"); + message.standard = $root.google.cloud.deploy.v1.Standard.fromObject(object.standard); + } + return message; + }; + + /** + * Creates a plain object from a Strategy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {google.cloud.deploy.v1.Strategy} message Strategy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Strategy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.standard != null && message.hasOwnProperty("standard")) { + object.standard = $root.google.cloud.deploy.v1.Standard.toObject(message.standard, options); + if (options.oneofs) + object.deploymentStrategy = "standard"; + } + return object; + }; + + /** + * Converts this Strategy to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Strategy + * @instance + * @returns {Object.} JSON object + */ + Strategy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Strategy + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Strategy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Strategy"; + }; + + return Strategy; + })(); + + v1.Standard = (function() { + + /** + * Properties of a Standard. + * @memberof google.cloud.deploy.v1 + * @interface IStandard + * @property {boolean|null} [verify] Standard verify + */ + + /** + * Constructs a new Standard. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Standard. + * @implements IStandard + * @constructor + * @param {google.cloud.deploy.v1.IStandard=} [properties] Properties to set + */ + function Standard(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Standard verify. + * @member {boolean} verify + * @memberof google.cloud.deploy.v1.Standard + * @instance + */ + Standard.prototype.verify = false; + + /** + * Creates a new Standard instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {google.cloud.deploy.v1.IStandard=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Standard} Standard instance + */ + Standard.create = function create(properties) { + return new Standard(properties); + }; + + /** + * Encodes the specified Standard message. Does not implicitly {@link google.cloud.deploy.v1.Standard.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {google.cloud.deploy.v1.IStandard} message Standard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Standard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.verify != null && Object.hasOwnProperty.call(message, "verify")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.verify); + return writer; + }; + + /** + * Encodes the specified Standard message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Standard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {google.cloud.deploy.v1.IStandard} message Standard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Standard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Standard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Standard} Standard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Standard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Standard(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.verify = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Standard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Standard} Standard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Standard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Standard message. + * @function verify + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Standard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.verify != null && message.hasOwnProperty("verify")) + if (typeof message.verify !== "boolean") + return "verify: boolean expected"; + return null; + }; + + /** + * Creates a Standard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Standard} Standard + */ + Standard.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Standard) + return object; + var message = new $root.google.cloud.deploy.v1.Standard(); + if (object.verify != null) + message.verify = Boolean(object.verify); + return message; + }; + + /** + * Creates a plain object from a Standard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {google.cloud.deploy.v1.Standard} message Standard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Standard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.verify = false; + if (message.verify != null && message.hasOwnProperty("verify")) + object.verify = message.verify; + return object; + }; + + /** + * Converts this Standard to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Standard + * @instance + * @returns {Object.} JSON object + */ + Standard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Standard + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Standard.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Standard"; + }; + + return Standard; + })(); + + v1.PipelineReadyCondition = (function() { + + /** + * Properties of a PipelineReadyCondition. + * @memberof google.cloud.deploy.v1 + * @interface IPipelineReadyCondition + * @property {boolean|null} [status] PipelineReadyCondition status + * @property {google.protobuf.ITimestamp|null} [updateTime] PipelineReadyCondition updateTime + */ + + /** + * Constructs a new PipelineReadyCondition. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a PipelineReadyCondition. + * @implements IPipelineReadyCondition + * @constructor + * @param {google.cloud.deploy.v1.IPipelineReadyCondition=} [properties] Properties to set + */ + function PipelineReadyCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PipelineReadyCondition status. + * @member {boolean} status + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @instance + */ + PipelineReadyCondition.prototype.status = false; + + /** + * PipelineReadyCondition updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @instance + */ + PipelineReadyCondition.prototype.updateTime = null; + + /** + * Creates a new PipelineReadyCondition instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineReadyCondition=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.PipelineReadyCondition} PipelineReadyCondition instance + */ + PipelineReadyCondition.create = function create(properties) { + return new PipelineReadyCondition(properties); + }; + + /** + * Encodes the specified PipelineReadyCondition message. Does not implicitly {@link google.cloud.deploy.v1.PipelineReadyCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineReadyCondition} message PipelineReadyCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PipelineReadyCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.status); + 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(); + return writer; + }; + + /** + * Encodes the specified PipelineReadyCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PipelineReadyCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineReadyCondition} message PipelineReadyCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PipelineReadyCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PipelineReadyCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.PipelineReadyCondition} PipelineReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PipelineReadyCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.PipelineReadyCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.status = reader.bool(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PipelineReadyCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.PipelineReadyCondition} PipelineReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PipelineReadyCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PipelineReadyCondition message. + * @function verify + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PipelineReadyCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (typeof message.status !== "boolean") + return "status: boolean expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a PipelineReadyCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.PipelineReadyCondition} PipelineReadyCondition + */ + PipelineReadyCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.PipelineReadyCondition) + return object; + var message = new $root.google.cloud.deploy.v1.PipelineReadyCondition(); + if (object.status != null) + message.status = Boolean(object.status); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.deploy.v1.PipelineReadyCondition.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a PipelineReadyCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {google.cloud.deploy.v1.PipelineReadyCondition} message PipelineReadyCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PipelineReadyCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = false; + object.updateTime = null; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this PipelineReadyCondition to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @instance + * @returns {Object.} JSON object + */ + PipelineReadyCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PipelineReadyCondition + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PipelineReadyCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.PipelineReadyCondition"; + }; + + return PipelineReadyCondition; + })(); + + v1.TargetsPresentCondition = (function() { + + /** + * Properties of a TargetsPresentCondition. + * @memberof google.cloud.deploy.v1 + * @interface ITargetsPresentCondition + * @property {boolean|null} [status] TargetsPresentCondition status + * @property {Array.|null} [missingTargets] TargetsPresentCondition missingTargets + * @property {google.protobuf.ITimestamp|null} [updateTime] TargetsPresentCondition updateTime + */ + + /** + * Constructs a new TargetsPresentCondition. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a TargetsPresentCondition. + * @implements ITargetsPresentCondition + * @constructor + * @param {google.cloud.deploy.v1.ITargetsPresentCondition=} [properties] Properties to set + */ + function TargetsPresentCondition(properties) { + this.missingTargets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetsPresentCondition status. + * @member {boolean} status + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @instance + */ + TargetsPresentCondition.prototype.status = false; + + /** + * TargetsPresentCondition missingTargets. + * @member {Array.} missingTargets + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @instance + */ + TargetsPresentCondition.prototype.missingTargets = $util.emptyArray; + + /** + * TargetsPresentCondition updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @instance + */ + TargetsPresentCondition.prototype.updateTime = null; + + /** + * Creates a new TargetsPresentCondition instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {google.cloud.deploy.v1.ITargetsPresentCondition=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.TargetsPresentCondition} TargetsPresentCondition instance + */ + TargetsPresentCondition.create = function create(properties) { + return new TargetsPresentCondition(properties); + }; + + /** + * Encodes the specified TargetsPresentCondition message. Does not implicitly {@link google.cloud.deploy.v1.TargetsPresentCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {google.cloud.deploy.v1.ITargetsPresentCondition} message TargetsPresentCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetsPresentCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.status); + if (message.missingTargets != null && message.missingTargets.length) + for (var i = 0; i < message.missingTargets.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.missingTargets[i]); + 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(); + return writer; + }; + + /** + * Encodes the specified TargetsPresentCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetsPresentCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {google.cloud.deploy.v1.ITargetsPresentCondition} message TargetsPresentCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetsPresentCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetsPresentCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.TargetsPresentCondition} TargetsPresentCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetsPresentCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.TargetsPresentCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.status = reader.bool(); + break; + } + case 2: { + if (!(message.missingTargets && message.missingTargets.length)) + message.missingTargets = []; + message.missingTargets.push(reader.string()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetsPresentCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.TargetsPresentCondition} TargetsPresentCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetsPresentCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetsPresentCondition message. + * @function verify + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetsPresentCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (typeof message.status !== "boolean") + return "status: boolean expected"; + if (message.missingTargets != null && message.hasOwnProperty("missingTargets")) { + if (!Array.isArray(message.missingTargets)) + return "missingTargets: array expected"; + for (var i = 0; i < message.missingTargets.length; ++i) + if (!$util.isString(message.missingTargets[i])) + return "missingTargets: string[] expected"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a TargetsPresentCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.TargetsPresentCondition} TargetsPresentCondition + */ + TargetsPresentCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.TargetsPresentCondition) + return object; + var message = new $root.google.cloud.deploy.v1.TargetsPresentCondition(); + if (object.status != null) + message.status = Boolean(object.status); + if (object.missingTargets) { + if (!Array.isArray(object.missingTargets)) + throw TypeError(".google.cloud.deploy.v1.TargetsPresentCondition.missingTargets: array expected"); + message.missingTargets = []; + for (var i = 0; i < object.missingTargets.length; ++i) + message.missingTargets[i] = String(object.missingTargets[i]); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.deploy.v1.TargetsPresentCondition.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a TargetsPresentCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {google.cloud.deploy.v1.TargetsPresentCondition} message TargetsPresentCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetsPresentCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.missingTargets = []; + if (options.defaults) { + object.status = false; + object.updateTime = null; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.missingTargets && message.missingTargets.length) { + object.missingTargets = []; + for (var j = 0; j < message.missingTargets.length; ++j) + object.missingTargets[j] = message.missingTargets[j]; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this TargetsPresentCondition to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @instance + * @returns {Object.} JSON object + */ + TargetsPresentCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetsPresentCondition + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetsPresentCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.TargetsPresentCondition"; + }; + + return TargetsPresentCondition; + })(); + + v1.PipelineCondition = (function() { + + /** + * Properties of a PipelineCondition. + * @memberof google.cloud.deploy.v1 + * @interface IPipelineCondition + * @property {google.cloud.deploy.v1.IPipelineReadyCondition|null} [pipelineReadyCondition] PipelineCondition pipelineReadyCondition + * @property {google.cloud.deploy.v1.ITargetsPresentCondition|null} [targetsPresentCondition] PipelineCondition targetsPresentCondition + */ + + /** + * Constructs a new PipelineCondition. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a PipelineCondition. + * @implements IPipelineCondition + * @constructor + * @param {google.cloud.deploy.v1.IPipelineCondition=} [properties] Properties to set + */ + function PipelineCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PipelineCondition pipelineReadyCondition. + * @member {google.cloud.deploy.v1.IPipelineReadyCondition|null|undefined} pipelineReadyCondition + * @memberof google.cloud.deploy.v1.PipelineCondition + * @instance + */ + PipelineCondition.prototype.pipelineReadyCondition = null; + + /** + * PipelineCondition targetsPresentCondition. + * @member {google.cloud.deploy.v1.ITargetsPresentCondition|null|undefined} targetsPresentCondition + * @memberof google.cloud.deploy.v1.PipelineCondition + * @instance + */ + PipelineCondition.prototype.targetsPresentCondition = null; + + /** + * Creates a new PipelineCondition instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineCondition=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.PipelineCondition} PipelineCondition instance + */ + PipelineCondition.create = function create(properties) { + return new PipelineCondition(properties); + }; + + /** + * Encodes the specified PipelineCondition message. Does not implicitly {@link google.cloud.deploy.v1.PipelineCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineCondition} message PipelineCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PipelineCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pipelineReadyCondition != null && Object.hasOwnProperty.call(message, "pipelineReadyCondition")) + $root.google.cloud.deploy.v1.PipelineReadyCondition.encode(message.pipelineReadyCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.targetsPresentCondition != null && Object.hasOwnProperty.call(message, "targetsPresentCondition")) + $root.google.cloud.deploy.v1.TargetsPresentCondition.encode(message.targetsPresentCondition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PipelineCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PipelineCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineCondition} message PipelineCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PipelineCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PipelineCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.PipelineCondition} PipelineCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PipelineCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.PipelineCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pipelineReadyCondition = $root.google.cloud.deploy.v1.PipelineReadyCondition.decode(reader, reader.uint32()); + break; + } + case 3: { + message.targetsPresentCondition = $root.google.cloud.deploy.v1.TargetsPresentCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PipelineCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.PipelineCondition} PipelineCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PipelineCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PipelineCondition message. + * @function verify + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PipelineCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pipelineReadyCondition != null && message.hasOwnProperty("pipelineReadyCondition")) { + var error = $root.google.cloud.deploy.v1.PipelineReadyCondition.verify(message.pipelineReadyCondition); + if (error) + return "pipelineReadyCondition." + error; + } + if (message.targetsPresentCondition != null && message.hasOwnProperty("targetsPresentCondition")) { + var error = $root.google.cloud.deploy.v1.TargetsPresentCondition.verify(message.targetsPresentCondition); + if (error) + return "targetsPresentCondition." + error; + } + return null; + }; + + /** + * Creates a PipelineCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.PipelineCondition} PipelineCondition + */ + PipelineCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.PipelineCondition) + return object; + var message = new $root.google.cloud.deploy.v1.PipelineCondition(); + if (object.pipelineReadyCondition != null) { + if (typeof object.pipelineReadyCondition !== "object") + throw TypeError(".google.cloud.deploy.v1.PipelineCondition.pipelineReadyCondition: object expected"); + message.pipelineReadyCondition = $root.google.cloud.deploy.v1.PipelineReadyCondition.fromObject(object.pipelineReadyCondition); + } + if (object.targetsPresentCondition != null) { + if (typeof object.targetsPresentCondition !== "object") + throw TypeError(".google.cloud.deploy.v1.PipelineCondition.targetsPresentCondition: object expected"); + message.targetsPresentCondition = $root.google.cloud.deploy.v1.TargetsPresentCondition.fromObject(object.targetsPresentCondition); + } + return message; + }; + + /** + * Creates a plain object from a PipelineCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {google.cloud.deploy.v1.PipelineCondition} message PipelineCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PipelineCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pipelineReadyCondition = null; + object.targetsPresentCondition = null; + } + if (message.pipelineReadyCondition != null && message.hasOwnProperty("pipelineReadyCondition")) + object.pipelineReadyCondition = $root.google.cloud.deploy.v1.PipelineReadyCondition.toObject(message.pipelineReadyCondition, options); + if (message.targetsPresentCondition != null && message.hasOwnProperty("targetsPresentCondition")) + object.targetsPresentCondition = $root.google.cloud.deploy.v1.TargetsPresentCondition.toObject(message.targetsPresentCondition, options); + return object; + }; + + /** + * Converts this PipelineCondition to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.PipelineCondition + * @instance + * @returns {Object.} JSON object + */ + PipelineCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PipelineCondition + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PipelineCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.PipelineCondition"; + }; + + return PipelineCondition; + })(); + + v1.ListDeliveryPipelinesRequest = (function() { + + /** + * Properties of a ListDeliveryPipelinesRequest. + * @memberof google.cloud.deploy.v1 + * @interface IListDeliveryPipelinesRequest + * @property {string|null} [parent] ListDeliveryPipelinesRequest parent + * @property {number|null} [pageSize] ListDeliveryPipelinesRequest pageSize + * @property {string|null} [pageToken] ListDeliveryPipelinesRequest pageToken + * @property {string|null} [filter] ListDeliveryPipelinesRequest filter + * @property {string|null} [orderBy] ListDeliveryPipelinesRequest orderBy + */ + + /** + * Constructs a new ListDeliveryPipelinesRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListDeliveryPipelinesRequest. + * @implements IListDeliveryPipelinesRequest + * @constructor + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest=} [properties] Properties to set + */ + function ListDeliveryPipelinesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeliveryPipelinesRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + */ + ListDeliveryPipelinesRequest.prototype.parent = ""; + + /** + * ListDeliveryPipelinesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + */ + ListDeliveryPipelinesRequest.prototype.pageSize = 0; + + /** + * ListDeliveryPipelinesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + */ + ListDeliveryPipelinesRequest.prototype.pageToken = ""; + + /** + * ListDeliveryPipelinesRequest filter. + * @member {string} filter + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + */ + ListDeliveryPipelinesRequest.prototype.filter = ""; + + /** + * ListDeliveryPipelinesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + */ + ListDeliveryPipelinesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDeliveryPipelinesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesRequest} ListDeliveryPipelinesRequest instance + */ + ListDeliveryPipelinesRequest.create = function create(properties) { + return new ListDeliveryPipelinesRequest(properties); + }; + + /** + * Encodes the specified ListDeliveryPipelinesRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest} message ListDeliveryPipelinesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeliveryPipelinesRequest.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 ListDeliveryPipelinesRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest} message ListDeliveryPipelinesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeliveryPipelinesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeliveryPipelinesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesRequest} ListDeliveryPipelinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeliveryPipelinesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListDeliveryPipelinesRequest(); + 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 ListDeliveryPipelinesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesRequest} ListDeliveryPipelinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeliveryPipelinesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeliveryPipelinesRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeliveryPipelinesRequest.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 ListDeliveryPipelinesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesRequest} ListDeliveryPipelinesRequest + */ + ListDeliveryPipelinesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListDeliveryPipelinesRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ListDeliveryPipelinesRequest(); + 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 ListDeliveryPipelinesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {google.cloud.deploy.v1.ListDeliveryPipelinesRequest} message ListDeliveryPipelinesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeliveryPipelinesRequest.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 ListDeliveryPipelinesRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDeliveryPipelinesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeliveryPipelinesRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeliveryPipelinesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListDeliveryPipelinesRequest"; + }; + + return ListDeliveryPipelinesRequest; + })(); + + v1.ListDeliveryPipelinesResponse = (function() { + + /** + * Properties of a ListDeliveryPipelinesResponse. + * @memberof google.cloud.deploy.v1 + * @interface IListDeliveryPipelinesResponse + * @property {Array.|null} [deliveryPipelines] ListDeliveryPipelinesResponse deliveryPipelines + * @property {string|null} [nextPageToken] ListDeliveryPipelinesResponse nextPageToken + * @property {Array.|null} [unreachable] ListDeliveryPipelinesResponse unreachable + */ + + /** + * Constructs a new ListDeliveryPipelinesResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListDeliveryPipelinesResponse. + * @implements IListDeliveryPipelinesResponse + * @constructor + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesResponse=} [properties] Properties to set + */ + function ListDeliveryPipelinesResponse(properties) { + this.deliveryPipelines = []; + 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]]; + } + + /** + * ListDeliveryPipelinesResponse deliveryPipelines. + * @member {Array.} deliveryPipelines + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @instance + */ + ListDeliveryPipelinesResponse.prototype.deliveryPipelines = $util.emptyArray; + + /** + * ListDeliveryPipelinesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @instance + */ + ListDeliveryPipelinesResponse.prototype.nextPageToken = ""; + + /** + * ListDeliveryPipelinesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @instance + */ + ListDeliveryPipelinesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListDeliveryPipelinesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} ListDeliveryPipelinesResponse instance + */ + ListDeliveryPipelinesResponse.create = function create(properties) { + return new ListDeliveryPipelinesResponse(properties); + }; + + /** + * Encodes the specified ListDeliveryPipelinesResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesResponse} message ListDeliveryPipelinesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeliveryPipelinesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deliveryPipelines != null && message.deliveryPipelines.length) + for (var i = 0; i < message.deliveryPipelines.length; ++i) + $root.google.cloud.deploy.v1.DeliveryPipeline.encode(message.deliveryPipelines[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 ListDeliveryPipelinesResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesResponse} message ListDeliveryPipelinesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeliveryPipelinesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeliveryPipelinesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} ListDeliveryPipelinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeliveryPipelinesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListDeliveryPipelinesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.deliveryPipelines && message.deliveryPipelines.length)) + message.deliveryPipelines = []; + message.deliveryPipelines.push($root.google.cloud.deploy.v1.DeliveryPipeline.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 ListDeliveryPipelinesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} ListDeliveryPipelinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeliveryPipelinesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeliveryPipelinesResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeliveryPipelinesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deliveryPipelines != null && message.hasOwnProperty("deliveryPipelines")) { + if (!Array.isArray(message.deliveryPipelines)) + return "deliveryPipelines: array expected"; + for (var i = 0; i < message.deliveryPipelines.length; ++i) { + var error = $root.google.cloud.deploy.v1.DeliveryPipeline.verify(message.deliveryPipelines[i]); + if (error) + return "deliveryPipelines." + 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 ListDeliveryPipelinesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} ListDeliveryPipelinesResponse + */ + ListDeliveryPipelinesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListDeliveryPipelinesResponse) + return object; + var message = new $root.google.cloud.deploy.v1.ListDeliveryPipelinesResponse(); + if (object.deliveryPipelines) { + if (!Array.isArray(object.deliveryPipelines)) + throw TypeError(".google.cloud.deploy.v1.ListDeliveryPipelinesResponse.deliveryPipelines: array expected"); + message.deliveryPipelines = []; + for (var i = 0; i < object.deliveryPipelines.length; ++i) { + if (typeof object.deliveryPipelines[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.ListDeliveryPipelinesResponse.deliveryPipelines: object expected"); + message.deliveryPipelines[i] = $root.google.cloud.deploy.v1.DeliveryPipeline.fromObject(object.deliveryPipelines[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.deploy.v1.ListDeliveryPipelinesResponse.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 ListDeliveryPipelinesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} message ListDeliveryPipelinesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeliveryPipelinesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.deliveryPipelines = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.deliveryPipelines && message.deliveryPipelines.length) { + object.deliveryPipelines = []; + for (var j = 0; j < message.deliveryPipelines.length; ++j) + object.deliveryPipelines[j] = $root.google.cloud.deploy.v1.DeliveryPipeline.toObject(message.deliveryPipelines[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 ListDeliveryPipelinesResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDeliveryPipelinesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeliveryPipelinesResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeliveryPipelinesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListDeliveryPipelinesResponse"; + }; + + return ListDeliveryPipelinesResponse; + })(); + + v1.GetDeliveryPipelineRequest = (function() { + + /** + * Properties of a GetDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetDeliveryPipelineRequest + * @property {string|null} [name] GetDeliveryPipelineRequest name + */ + + /** + * Constructs a new GetDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetDeliveryPipelineRequest. + * @implements IGetDeliveryPipelineRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest=} [properties] Properties to set + */ + function GetDeliveryPipelineRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDeliveryPipelineRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @instance + */ + GetDeliveryPipelineRequest.prototype.name = ""; + + /** + * Creates a new GetDeliveryPipelineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetDeliveryPipelineRequest} GetDeliveryPipelineRequest instance + */ + GetDeliveryPipelineRequest.create = function create(properties) { + return new GetDeliveryPipelineRequest(properties); + }; + + /** + * Encodes the specified GetDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetDeliveryPipelineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest} message GetDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeliveryPipelineRequest.encode = function encode(message, writer) { + 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 GetDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetDeliveryPipelineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest} message GetDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeliveryPipelineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDeliveryPipelineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetDeliveryPipelineRequest} GetDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeliveryPipelineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetDeliveryPipelineRequest(); + 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 GetDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetDeliveryPipelineRequest} GetDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeliveryPipelineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDeliveryPipelineRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDeliveryPipelineRequest.verify = function verify(message) { + if (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 GetDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetDeliveryPipelineRequest} GetDeliveryPipelineRequest + */ + GetDeliveryPipelineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetDeliveryPipelineRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetDeliveryPipelineRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDeliveryPipelineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.GetDeliveryPipelineRequest} message GetDeliveryPipelineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDeliveryPipelineRequest.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 GetDeliveryPipelineRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @instance + * @returns {Object.} JSON object + */ + GetDeliveryPipelineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDeliveryPipelineRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDeliveryPipelineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetDeliveryPipelineRequest"; + }; + + return GetDeliveryPipelineRequest; + })(); + + v1.CreateDeliveryPipelineRequest = (function() { + + /** + * Properties of a CreateDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @interface ICreateDeliveryPipelineRequest + * @property {string|null} [parent] CreateDeliveryPipelineRequest parent + * @property {string|null} [deliveryPipelineId] CreateDeliveryPipelineRequest deliveryPipelineId + * @property {google.cloud.deploy.v1.IDeliveryPipeline|null} [deliveryPipeline] CreateDeliveryPipelineRequest deliveryPipeline + * @property {string|null} [requestId] CreateDeliveryPipelineRequest requestId + * @property {boolean|null} [validateOnly] CreateDeliveryPipelineRequest validateOnly + */ + + /** + * Constructs a new CreateDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CreateDeliveryPipelineRequest. + * @implements ICreateDeliveryPipelineRequest + * @constructor + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest=} [properties] Properties to set + */ + function CreateDeliveryPipelineRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDeliveryPipelineRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + */ + CreateDeliveryPipelineRequest.prototype.parent = ""; + + /** + * CreateDeliveryPipelineRequest deliveryPipelineId. + * @member {string} deliveryPipelineId + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + */ + CreateDeliveryPipelineRequest.prototype.deliveryPipelineId = ""; + + /** + * CreateDeliveryPipelineRequest deliveryPipeline. + * @member {google.cloud.deploy.v1.IDeliveryPipeline|null|undefined} deliveryPipeline + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + */ + CreateDeliveryPipelineRequest.prototype.deliveryPipeline = null; + + /** + * CreateDeliveryPipelineRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + */ + CreateDeliveryPipelineRequest.prototype.requestId = ""; + + /** + * CreateDeliveryPipelineRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + */ + CreateDeliveryPipelineRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateDeliveryPipelineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CreateDeliveryPipelineRequest} CreateDeliveryPipelineRequest instance + */ + CreateDeliveryPipelineRequest.create = function create(properties) { + return new CreateDeliveryPipelineRequest(properties); + }; + + /** + * Encodes the specified CreateDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateDeliveryPipelineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest} message CreateDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeliveryPipelineRequest.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.deliveryPipelineId != null && Object.hasOwnProperty.call(message, "deliveryPipelineId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deliveryPipelineId); + if (message.deliveryPipeline != null && Object.hasOwnProperty.call(message, "deliveryPipeline")) + $root.google.cloud.deploy.v1.DeliveryPipeline.encode(message.deliveryPipeline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateDeliveryPipelineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest} message CreateDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeliveryPipelineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDeliveryPipelineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CreateDeliveryPipelineRequest} CreateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeliveryPipelineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CreateDeliveryPipelineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.deliveryPipelineId = reader.string(); + break; + } + case 3: { + message.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CreateDeliveryPipelineRequest} CreateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeliveryPipelineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDeliveryPipelineRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDeliveryPipelineRequest.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.deliveryPipelineId != null && message.hasOwnProperty("deliveryPipelineId")) + if (!$util.isString(message.deliveryPipelineId)) + return "deliveryPipelineId: string expected"; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) { + var error = $root.google.cloud.deploy.v1.DeliveryPipeline.verify(message.deliveryPipeline); + if (error) + return "deliveryPipeline." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CreateDeliveryPipelineRequest} CreateDeliveryPipelineRequest + */ + CreateDeliveryPipelineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CreateDeliveryPipelineRequest) + return object; + var message = new $root.google.cloud.deploy.v1.CreateDeliveryPipelineRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deliveryPipelineId != null) + message.deliveryPipelineId = String(object.deliveryPipelineId); + if (object.deliveryPipeline != null) { + if (typeof object.deliveryPipeline !== "object") + throw TypeError(".google.cloud.deploy.v1.CreateDeliveryPipelineRequest.deliveryPipeline: object expected"); + message.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.fromObject(object.deliveryPipeline); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateDeliveryPipelineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.CreateDeliveryPipelineRequest} message CreateDeliveryPipelineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDeliveryPipelineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deliveryPipelineId = ""; + object.deliveryPipeline = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deliveryPipelineId != null && message.hasOwnProperty("deliveryPipelineId")) + object.deliveryPipelineId = message.deliveryPipelineId; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + object.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.toObject(message.deliveryPipeline, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateDeliveryPipelineRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDeliveryPipelineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDeliveryPipelineRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDeliveryPipelineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CreateDeliveryPipelineRequest"; + }; + + return CreateDeliveryPipelineRequest; + })(); + + v1.UpdateDeliveryPipelineRequest = (function() { + + /** + * Properties of an UpdateDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @interface IUpdateDeliveryPipelineRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeliveryPipelineRequest updateMask + * @property {google.cloud.deploy.v1.IDeliveryPipeline|null} [deliveryPipeline] UpdateDeliveryPipelineRequest deliveryPipeline + * @property {string|null} [requestId] UpdateDeliveryPipelineRequest requestId + * @property {boolean|null} [allowMissing] UpdateDeliveryPipelineRequest allowMissing + * @property {boolean|null} [validateOnly] UpdateDeliveryPipelineRequest validateOnly + */ + + /** + * Constructs a new UpdateDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an UpdateDeliveryPipelineRequest. + * @implements IUpdateDeliveryPipelineRequest + * @constructor + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest=} [properties] Properties to set + */ + function UpdateDeliveryPipelineRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDeliveryPipelineRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + */ + UpdateDeliveryPipelineRequest.prototype.updateMask = null; + + /** + * UpdateDeliveryPipelineRequest deliveryPipeline. + * @member {google.cloud.deploy.v1.IDeliveryPipeline|null|undefined} deliveryPipeline + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + */ + UpdateDeliveryPipelineRequest.prototype.deliveryPipeline = null; + + /** + * UpdateDeliveryPipelineRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + */ + UpdateDeliveryPipelineRequest.prototype.requestId = ""; + + /** + * UpdateDeliveryPipelineRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + */ + UpdateDeliveryPipelineRequest.prototype.allowMissing = false; + + /** + * UpdateDeliveryPipelineRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + */ + UpdateDeliveryPipelineRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateDeliveryPipelineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.UpdateDeliveryPipelineRequest} UpdateDeliveryPipelineRequest instance + */ + UpdateDeliveryPipelineRequest.create = function create(properties) { + return new UpdateDeliveryPipelineRequest(properties); + }; + + /** + * Encodes the specified UpdateDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest} message UpdateDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeliveryPipelineRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deliveryPipeline != null && Object.hasOwnProperty.call(message, "deliveryPipeline")) + $root.google.cloud.deploy.v1.DeliveryPipeline.encode(message.deliveryPipeline, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest} message UpdateDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeliveryPipelineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDeliveryPipelineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.UpdateDeliveryPipelineRequest} UpdateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeliveryPipelineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.UpdateDeliveryPipelineRequest} UpdateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeliveryPipelineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDeliveryPipelineRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDeliveryPipelineRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) { + var error = $root.google.cloud.deploy.v1.DeliveryPipeline.verify(message.deliveryPipeline); + if (error) + return "deliveryPipeline." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.UpdateDeliveryPipelineRequest} UpdateDeliveryPipelineRequest + */ + UpdateDeliveryPipelineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest) + return object; + var message = new $root.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.deliveryPipeline != null) { + if (typeof object.deliveryPipeline !== "object") + throw TypeError(".google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.deliveryPipeline: object expected"); + message.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.fromObject(object.deliveryPipeline); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateDeliveryPipelineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.UpdateDeliveryPipelineRequest} message UpdateDeliveryPipelineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDeliveryPipelineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.deliveryPipeline = null; + object.requestId = ""; + object.allowMissing = false; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + object.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.toObject(message.deliveryPipeline, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateDeliveryPipelineRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDeliveryPipelineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDeliveryPipelineRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDeliveryPipelineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.UpdateDeliveryPipelineRequest"; + }; + + return UpdateDeliveryPipelineRequest; + })(); + + v1.DeleteDeliveryPipelineRequest = (function() { + + /** + * Properties of a DeleteDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @interface IDeleteDeliveryPipelineRequest + * @property {string|null} [name] DeleteDeliveryPipelineRequest name + * @property {string|null} [requestId] DeleteDeliveryPipelineRequest requestId + * @property {boolean|null} [allowMissing] DeleteDeliveryPipelineRequest allowMissing + * @property {boolean|null} [validateOnly] DeleteDeliveryPipelineRequest validateOnly + * @property {boolean|null} [force] DeleteDeliveryPipelineRequest force + * @property {string|null} [etag] DeleteDeliveryPipelineRequest etag + */ + + /** + * Constructs a new DeleteDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeleteDeliveryPipelineRequest. + * @implements IDeleteDeliveryPipelineRequest + * @constructor + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest=} [properties] Properties to set + */ + function DeleteDeliveryPipelineRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDeliveryPipelineRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.name = ""; + + /** + * DeleteDeliveryPipelineRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.requestId = ""; + + /** + * DeleteDeliveryPipelineRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.allowMissing = false; + + /** + * DeleteDeliveryPipelineRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.validateOnly = false; + + /** + * DeleteDeliveryPipelineRequest force. + * @member {boolean} force + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.force = false; + + /** + * DeleteDeliveryPipelineRequest etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.etag = ""; + + /** + * Creates a new DeleteDeliveryPipelineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeleteDeliveryPipelineRequest} DeleteDeliveryPipelineRequest instance + */ + DeleteDeliveryPipelineRequest.create = function create(properties) { + return new DeleteDeliveryPipelineRequest(properties); + }; + + /** + * Encodes the specified DeleteDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeliveryPipelineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest} message DeleteDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeliveryPipelineRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeliveryPipelineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest} message DeleteDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeliveryPipelineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDeliveryPipelineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeleteDeliveryPipelineRequest} DeleteDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeliveryPipelineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 6: { + message.force = reader.bool(); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeleteDeliveryPipelineRequest} DeleteDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeliveryPipelineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDeliveryPipelineRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDeliveryPipelineRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeleteDeliveryPipelineRequest} DeleteDeliveryPipelineRequest + */ + DeleteDeliveryPipelineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest) + return object; + var message = new $root.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteDeliveryPipelineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.DeleteDeliveryPipelineRequest} message DeleteDeliveryPipelineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDeliveryPipelineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.allowMissing = false; + object.validateOnly = false; + object.etag = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + 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 DeleteDeliveryPipelineRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDeliveryPipelineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDeliveryPipelineRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDeliveryPipelineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeleteDeliveryPipelineRequest"; + }; + + return DeleteDeliveryPipelineRequest; + })(); + + v1.Target = (function() { + + /** + * Properties of a Target. + * @memberof google.cloud.deploy.v1 + * @interface ITarget + * @property {string|null} [name] Target name + * @property {string|null} [targetId] Target targetId + * @property {string|null} [uid] Target uid + * @property {string|null} [description] Target description + * @property {Object.|null} [annotations] Target annotations + * @property {Object.|null} [labels] Target labels + * @property {boolean|null} [requireApproval] Target requireApproval + * @property {google.protobuf.ITimestamp|null} [createTime] Target createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Target updateTime + * @property {google.cloud.deploy.v1.IGkeCluster|null} [gke] Target gke + * @property {google.cloud.deploy.v1.IAnthosCluster|null} [anthosCluster] Target anthosCluster + * @property {google.cloud.deploy.v1.ICloudRunLocation|null} [run] Target run + * @property {string|null} [etag] Target etag + * @property {Array.|null} [executionConfigs] Target executionConfigs + */ + + /** + * Constructs a new Target. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Target. + * @implements ITarget + * @constructor + * @param {google.cloud.deploy.v1.ITarget=} [properties] Properties to set + */ + function Target(properties) { + this.annotations = {}; + this.labels = {}; + this.executionConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Target name. + * @member {string} name + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.name = ""; + + /** + * Target targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.targetId = ""; + + /** + * Target uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.uid = ""; + + /** + * Target description. + * @member {string} description + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.description = ""; + + /** + * Target annotations. + * @member {Object.} annotations + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.annotations = $util.emptyObject; + + /** + * Target labels. + * @member {Object.} labels + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.labels = $util.emptyObject; + + /** + * Target requireApproval. + * @member {boolean} requireApproval + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.requireApproval = false; + + /** + * Target createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.createTime = null; + + /** + * Target updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.updateTime = null; + + /** + * Target gke. + * @member {google.cloud.deploy.v1.IGkeCluster|null|undefined} gke + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.gke = null; + + /** + * Target anthosCluster. + * @member {google.cloud.deploy.v1.IAnthosCluster|null|undefined} anthosCluster + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.anthosCluster = null; + + /** + * Target run. + * @member {google.cloud.deploy.v1.ICloudRunLocation|null|undefined} run + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.run = null; + + /** + * Target etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.etag = ""; + + /** + * Target executionConfigs. + * @member {Array.} executionConfigs + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.executionConfigs = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Target deploymentTarget. + * @member {"gke"|"anthosCluster"|"run"|undefined} deploymentTarget + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Object.defineProperty(Target.prototype, "deploymentTarget", { + get: $util.oneOfGetter($oneOfFields = ["gke", "anthosCluster", "run"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Target instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {google.cloud.deploy.v1.ITarget=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Target} Target instance + */ + Target.create = function create(properties) { + return new Target(properties); + }; + + /** + * Encodes the specified Target message. Does not implicitly {@link google.cloud.deploy.v1.Target.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {google.cloud.deploy.v1.ITarget} message Target message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Target.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetId); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); + if (message.requireApproval != null && Object.hasOwnProperty.call(message, "requireApproval")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.requireApproval); + if (message.gke != null && Object.hasOwnProperty.call(message, "gke")) + $root.google.cloud.deploy.v1.GkeCluster.encode(message.gke, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.executionConfigs != null && message.executionConfigs.length) + for (var i = 0; i < message.executionConfigs.length; ++i) + $root.google.cloud.deploy.v1.ExecutionConfig.encode(message.executionConfigs[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.anthosCluster != null && Object.hasOwnProperty.call(message, "anthosCluster")) + $root.google.cloud.deploy.v1.AnthosCluster.encode(message.anthosCluster, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.run != null && Object.hasOwnProperty.call(message, "run")) + $root.google.cloud.deploy.v1.CloudRunLocation.encode(message.run, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Target message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Target.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {google.cloud.deploy.v1.ITarget} message Target message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Target.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Target message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Target} Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Target.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Target(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.targetId = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 6: { + 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 13: { + message.requireApproval = reader.bool(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.gke = $root.google.cloud.deploy.v1.GkeCluster.decode(reader, reader.uint32()); + break; + } + case 17: { + message.anthosCluster = $root.google.cloud.deploy.v1.AnthosCluster.decode(reader, reader.uint32()); + break; + } + case 18: { + message.run = $root.google.cloud.deploy.v1.CloudRunLocation.decode(reader, reader.uint32()); + break; + } + case 12: { + message.etag = reader.string(); + break; + } + case 16: { + if (!(message.executionConfigs && message.executionConfigs.length)) + message.executionConfigs = []; + message.executionConfigs.push($root.google.cloud.deploy.v1.ExecutionConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Target message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Target} Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Target.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Target message. + * @function verify + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Target.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.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.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.requireApproval != null && message.hasOwnProperty("requireApproval")) + if (typeof message.requireApproval !== "boolean") + return "requireApproval: boolean 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.gke != null && message.hasOwnProperty("gke")) { + properties.deploymentTarget = 1; + { + var error = $root.google.cloud.deploy.v1.GkeCluster.verify(message.gke); + if (error) + return "gke." + error; + } + } + if (message.anthosCluster != null && message.hasOwnProperty("anthosCluster")) { + if (properties.deploymentTarget === 1) + return "deploymentTarget: multiple values"; + properties.deploymentTarget = 1; + { + var error = $root.google.cloud.deploy.v1.AnthosCluster.verify(message.anthosCluster); + if (error) + return "anthosCluster." + error; + } + } + if (message.run != null && message.hasOwnProperty("run")) { + if (properties.deploymentTarget === 1) + return "deploymentTarget: multiple values"; + properties.deploymentTarget = 1; + { + var error = $root.google.cloud.deploy.v1.CloudRunLocation.verify(message.run); + if (error) + return "run." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.executionConfigs != null && message.hasOwnProperty("executionConfigs")) { + if (!Array.isArray(message.executionConfigs)) + return "executionConfigs: array expected"; + for (var i = 0; i < message.executionConfigs.length; ++i) { + var error = $root.google.cloud.deploy.v1.ExecutionConfig.verify(message.executionConfigs[i]); + if (error) + return "executionConfigs." + error; + } + } + return null; + }; + + /** + * Creates a Target message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Target} Target + */ + Target.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Target) + return object; + var message = new $root.google.cloud.deploy.v1.Target(); + if (object.name != null) + message.name = String(object.name); + if (object.targetId != null) + message.targetId = String(object.targetId); + if (object.uid != null) + message.uid = String(object.uid); + if (object.description != null) + message.description = String(object.description); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.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.requireApproval != null) + message.requireApproval = Boolean(object.requireApproval); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.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.deploy.v1.Target.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.gke != null) { + if (typeof object.gke !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.gke: object expected"); + message.gke = $root.google.cloud.deploy.v1.GkeCluster.fromObject(object.gke); + } + if (object.anthosCluster != null) { + if (typeof object.anthosCluster !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.anthosCluster: object expected"); + message.anthosCluster = $root.google.cloud.deploy.v1.AnthosCluster.fromObject(object.anthosCluster); + } + if (object.run != null) { + if (typeof object.run !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.run: object expected"); + message.run = $root.google.cloud.deploy.v1.CloudRunLocation.fromObject(object.run); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.executionConfigs) { + if (!Array.isArray(object.executionConfigs)) + throw TypeError(".google.cloud.deploy.v1.Target.executionConfigs: array expected"); + message.executionConfigs = []; + for (var i = 0; i < object.executionConfigs.length; ++i) { + if (typeof object.executionConfigs[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.executionConfigs: object expected"); + message.executionConfigs[i] = $root.google.cloud.deploy.v1.ExecutionConfig.fromObject(object.executionConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Target message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {google.cloud.deploy.v1.Target} message Target + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Target.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.executionConfigs = []; + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + } + if (options.defaults) { + object.name = ""; + object.targetId = ""; + object.uid = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.requireApproval = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.requireApproval != null && message.hasOwnProperty("requireApproval")) + object.requireApproval = message.requireApproval; + if (message.gke != null && message.hasOwnProperty("gke")) { + object.gke = $root.google.cloud.deploy.v1.GkeCluster.toObject(message.gke, options); + if (options.oneofs) + object.deploymentTarget = "gke"; + } + if (message.executionConfigs && message.executionConfigs.length) { + object.executionConfigs = []; + for (var j = 0; j < message.executionConfigs.length; ++j) + object.executionConfigs[j] = $root.google.cloud.deploy.v1.ExecutionConfig.toObject(message.executionConfigs[j], options); + } + if (message.anthosCluster != null && message.hasOwnProperty("anthosCluster")) { + object.anthosCluster = $root.google.cloud.deploy.v1.AnthosCluster.toObject(message.anthosCluster, options); + if (options.oneofs) + object.deploymentTarget = "anthosCluster"; + } + if (message.run != null && message.hasOwnProperty("run")) { + object.run = $root.google.cloud.deploy.v1.CloudRunLocation.toObject(message.run, options); + if (options.oneofs) + object.deploymentTarget = "run"; + } + return object; + }; + + /** + * Converts this Target to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Target + * @instance + * @returns {Object.} JSON object + */ + Target.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Target + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Target.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Target"; + }; + + return Target; + })(); + + v1.ExecutionConfig = (function() { + + /** + * Properties of an ExecutionConfig. + * @memberof google.cloud.deploy.v1 + * @interface IExecutionConfig + * @property {Array.|null} [usages] ExecutionConfig usages + * @property {google.cloud.deploy.v1.IDefaultPool|null} [defaultPool] ExecutionConfig defaultPool + * @property {google.cloud.deploy.v1.IPrivatePool|null} [privatePool] ExecutionConfig privatePool + * @property {string|null} [workerPool] ExecutionConfig workerPool + * @property {string|null} [serviceAccount] ExecutionConfig serviceAccount + * @property {string|null} [artifactStorage] ExecutionConfig artifactStorage + * @property {google.protobuf.IDuration|null} [executionTimeout] ExecutionConfig executionTimeout + */ + + /** + * Constructs a new ExecutionConfig. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an ExecutionConfig. + * @implements IExecutionConfig + * @constructor + * @param {google.cloud.deploy.v1.IExecutionConfig=} [properties] Properties to set + */ + function ExecutionConfig(properties) { + this.usages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutionConfig usages. + * @member {Array.} usages + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.usages = $util.emptyArray; + + /** + * ExecutionConfig defaultPool. + * @member {google.cloud.deploy.v1.IDefaultPool|null|undefined} defaultPool + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.defaultPool = null; + + /** + * ExecutionConfig privatePool. + * @member {google.cloud.deploy.v1.IPrivatePool|null|undefined} privatePool + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.privatePool = null; + + /** + * ExecutionConfig workerPool. + * @member {string} workerPool + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.workerPool = ""; + + /** + * ExecutionConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.serviceAccount = ""; + + /** + * ExecutionConfig artifactStorage. + * @member {string} artifactStorage + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.artifactStorage = ""; + + /** + * ExecutionConfig executionTimeout. + * @member {google.protobuf.IDuration|null|undefined} executionTimeout + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.executionTimeout = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecutionConfig executionEnvironment. + * @member {"defaultPool"|"privatePool"|undefined} executionEnvironment + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + Object.defineProperty(ExecutionConfig.prototype, "executionEnvironment", { + get: $util.oneOfGetter($oneOfFields = ["defaultPool", "privatePool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecutionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {google.cloud.deploy.v1.IExecutionConfig=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ExecutionConfig} ExecutionConfig instance + */ + ExecutionConfig.create = function create(properties) { + return new ExecutionConfig(properties); + }; + + /** + * Encodes the specified ExecutionConfig message. Does not implicitly {@link google.cloud.deploy.v1.ExecutionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {google.cloud.deploy.v1.IExecutionConfig} message ExecutionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.usages != null && message.usages.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.usages.length; ++i) + writer.int32(message.usages[i]); + writer.ldelim(); + } + if (message.defaultPool != null && Object.hasOwnProperty.call(message, "defaultPool")) + $root.google.cloud.deploy.v1.DefaultPool.encode(message.defaultPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.privatePool != null && Object.hasOwnProperty.call(message, "privatePool")) + $root.google.cloud.deploy.v1.PrivatePool.encode(message.privatePool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.workerPool); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); + if (message.artifactStorage != null && Object.hasOwnProperty.call(message, "artifactStorage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.artifactStorage); + if (message.executionTimeout != null && Object.hasOwnProperty.call(message, "executionTimeout")) + $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecutionConfig message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ExecutionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {google.cloud.deploy.v1.IExecutionConfig} message ExecutionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ExecutionConfig} ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ExecutionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.usages && message.usages.length)) + message.usages = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.usages.push(reader.int32()); + } else + message.usages.push(reader.int32()); + break; + } + case 2: { + message.defaultPool = $root.google.cloud.deploy.v1.DefaultPool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.privatePool = $root.google.cloud.deploy.v1.PrivatePool.decode(reader, reader.uint32()); + break; + } + case 4: { + message.workerPool = reader.string(); + break; + } + case 5: { + message.serviceAccount = reader.string(); + break; + } + case 6: { + message.artifactStorage = reader.string(); + break; + } + case 7: { + message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ExecutionConfig} ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutionConfig message. + * @function verify + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.usages != null && message.hasOwnProperty("usages")) { + if (!Array.isArray(message.usages)) + return "usages: array expected"; + for (var i = 0; i < message.usages.length; ++i) + switch (message.usages[i]) { + default: + return "usages: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.defaultPool != null && message.hasOwnProperty("defaultPool")) { + properties.executionEnvironment = 1; + { + var error = $root.google.cloud.deploy.v1.DefaultPool.verify(message.defaultPool); + if (error) + return "defaultPool." + error; + } + } + if (message.privatePool != null && message.hasOwnProperty("privatePool")) { + if (properties.executionEnvironment === 1) + return "executionEnvironment: multiple values"; + properties.executionEnvironment = 1; + { + var error = $root.google.cloud.deploy.v1.PrivatePool.verify(message.privatePool); + if (error) + return "privatePool." + error; + } + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + if (!$util.isString(message.artifactStorage)) + return "artifactStorage: string expected"; + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.executionTimeout); + if (error) + return "executionTimeout." + error; + } + return null; + }; + + /** + * Creates an ExecutionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ExecutionConfig} ExecutionConfig + */ + ExecutionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ExecutionConfig) + return object; + var message = new $root.google.cloud.deploy.v1.ExecutionConfig(); + if (object.usages) { + if (!Array.isArray(object.usages)) + throw TypeError(".google.cloud.deploy.v1.ExecutionConfig.usages: array expected"); + message.usages = []; + for (var i = 0; i < object.usages.length; ++i) + switch (object.usages[i]) { + default: + case "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED": + case 0: + message.usages[i] = 0; + break; + case "RENDER": + case 1: + message.usages[i] = 1; + break; + case "DEPLOY": + case 2: + message.usages[i] = 2; + break; + case "VERIFY": + case 3: + message.usages[i] = 3; + break; + } + } + if (object.defaultPool != null) { + if (typeof object.defaultPool !== "object") + throw TypeError(".google.cloud.deploy.v1.ExecutionConfig.defaultPool: object expected"); + message.defaultPool = $root.google.cloud.deploy.v1.DefaultPool.fromObject(object.defaultPool); + } + if (object.privatePool != null) { + if (typeof object.privatePool !== "object") + throw TypeError(".google.cloud.deploy.v1.ExecutionConfig.privatePool: object expected"); + message.privatePool = $root.google.cloud.deploy.v1.PrivatePool.fromObject(object.privatePool); + } + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.artifactStorage != null) + message.artifactStorage = String(object.artifactStorage); + if (object.executionTimeout != null) { + if (typeof object.executionTimeout !== "object") + throw TypeError(".google.cloud.deploy.v1.ExecutionConfig.executionTimeout: object expected"); + message.executionTimeout = $root.google.protobuf.Duration.fromObject(object.executionTimeout); + } + return message; + }; + + /** + * Creates a plain object from an ExecutionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {google.cloud.deploy.v1.ExecutionConfig} message ExecutionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.usages = []; + if (options.defaults) { + object.workerPool = ""; + object.serviceAccount = ""; + object.artifactStorage = ""; + object.executionTimeout = null; + } + if (message.usages && message.usages.length) { + object.usages = []; + for (var j = 0; j < message.usages.length; ++j) + object.usages[j] = options.enums === String ? $root.google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage[message.usages[j]] : message.usages[j]; + } + if (message.defaultPool != null && message.hasOwnProperty("defaultPool")) { + object.defaultPool = $root.google.cloud.deploy.v1.DefaultPool.toObject(message.defaultPool, options); + if (options.oneofs) + object.executionEnvironment = "defaultPool"; + } + if (message.privatePool != null && message.hasOwnProperty("privatePool")) { + object.privatePool = $root.google.cloud.deploy.v1.PrivatePool.toObject(message.privatePool, options); + if (options.oneofs) + object.executionEnvironment = "privatePool"; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + object.artifactStorage = message.artifactStorage; + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) + object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); + return object; + }; + + /** + * Converts this ExecutionConfig to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + * @returns {Object.} JSON object + */ + ExecutionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutionConfig + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ExecutionConfig"; + }; + + /** + * ExecutionEnvironmentUsage enum. + * @name google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage + * @enum {number} + * @property {number} EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED=0 EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED value + * @property {number} RENDER=1 RENDER value + * @property {number} DEPLOY=2 DEPLOY value + * @property {number} VERIFY=3 VERIFY value + */ + ExecutionConfig.ExecutionEnvironmentUsage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RENDER"] = 1; + values[valuesById[2] = "DEPLOY"] = 2; + values[valuesById[3] = "VERIFY"] = 3; + return values; + })(); + + return ExecutionConfig; + })(); + + v1.DefaultPool = (function() { + + /** + * Properties of a DefaultPool. + * @memberof google.cloud.deploy.v1 + * @interface IDefaultPool + * @property {string|null} [serviceAccount] DefaultPool serviceAccount + * @property {string|null} [artifactStorage] DefaultPool artifactStorage + */ + + /** + * Constructs a new DefaultPool. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DefaultPool. + * @implements IDefaultPool + * @constructor + * @param {google.cloud.deploy.v1.IDefaultPool=} [properties] Properties to set + */ + function DefaultPool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefaultPool serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.deploy.v1.DefaultPool + * @instance + */ + DefaultPool.prototype.serviceAccount = ""; + + /** + * DefaultPool artifactStorage. + * @member {string} artifactStorage + * @memberof google.cloud.deploy.v1.DefaultPool + * @instance + */ + DefaultPool.prototype.artifactStorage = ""; + + /** + * Creates a new DefaultPool instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {google.cloud.deploy.v1.IDefaultPool=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DefaultPool} DefaultPool instance + */ + DefaultPool.create = function create(properties) { + return new DefaultPool(properties); + }; + + /** + * Encodes the specified DefaultPool message. Does not implicitly {@link google.cloud.deploy.v1.DefaultPool.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {google.cloud.deploy.v1.IDefaultPool} message DefaultPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultPool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccount); + if (message.artifactStorage != null && Object.hasOwnProperty.call(message, "artifactStorage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.artifactStorage); + return writer; + }; + + /** + * Encodes the specified DefaultPool message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DefaultPool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {google.cloud.deploy.v1.IDefaultPool} message DefaultPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefaultPool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DefaultPool} DefaultPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultPool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DefaultPool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceAccount = reader.string(); + break; + } + case 2: { + message.artifactStorage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefaultPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DefaultPool} DefaultPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefaultPool message. + * @function verify + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefaultPool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + if (!$util.isString(message.artifactStorage)) + return "artifactStorage: string expected"; + return null; + }; + + /** + * Creates a DefaultPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DefaultPool} DefaultPool + */ + DefaultPool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DefaultPool) + return object; + var message = new $root.google.cloud.deploy.v1.DefaultPool(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.artifactStorage != null) + message.artifactStorage = String(object.artifactStorage); + return message; + }; + + /** + * Creates a plain object from a DefaultPool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {google.cloud.deploy.v1.DefaultPool} message DefaultPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefaultPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceAccount = ""; + object.artifactStorage = ""; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + object.artifactStorage = message.artifactStorage; + return object; + }; + + /** + * Converts this DefaultPool to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DefaultPool + * @instance + * @returns {Object.} JSON object + */ + DefaultPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DefaultPool + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DefaultPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DefaultPool"; + }; + + return DefaultPool; + })(); + + v1.PrivatePool = (function() { + + /** + * Properties of a PrivatePool. + * @memberof google.cloud.deploy.v1 + * @interface IPrivatePool + * @property {string|null} [workerPool] PrivatePool workerPool + * @property {string|null} [serviceAccount] PrivatePool serviceAccount + * @property {string|null} [artifactStorage] PrivatePool artifactStorage + */ + + /** + * Constructs a new PrivatePool. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a PrivatePool. + * @implements IPrivatePool + * @constructor + * @param {google.cloud.deploy.v1.IPrivatePool=} [properties] Properties to set + */ + function PrivatePool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivatePool workerPool. + * @member {string} workerPool + * @memberof google.cloud.deploy.v1.PrivatePool + * @instance + */ + PrivatePool.prototype.workerPool = ""; + + /** + * PrivatePool serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.deploy.v1.PrivatePool + * @instance + */ + PrivatePool.prototype.serviceAccount = ""; + + /** + * PrivatePool artifactStorage. + * @member {string} artifactStorage + * @memberof google.cloud.deploy.v1.PrivatePool + * @instance + */ + PrivatePool.prototype.artifactStorage = ""; + + /** + * Creates a new PrivatePool instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {google.cloud.deploy.v1.IPrivatePool=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.PrivatePool} PrivatePool instance + */ + PrivatePool.create = function create(properties) { + return new PrivatePool(properties); + }; + + /** + * Encodes the specified PrivatePool message. Does not implicitly {@link google.cloud.deploy.v1.PrivatePool.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {google.cloud.deploy.v1.IPrivatePool} message PrivatePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivatePool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workerPool); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceAccount); + if (message.artifactStorage != null && Object.hasOwnProperty.call(message, "artifactStorage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.artifactStorage); + return writer; + }; + + /** + * Encodes the specified PrivatePool message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PrivatePool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {google.cloud.deploy.v1.IPrivatePool} message PrivatePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivatePool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivatePool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.PrivatePool} PrivatePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivatePool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.PrivatePool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workerPool = reader.string(); + break; + } + case 2: { + message.serviceAccount = reader.string(); + break; + } + case 3: { + message.artifactStorage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivatePool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.PrivatePool} PrivatePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivatePool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivatePool message. + * @function verify + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivatePool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + if (!$util.isString(message.artifactStorage)) + return "artifactStorage: string expected"; + return null; + }; + + /** + * Creates a PrivatePool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.PrivatePool} PrivatePool + */ + PrivatePool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.PrivatePool) + return object; + var message = new $root.google.cloud.deploy.v1.PrivatePool(); + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.artifactStorage != null) + message.artifactStorage = String(object.artifactStorage); + return message; + }; + + /** + * Creates a plain object from a PrivatePool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {google.cloud.deploy.v1.PrivatePool} message PrivatePool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivatePool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workerPool = ""; + object.serviceAccount = ""; + object.artifactStorage = ""; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + object.artifactStorage = message.artifactStorage; + return object; + }; + + /** + * Converts this PrivatePool to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.PrivatePool + * @instance + * @returns {Object.} JSON object + */ + PrivatePool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivatePool + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivatePool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.PrivatePool"; + }; + + return PrivatePool; + })(); + + v1.GkeCluster = (function() { + + /** + * Properties of a GkeCluster. + * @memberof google.cloud.deploy.v1 + * @interface IGkeCluster + * @property {string|null} [cluster] GkeCluster cluster + * @property {boolean|null} [internalIp] GkeCluster internalIp + */ + + /** + * Constructs a new GkeCluster. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GkeCluster. + * @implements IGkeCluster + * @constructor + * @param {google.cloud.deploy.v1.IGkeCluster=} [properties] Properties to set + */ + function GkeCluster(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GkeCluster cluster. + * @member {string} cluster + * @memberof google.cloud.deploy.v1.GkeCluster + * @instance + */ + GkeCluster.prototype.cluster = ""; + + /** + * GkeCluster internalIp. + * @member {boolean} internalIp + * @memberof google.cloud.deploy.v1.GkeCluster + * @instance + */ + GkeCluster.prototype.internalIp = false; + + /** + * Creates a new GkeCluster instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {google.cloud.deploy.v1.IGkeCluster=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GkeCluster} GkeCluster instance + */ + GkeCluster.create = function create(properties) { + return new GkeCluster(properties); + }; + + /** + * Encodes the specified GkeCluster message. Does not implicitly {@link google.cloud.deploy.v1.GkeCluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {google.cloud.deploy.v1.IGkeCluster} message GkeCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeCluster.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.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.internalIp); + return writer; + }; + + /** + * Encodes the specified GkeCluster message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GkeCluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {google.cloud.deploy.v1.IGkeCluster} message GkeCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeCluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GkeCluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GkeCluster} GkeCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeCluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GkeCluster(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + message.internalIp = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GkeCluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GkeCluster} GkeCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeCluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GkeCluster message. + * @function verify + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GkeCluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + if (typeof message.internalIp !== "boolean") + return "internalIp: boolean expected"; + return null; + }; + + /** + * Creates a GkeCluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GkeCluster} GkeCluster + */ + GkeCluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GkeCluster) + return object; + var message = new $root.google.cloud.deploy.v1.GkeCluster(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.internalIp != null) + message.internalIp = Boolean(object.internalIp); + return message; + }; + + /** + * Creates a plain object from a GkeCluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {google.cloud.deploy.v1.GkeCluster} message GkeCluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GkeCluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cluster = ""; + object.internalIp = false; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + object.internalIp = message.internalIp; + return object; + }; + + /** + * Converts this GkeCluster to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GkeCluster + * @instance + * @returns {Object.} JSON object + */ + GkeCluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GkeCluster + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GkeCluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GkeCluster"; + }; + + return GkeCluster; + })(); + + v1.AnthosCluster = (function() { + + /** + * Properties of an AnthosCluster. + * @memberof google.cloud.deploy.v1 + * @interface IAnthosCluster + * @property {string|null} [membership] AnthosCluster membership + */ + + /** + * Constructs a new AnthosCluster. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an AnthosCluster. + * @implements IAnthosCluster + * @constructor + * @param {google.cloud.deploy.v1.IAnthosCluster=} [properties] Properties to set + */ + function AnthosCluster(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnthosCluster membership. + * @member {string} membership + * @memberof google.cloud.deploy.v1.AnthosCluster + * @instance + */ + AnthosCluster.prototype.membership = ""; + + /** + * Creates a new AnthosCluster instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {google.cloud.deploy.v1.IAnthosCluster=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.AnthosCluster} AnthosCluster instance + */ + AnthosCluster.create = function create(properties) { + return new AnthosCluster(properties); + }; + + /** + * Encodes the specified AnthosCluster message. Does not implicitly {@link google.cloud.deploy.v1.AnthosCluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {google.cloud.deploy.v1.IAnthosCluster} message AnthosCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnthosCluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.membership); + return writer; + }; + + /** + * Encodes the specified AnthosCluster message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AnthosCluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {google.cloud.deploy.v1.IAnthosCluster} message AnthosCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnthosCluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnthosCluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.AnthosCluster} AnthosCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnthosCluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.AnthosCluster(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.membership = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnthosCluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.AnthosCluster} AnthosCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnthosCluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnthosCluster message. + * @function verify + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnthosCluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.membership != null && message.hasOwnProperty("membership")) + if (!$util.isString(message.membership)) + return "membership: string expected"; + return null; + }; + + /** + * Creates an AnthosCluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.AnthosCluster} AnthosCluster + */ + AnthosCluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.AnthosCluster) + return object; + var message = new $root.google.cloud.deploy.v1.AnthosCluster(); + if (object.membership != null) + message.membership = String(object.membership); + return message; + }; + + /** + * Creates a plain object from an AnthosCluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {google.cloud.deploy.v1.AnthosCluster} message AnthosCluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnthosCluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.membership = ""; + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = message.membership; + return object; + }; + + /** + * Converts this AnthosCluster to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.AnthosCluster + * @instance + * @returns {Object.} JSON object + */ + AnthosCluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnthosCluster + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnthosCluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.AnthosCluster"; + }; + + return AnthosCluster; + })(); + + v1.CloudRunLocation = (function() { + + /** + * Properties of a CloudRunLocation. + * @memberof google.cloud.deploy.v1 + * @interface ICloudRunLocation + * @property {string|null} [location] CloudRunLocation location + */ + + /** + * Constructs a new CloudRunLocation. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CloudRunLocation. + * @implements ICloudRunLocation + * @constructor + * @param {google.cloud.deploy.v1.ICloudRunLocation=} [properties] Properties to set + */ + function CloudRunLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudRunLocation location. + * @member {string} location + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @instance + */ + CloudRunLocation.prototype.location = ""; + + /** + * Creates a new CloudRunLocation instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {google.cloud.deploy.v1.ICloudRunLocation=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CloudRunLocation} CloudRunLocation instance + */ + CloudRunLocation.create = function create(properties) { + return new CloudRunLocation(properties); + }; + + /** + * Encodes the specified CloudRunLocation message. Does not implicitly {@link google.cloud.deploy.v1.CloudRunLocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {google.cloud.deploy.v1.ICloudRunLocation} message CloudRunLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudRunLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + return writer; + }; + + /** + * Encodes the specified CloudRunLocation message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CloudRunLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {google.cloud.deploy.v1.ICloudRunLocation} message CloudRunLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudRunLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudRunLocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CloudRunLocation} CloudRunLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudRunLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CloudRunLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudRunLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CloudRunLocation} CloudRunLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudRunLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudRunLocation message. + * @function verify + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudRunLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a CloudRunLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CloudRunLocation} CloudRunLocation + */ + CloudRunLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CloudRunLocation) + return object; + var message = new $root.google.cloud.deploy.v1.CloudRunLocation(); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a CloudRunLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {google.cloud.deploy.v1.CloudRunLocation} message CloudRunLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudRunLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.location = ""; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CloudRunLocation to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @instance + * @returns {Object.} JSON object + */ + CloudRunLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudRunLocation + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudRunLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CloudRunLocation"; + }; + + return CloudRunLocation; + })(); + + v1.ListTargetsRequest = (function() { + + /** + * Properties of a ListTargetsRequest. + * @memberof google.cloud.deploy.v1 + * @interface IListTargetsRequest + * @property {string|null} [parent] ListTargetsRequest parent + * @property {number|null} [pageSize] ListTargetsRequest pageSize + * @property {string|null} [pageToken] ListTargetsRequest pageToken + * @property {string|null} [filter] ListTargetsRequest filter + * @property {string|null} [orderBy] ListTargetsRequest orderBy + */ + + /** + * Constructs a new ListTargetsRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListTargetsRequest. + * @implements IListTargetsRequest + * @constructor + * @param {google.cloud.deploy.v1.IListTargetsRequest=} [properties] Properties to set + */ + function ListTargetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTargetsRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + */ + ListTargetsRequest.prototype.parent = ""; + + /** + * ListTargetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + */ + ListTargetsRequest.prototype.pageSize = 0; + + /** + * ListTargetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + */ + ListTargetsRequest.prototype.pageToken = ""; + + /** + * ListTargetsRequest filter. + * @member {string} filter + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + */ + ListTargetsRequest.prototype.filter = ""; + + /** + * ListTargetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + */ + ListTargetsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListTargetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {google.cloud.deploy.v1.IListTargetsRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListTargetsRequest} ListTargetsRequest instance + */ + ListTargetsRequest.create = function create(properties) { + return new ListTargetsRequest(properties); + }; + + /** + * Encodes the specified ListTargetsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {google.cloud.deploy.v1.IListTargetsRequest} message ListTargetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetsRequest.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 ListTargetsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {google.cloud.deploy.v1.IListTargetsRequest} message ListTargetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListTargetsRequest} ListTargetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListTargetsRequest(); + 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 ListTargetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListTargetsRequest} ListTargetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetsRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetsRequest.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 ListTargetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListTargetsRequest} ListTargetsRequest + */ + ListTargetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListTargetsRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ListTargetsRequest(); + 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 ListTargetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {google.cloud.deploy.v1.ListTargetsRequest} message ListTargetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetsRequest.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 ListTargetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTargetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTargetsRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTargetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListTargetsRequest"; + }; + + return ListTargetsRequest; + })(); + + v1.ListTargetsResponse = (function() { + + /** + * Properties of a ListTargetsResponse. + * @memberof google.cloud.deploy.v1 + * @interface IListTargetsResponse + * @property {Array.|null} [targets] ListTargetsResponse targets + * @property {string|null} [nextPageToken] ListTargetsResponse nextPageToken + * @property {Array.|null} [unreachable] ListTargetsResponse unreachable + */ + + /** + * Constructs a new ListTargetsResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListTargetsResponse. + * @implements IListTargetsResponse + * @constructor + * @param {google.cloud.deploy.v1.IListTargetsResponse=} [properties] Properties to set + */ + function ListTargetsResponse(properties) { + this.targets = []; + 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]]; + } + + /** + * ListTargetsResponse targets. + * @member {Array.} targets + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @instance + */ + ListTargetsResponse.prototype.targets = $util.emptyArray; + + /** + * ListTargetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @instance + */ + ListTargetsResponse.prototype.nextPageToken = ""; + + /** + * ListTargetsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @instance + */ + ListTargetsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListTargetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {google.cloud.deploy.v1.IListTargetsResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListTargetsResponse} ListTargetsResponse instance + */ + ListTargetsResponse.create = function create(properties) { + return new ListTargetsResponse(properties); + }; + + /** + * Encodes the specified ListTargetsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {google.cloud.deploy.v1.IListTargetsResponse} message ListTargetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + $root.google.cloud.deploy.v1.Target.encode(message.targets[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 ListTargetsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {google.cloud.deploy.v1.IListTargetsResponse} message ListTargetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListTargetsResponse} ListTargetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListTargetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.targets && message.targets.length)) + message.targets = []; + message.targets.push($root.google.cloud.deploy.v1.Target.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 ListTargetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListTargetsResponse} ListTargetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetsResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) { + var error = $root.google.cloud.deploy.v1.Target.verify(message.targets[i]); + if (error) + return "targets." + 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 ListTargetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListTargetsResponse} ListTargetsResponse + */ + ListTargetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListTargetsResponse) + return object; + var message = new $root.google.cloud.deploy.v1.ListTargetsResponse(); + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.cloud.deploy.v1.ListTargetsResponse.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) { + if (typeof object.targets[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.ListTargetsResponse.targets: object expected"); + message.targets[i] = $root.google.cloud.deploy.v1.Target.fromObject(object.targets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.deploy.v1.ListTargetsResponse.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 ListTargetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {google.cloud.deploy.v1.ListTargetsResponse} message ListTargetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = $root.google.cloud.deploy.v1.Target.toObject(message.targets[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 ListTargetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTargetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTargetsResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTargetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListTargetsResponse"; + }; + + return ListTargetsResponse; + })(); + + v1.GetTargetRequest = (function() { + + /** + * Properties of a GetTargetRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetTargetRequest + * @property {string|null} [name] GetTargetRequest name + */ + + /** + * Constructs a new GetTargetRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetTargetRequest. + * @implements IGetTargetRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetTargetRequest=} [properties] Properties to set + */ + function GetTargetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTargetRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @instance + */ + GetTargetRequest.prototype.name = ""; + + /** + * Creates a new GetTargetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {google.cloud.deploy.v1.IGetTargetRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetTargetRequest} GetTargetRequest instance + */ + GetTargetRequest.create = function create(properties) { + return new GetTargetRequest(properties); + }; + + /** + * Encodes the specified GetTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetTargetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {google.cloud.deploy.v1.IGetTargetRequest} message GetTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetRequest.encode = function encode(message, writer) { + 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 GetTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetTargetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {google.cloud.deploy.v1.IGetTargetRequest} message GetTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTargetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetTargetRequest} GetTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetTargetRequest(); + 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 GetTargetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetTargetRequest} GetTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTargetRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTargetRequest.verify = function verify(message) { + if (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 GetTargetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetTargetRequest} GetTargetRequest + */ + GetTargetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetTargetRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetTargetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTargetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {google.cloud.deploy.v1.GetTargetRequest} message GetTargetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTargetRequest.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 GetTargetRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @instance + * @returns {Object.} JSON object + */ + GetTargetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTargetRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTargetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetTargetRequest"; + }; + + return GetTargetRequest; + })(); + + v1.CreateTargetRequest = (function() { + + /** + * Properties of a CreateTargetRequest. + * @memberof google.cloud.deploy.v1 + * @interface ICreateTargetRequest + * @property {string|null} [parent] CreateTargetRequest parent + * @property {string|null} [targetId] CreateTargetRequest targetId + * @property {google.cloud.deploy.v1.ITarget|null} [target] CreateTargetRequest target + * @property {string|null} [requestId] CreateTargetRequest requestId + * @property {boolean|null} [validateOnly] CreateTargetRequest validateOnly + */ + + /** + * Constructs a new CreateTargetRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CreateTargetRequest. + * @implements ICreateTargetRequest + * @constructor + * @param {google.cloud.deploy.v1.ICreateTargetRequest=} [properties] Properties to set + */ + function CreateTargetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTargetRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + */ + CreateTargetRequest.prototype.parent = ""; + + /** + * CreateTargetRequest targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + */ + CreateTargetRequest.prototype.targetId = ""; + + /** + * CreateTargetRequest target. + * @member {google.cloud.deploy.v1.ITarget|null|undefined} target + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + */ + CreateTargetRequest.prototype.target = null; + + /** + * CreateTargetRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + */ + CreateTargetRequest.prototype.requestId = ""; + + /** + * CreateTargetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + */ + CreateTargetRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateTargetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {google.cloud.deploy.v1.ICreateTargetRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CreateTargetRequest} CreateTargetRequest instance + */ + CreateTargetRequest.create = function create(properties) { + return new CreateTargetRequest(properties); + }; + + /** + * Encodes the specified CreateTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateTargetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {google.cloud.deploy.v1.ICreateTargetRequest} message CreateTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTargetRequest.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.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetId); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + $root.google.cloud.deploy.v1.Target.encode(message.target, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateTargetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {google.cloud.deploy.v1.ICreateTargetRequest} message CreateTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTargetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTargetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CreateTargetRequest} CreateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTargetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CreateTargetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.targetId = reader.string(); + break; + } + case 3: { + message.target = $root.google.cloud.deploy.v1.Target.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTargetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CreateTargetRequest} CreateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTargetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTargetRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTargetRequest.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.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: string expected"; + if (message.target != null && message.hasOwnProperty("target")) { + var error = $root.google.cloud.deploy.v1.Target.verify(message.target); + if (error) + return "target." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateTargetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CreateTargetRequest} CreateTargetRequest + */ + CreateTargetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CreateTargetRequest) + return object; + var message = new $root.google.cloud.deploy.v1.CreateTargetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.targetId != null) + message.targetId = String(object.targetId); + if (object.target != null) { + if (typeof object.target !== "object") + throw TypeError(".google.cloud.deploy.v1.CreateTargetRequest.target: object expected"); + message.target = $root.google.cloud.deploy.v1.Target.fromObject(object.target); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateTargetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {google.cloud.deploy.v1.CreateTargetRequest} message CreateTargetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTargetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.targetId = ""; + object.target = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + if (message.target != null && message.hasOwnProperty("target")) + object.target = $root.google.cloud.deploy.v1.Target.toObject(message.target, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateTargetRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTargetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTargetRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTargetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CreateTargetRequest"; + }; + + return CreateTargetRequest; + })(); + + v1.UpdateTargetRequest = (function() { + + /** + * Properties of an UpdateTargetRequest. + * @memberof google.cloud.deploy.v1 + * @interface IUpdateTargetRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTargetRequest updateMask + * @property {google.cloud.deploy.v1.ITarget|null} [target] UpdateTargetRequest target + * @property {string|null} [requestId] UpdateTargetRequest requestId + * @property {boolean|null} [allowMissing] UpdateTargetRequest allowMissing + * @property {boolean|null} [validateOnly] UpdateTargetRequest validateOnly + */ + + /** + * Constructs a new UpdateTargetRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an UpdateTargetRequest. + * @implements IUpdateTargetRequest + * @constructor + * @param {google.cloud.deploy.v1.IUpdateTargetRequest=} [properties] Properties to set + */ + function UpdateTargetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTargetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + */ + UpdateTargetRequest.prototype.updateMask = null; + + /** + * UpdateTargetRequest target. + * @member {google.cloud.deploy.v1.ITarget|null|undefined} target + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + */ + UpdateTargetRequest.prototype.target = null; + + /** + * UpdateTargetRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + */ + UpdateTargetRequest.prototype.requestId = ""; + + /** + * UpdateTargetRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + */ + UpdateTargetRequest.prototype.allowMissing = false; + + /** + * UpdateTargetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + */ + UpdateTargetRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateTargetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateTargetRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.UpdateTargetRequest} UpdateTargetRequest instance + */ + UpdateTargetRequest.create = function create(properties) { + return new UpdateTargetRequest(properties); + }; + + /** + * Encodes the specified UpdateTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.UpdateTargetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateTargetRequest} message UpdateTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTargetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + $root.google.cloud.deploy.v1.Target.encode(message.target, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.UpdateTargetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateTargetRequest} message UpdateTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTargetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTargetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.UpdateTargetRequest} UpdateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTargetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.UpdateTargetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.target = $root.google.cloud.deploy.v1.Target.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTargetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.UpdateTargetRequest} UpdateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTargetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTargetRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTargetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.target != null && message.hasOwnProperty("target")) { + var error = $root.google.cloud.deploy.v1.Target.verify(message.target); + if (error) + return "target." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateTargetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.UpdateTargetRequest} UpdateTargetRequest + */ + UpdateTargetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.UpdateTargetRequest) + return object; + var message = new $root.google.cloud.deploy.v1.UpdateTargetRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.deploy.v1.UpdateTargetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.target != null) { + if (typeof object.target !== "object") + throw TypeError(".google.cloud.deploy.v1.UpdateTargetRequest.target: object expected"); + message.target = $root.google.cloud.deploy.v1.Target.fromObject(object.target); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateTargetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {google.cloud.deploy.v1.UpdateTargetRequest} message UpdateTargetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTargetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.target = null; + object.requestId = ""; + object.allowMissing = false; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = $root.google.cloud.deploy.v1.Target.toObject(message.target, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateTargetRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTargetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTargetRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTargetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.UpdateTargetRequest"; + }; + + return UpdateTargetRequest; + })(); + + v1.DeleteTargetRequest = (function() { + + /** + * Properties of a DeleteTargetRequest. + * @memberof google.cloud.deploy.v1 + * @interface IDeleteTargetRequest + * @property {string|null} [name] DeleteTargetRequest name + * @property {string|null} [requestId] DeleteTargetRequest requestId + * @property {boolean|null} [allowMissing] DeleteTargetRequest allowMissing + * @property {boolean|null} [validateOnly] DeleteTargetRequest validateOnly + * @property {string|null} [etag] DeleteTargetRequest etag + */ + + /** + * Constructs a new DeleteTargetRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeleteTargetRequest. + * @implements IDeleteTargetRequest + * @constructor + * @param {google.cloud.deploy.v1.IDeleteTargetRequest=} [properties] Properties to set + */ + function DeleteTargetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTargetRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + */ + DeleteTargetRequest.prototype.name = ""; + + /** + * DeleteTargetRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + */ + DeleteTargetRequest.prototype.requestId = ""; + + /** + * DeleteTargetRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + */ + DeleteTargetRequest.prototype.allowMissing = false; + + /** + * DeleteTargetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + */ + DeleteTargetRequest.prototype.validateOnly = false; + + /** + * DeleteTargetRequest etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + */ + DeleteTargetRequest.prototype.etag = ""; + + /** + * Creates a new DeleteTargetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteTargetRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeleteTargetRequest} DeleteTargetRequest instance + */ + DeleteTargetRequest.create = function create(properties) { + return new DeleteTargetRequest(properties); + }; + + /** + * Encodes the specified DeleteTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.DeleteTargetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteTargetRequest} message DeleteTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeleteTargetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteTargetRequest} message DeleteTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTargetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeleteTargetRequest} DeleteTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeleteTargetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTargetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeleteTargetRequest} DeleteTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTargetRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTargetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteTargetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeleteTargetRequest} DeleteTargetRequest + */ + DeleteTargetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeleteTargetRequest) + return object; + var message = new $root.google.cloud.deploy.v1.DeleteTargetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteTargetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {google.cloud.deploy.v1.DeleteTargetRequest} message DeleteTargetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTargetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.allowMissing = false; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteTargetRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTargetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTargetRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTargetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeleteTargetRequest"; + }; + + return DeleteTargetRequest; + })(); + + v1.Release = (function() { + + /** + * Properties of a Release. + * @memberof google.cloud.deploy.v1 + * @interface IRelease + * @property {string|null} [name] Release name + * @property {string|null} [uid] Release uid + * @property {string|null} [description] Release description + * @property {Object.|null} [annotations] Release annotations + * @property {Object.|null} [labels] Release labels + * @property {boolean|null} [abandoned] Release abandoned + * @property {google.protobuf.ITimestamp|null} [createTime] Release createTime + * @property {google.protobuf.ITimestamp|null} [renderStartTime] Release renderStartTime + * @property {google.protobuf.ITimestamp|null} [renderEndTime] Release renderEndTime + * @property {string|null} [skaffoldConfigUri] Release skaffoldConfigUri + * @property {string|null} [skaffoldConfigPath] Release skaffoldConfigPath + * @property {Array.|null} [buildArtifacts] Release buildArtifacts + * @property {google.cloud.deploy.v1.IDeliveryPipeline|null} [deliveryPipelineSnapshot] Release deliveryPipelineSnapshot + * @property {Array.|null} [targetSnapshots] Release targetSnapshots + * @property {google.cloud.deploy.v1.Release.RenderState|null} [renderState] Release renderState + * @property {string|null} [etag] Release etag + * @property {string|null} [skaffoldVersion] Release skaffoldVersion + * @property {Object.|null} [targetArtifacts] Release targetArtifacts + * @property {Object.|null} [targetRenders] Release targetRenders + */ + + /** + * Constructs a new Release. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Release. + * @implements IRelease + * @constructor + * @param {google.cloud.deploy.v1.IRelease=} [properties] Properties to set + */ + function Release(properties) { + this.annotations = {}; + this.labels = {}; + this.buildArtifacts = []; + this.targetSnapshots = []; + this.targetArtifacts = {}; + this.targetRenders = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Release name. + * @member {string} name + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.name = ""; + + /** + * Release uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.uid = ""; + + /** + * Release description. + * @member {string} description + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.description = ""; + + /** + * Release annotations. + * @member {Object.} annotations + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.annotations = $util.emptyObject; + + /** + * Release labels. + * @member {Object.} labels + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.labels = $util.emptyObject; + + /** + * Release abandoned. + * @member {boolean} abandoned + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.abandoned = false; + + /** + * Release createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.createTime = null; + + /** + * Release renderStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} renderStartTime + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.renderStartTime = null; + + /** + * Release renderEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} renderEndTime + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.renderEndTime = null; + + /** + * Release skaffoldConfigUri. + * @member {string} skaffoldConfigUri + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.skaffoldConfigUri = ""; + + /** + * Release skaffoldConfigPath. + * @member {string} skaffoldConfigPath + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.skaffoldConfigPath = ""; + + /** + * Release buildArtifacts. + * @member {Array.} buildArtifacts + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.buildArtifacts = $util.emptyArray; + + /** + * Release deliveryPipelineSnapshot. + * @member {google.cloud.deploy.v1.IDeliveryPipeline|null|undefined} deliveryPipelineSnapshot + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.deliveryPipelineSnapshot = null; + + /** + * Release targetSnapshots. + * @member {Array.} targetSnapshots + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.targetSnapshots = $util.emptyArray; + + /** + * Release renderState. + * @member {google.cloud.deploy.v1.Release.RenderState} renderState + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.renderState = 0; + + /** + * Release etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.etag = ""; + + /** + * Release skaffoldVersion. + * @member {string} skaffoldVersion + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.skaffoldVersion = ""; + + /** + * Release targetArtifacts. + * @member {Object.} targetArtifacts + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.targetArtifacts = $util.emptyObject; + + /** + * Release targetRenders. + * @member {Object.} targetRenders + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.targetRenders = $util.emptyObject; + + /** + * Creates a new Release instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.IRelease=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Release} Release instance + */ + Release.create = function create(properties) { + return new Release(properties); + }; + + /** + * Encodes the specified Release message. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.IRelease} message Release message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Release.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.renderStartTime != null && Object.hasOwnProperty.call(message, "renderStartTime")) + $root.google.protobuf.Timestamp.encode(message.renderStartTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.renderEndTime != null && Object.hasOwnProperty.call(message, "renderEndTime")) + $root.google.protobuf.Timestamp.encode(message.renderEndTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.skaffoldConfigPath != null && Object.hasOwnProperty.call(message, "skaffoldConfigPath")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.skaffoldConfigPath); + if (message.buildArtifacts != null && message.buildArtifacts.length) + for (var i = 0; i < message.buildArtifacts.length; ++i) + $root.google.cloud.deploy.v1.BuildArtifact.encode(message.buildArtifacts[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.deliveryPipelineSnapshot != null && Object.hasOwnProperty.call(message, "deliveryPipelineSnapshot")) + $root.google.cloud.deploy.v1.DeliveryPipeline.encode(message.deliveryPipelineSnapshot, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.targetSnapshots != null && message.targetSnapshots.length) + for (var i = 0; i < message.targetSnapshots.length; ++i) + $root.google.cloud.deploy.v1.Target.encode(message.targetSnapshots[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.renderState != null && Object.hasOwnProperty.call(message, "renderState")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.renderState); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.etag); + if (message.skaffoldConfigUri != null && Object.hasOwnProperty.call(message, "skaffoldConfigUri")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.skaffoldConfigUri); + if (message.skaffoldVersion != null && Object.hasOwnProperty.call(message, "skaffoldVersion")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.skaffoldVersion); + if (message.targetArtifacts != null && Object.hasOwnProperty.call(message, "targetArtifacts")) + for (var keys = Object.keys(message.targetArtifacts), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 20, wireType 2 =*/162).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.deploy.v1.TargetArtifact.encode(message.targetArtifacts[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.targetRenders != null && Object.hasOwnProperty.call(message, "targetRenders")) + for (var keys = Object.keys(message.targetRenders), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.deploy.v1.Release.TargetRender.encode(message.targetRenders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.abandoned != null && Object.hasOwnProperty.call(message, "abandoned")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.abandoned); + return writer; + }; + + /** + * Encodes the specified Release message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.IRelease} message Release message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Release.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Release message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Release} Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Release.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release(), 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.description = reader.string(); + break; + } + case 4: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 23: { + message.abandoned = reader.bool(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.renderStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.renderEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.skaffoldConfigUri = reader.string(); + break; + } + case 9: { + message.skaffoldConfigPath = reader.string(); + break; + } + case 10: { + if (!(message.buildArtifacts && message.buildArtifacts.length)) + message.buildArtifacts = []; + message.buildArtifacts.push($root.google.cloud.deploy.v1.BuildArtifact.decode(reader, reader.uint32())); + break; + } + case 11: { + message.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.targetSnapshots && message.targetSnapshots.length)) + message.targetSnapshots = []; + message.targetSnapshots.push($root.google.cloud.deploy.v1.Target.decode(reader, reader.uint32())); + break; + } + case 13: { + message.renderState = reader.int32(); + break; + } + case 16: { + message.etag = reader.string(); + break; + } + case 19: { + message.skaffoldVersion = reader.string(); + break; + } + case 20: { + if (message.targetArtifacts === $util.emptyObject) + message.targetArtifacts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.deploy.v1.TargetArtifact.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.targetArtifacts[key] = value; + break; + } + case 22: { + if (message.targetRenders === $util.emptyObject) + message.targetRenders = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.deploy.v1.Release.TargetRender.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.targetRenders[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Release message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Release} Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Release.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Release message. + * @function verify + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Release.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.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.abandoned != null && message.hasOwnProperty("abandoned")) + if (typeof message.abandoned !== "boolean") + return "abandoned: boolean expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.renderStartTime != null && message.hasOwnProperty("renderStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.renderStartTime); + if (error) + return "renderStartTime." + error; + } + if (message.renderEndTime != null && message.hasOwnProperty("renderEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.renderEndTime); + if (error) + return "renderEndTime." + error; + } + if (message.skaffoldConfigUri != null && message.hasOwnProperty("skaffoldConfigUri")) + if (!$util.isString(message.skaffoldConfigUri)) + return "skaffoldConfigUri: string expected"; + if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) + if (!$util.isString(message.skaffoldConfigPath)) + return "skaffoldConfigPath: string expected"; + if (message.buildArtifacts != null && message.hasOwnProperty("buildArtifacts")) { + if (!Array.isArray(message.buildArtifacts)) + return "buildArtifacts: array expected"; + for (var i = 0; i < message.buildArtifacts.length; ++i) { + var error = $root.google.cloud.deploy.v1.BuildArtifact.verify(message.buildArtifacts[i]); + if (error) + return "buildArtifacts." + error; + } + } + if (message.deliveryPipelineSnapshot != null && message.hasOwnProperty("deliveryPipelineSnapshot")) { + var error = $root.google.cloud.deploy.v1.DeliveryPipeline.verify(message.deliveryPipelineSnapshot); + if (error) + return "deliveryPipelineSnapshot." + error; + } + if (message.targetSnapshots != null && message.hasOwnProperty("targetSnapshots")) { + if (!Array.isArray(message.targetSnapshots)) + return "targetSnapshots: array expected"; + for (var i = 0; i < message.targetSnapshots.length; ++i) { + var error = $root.google.cloud.deploy.v1.Target.verify(message.targetSnapshots[i]); + if (error) + return "targetSnapshots." + error; + } + } + if (message.renderState != null && message.hasOwnProperty("renderState")) + switch (message.renderState) { + default: + return "renderState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.skaffoldVersion != null && message.hasOwnProperty("skaffoldVersion")) + if (!$util.isString(message.skaffoldVersion)) + return "skaffoldVersion: string expected"; + if (message.targetArtifacts != null && message.hasOwnProperty("targetArtifacts")) { + if (!$util.isObject(message.targetArtifacts)) + return "targetArtifacts: object expected"; + var key = Object.keys(message.targetArtifacts); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.deploy.v1.TargetArtifact.verify(message.targetArtifacts[key[i]]); + if (error) + return "targetArtifacts." + error; + } + } + if (message.targetRenders != null && message.hasOwnProperty("targetRenders")) { + if (!$util.isObject(message.targetRenders)) + return "targetRenders: object expected"; + var key = Object.keys(message.targetRenders); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.deploy.v1.Release.TargetRender.verify(message.targetRenders[key[i]]); + if (error) + return "targetRenders." + error; + } + } + return null; + }; + + /** + * Creates a Release message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Release} Release + */ + Release.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Release) + return object; + var message = new $root.google.cloud.deploy.v1.Release(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.description != null) + message.description = String(object.description); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.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.abandoned != null) + message.abandoned = Boolean(object.abandoned); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.renderStartTime != null) { + if (typeof object.renderStartTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.renderStartTime: object expected"); + message.renderStartTime = $root.google.protobuf.Timestamp.fromObject(object.renderStartTime); + } + if (object.renderEndTime != null) { + if (typeof object.renderEndTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.renderEndTime: object expected"); + message.renderEndTime = $root.google.protobuf.Timestamp.fromObject(object.renderEndTime); + } + if (object.skaffoldConfigUri != null) + message.skaffoldConfigUri = String(object.skaffoldConfigUri); + if (object.skaffoldConfigPath != null) + message.skaffoldConfigPath = String(object.skaffoldConfigPath); + if (object.buildArtifacts) { + if (!Array.isArray(object.buildArtifacts)) + throw TypeError(".google.cloud.deploy.v1.Release.buildArtifacts: array expected"); + message.buildArtifacts = []; + for (var i = 0; i < object.buildArtifacts.length; ++i) { + if (typeof object.buildArtifacts[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.buildArtifacts: object expected"); + message.buildArtifacts[i] = $root.google.cloud.deploy.v1.BuildArtifact.fromObject(object.buildArtifacts[i]); + } + } + if (object.deliveryPipelineSnapshot != null) { + if (typeof object.deliveryPipelineSnapshot !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.deliveryPipelineSnapshot: object expected"); + message.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.fromObject(object.deliveryPipelineSnapshot); + } + if (object.targetSnapshots) { + if (!Array.isArray(object.targetSnapshots)) + throw TypeError(".google.cloud.deploy.v1.Release.targetSnapshots: array expected"); + message.targetSnapshots = []; + for (var i = 0; i < object.targetSnapshots.length; ++i) { + if (typeof object.targetSnapshots[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetSnapshots: object expected"); + message.targetSnapshots[i] = $root.google.cloud.deploy.v1.Target.fromObject(object.targetSnapshots[i]); + } + } + switch (object.renderState) { + case "RENDER_STATE_UNSPECIFIED": + case 0: + message.renderState = 0; + break; + case "SUCCEEDED": + case 1: + message.renderState = 1; + break; + case "FAILED": + case 2: + message.renderState = 2; + break; + case "IN_PROGRESS": + case 3: + message.renderState = 3; + break; + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.skaffoldVersion != null) + message.skaffoldVersion = String(object.skaffoldVersion); + if (object.targetArtifacts) { + if (typeof object.targetArtifacts !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetArtifacts: object expected"); + message.targetArtifacts = {}; + for (var keys = Object.keys(object.targetArtifacts), i = 0; i < keys.length; ++i) { + if (typeof object.targetArtifacts[keys[i]] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetArtifacts: object expected"); + message.targetArtifacts[keys[i]] = $root.google.cloud.deploy.v1.TargetArtifact.fromObject(object.targetArtifacts[keys[i]]); + } + } + if (object.targetRenders) { + if (typeof object.targetRenders !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetRenders: object expected"); + message.targetRenders = {}; + for (var keys = Object.keys(object.targetRenders), i = 0; i < keys.length; ++i) { + if (typeof object.targetRenders[keys[i]] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetRenders: object expected"); + message.targetRenders[keys[i]] = $root.google.cloud.deploy.v1.Release.TargetRender.fromObject(object.targetRenders[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Release message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.Release} message Release + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Release.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.buildArtifacts = []; + object.targetSnapshots = []; + } + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + object.targetArtifacts = {}; + object.targetRenders = {}; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.description = ""; + object.createTime = null; + object.renderStartTime = null; + object.renderEndTime = null; + object.skaffoldConfigPath = ""; + object.deliveryPipelineSnapshot = null; + object.renderState = options.enums === String ? "RENDER_STATE_UNSPECIFIED" : 0; + object.etag = ""; + object.skaffoldConfigUri = ""; + object.skaffoldVersion = ""; + object.abandoned = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.renderStartTime != null && message.hasOwnProperty("renderStartTime")) + object.renderStartTime = $root.google.protobuf.Timestamp.toObject(message.renderStartTime, options); + if (message.renderEndTime != null && message.hasOwnProperty("renderEndTime")) + object.renderEndTime = $root.google.protobuf.Timestamp.toObject(message.renderEndTime, options); + if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) + object.skaffoldConfigPath = message.skaffoldConfigPath; + if (message.buildArtifacts && message.buildArtifacts.length) { + object.buildArtifacts = []; + for (var j = 0; j < message.buildArtifacts.length; ++j) + object.buildArtifacts[j] = $root.google.cloud.deploy.v1.BuildArtifact.toObject(message.buildArtifacts[j], options); + } + if (message.deliveryPipelineSnapshot != null && message.hasOwnProperty("deliveryPipelineSnapshot")) + object.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.toObject(message.deliveryPipelineSnapshot, options); + if (message.targetSnapshots && message.targetSnapshots.length) { + object.targetSnapshots = []; + for (var j = 0; j < message.targetSnapshots.length; ++j) + object.targetSnapshots[j] = $root.google.cloud.deploy.v1.Target.toObject(message.targetSnapshots[j], options); + } + if (message.renderState != null && message.hasOwnProperty("renderState")) + object.renderState = options.enums === String ? $root.google.cloud.deploy.v1.Release.RenderState[message.renderState] : message.renderState; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.skaffoldConfigUri != null && message.hasOwnProperty("skaffoldConfigUri")) + object.skaffoldConfigUri = message.skaffoldConfigUri; + if (message.skaffoldVersion != null && message.hasOwnProperty("skaffoldVersion")) + object.skaffoldVersion = message.skaffoldVersion; + if (message.targetArtifacts && (keys2 = Object.keys(message.targetArtifacts)).length) { + object.targetArtifacts = {}; + for (var j = 0; j < keys2.length; ++j) + object.targetArtifacts[keys2[j]] = $root.google.cloud.deploy.v1.TargetArtifact.toObject(message.targetArtifacts[keys2[j]], options); + } + if (message.targetRenders && (keys2 = Object.keys(message.targetRenders)).length) { + object.targetRenders = {}; + for (var j = 0; j < keys2.length; ++j) + object.targetRenders[keys2[j]] = $root.google.cloud.deploy.v1.Release.TargetRender.toObject(message.targetRenders[keys2[j]], options); + } + if (message.abandoned != null && message.hasOwnProperty("abandoned")) + object.abandoned = message.abandoned; + return object; + }; + + /** + * Converts this Release to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Release + * @instance + * @returns {Object.} JSON object + */ + Release.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Release + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Release.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Release"; + }; + + /** + * RenderState enum. + * @name google.cloud.deploy.v1.Release.RenderState + * @enum {number} + * @property {number} RENDER_STATE_UNSPECIFIED=0 RENDER_STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + */ + Release.RenderState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RENDER_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + return values; + })(); + + Release.TargetRender = (function() { + + /** + * Properties of a TargetRender. + * @memberof google.cloud.deploy.v1.Release + * @interface ITargetRender + * @property {string|null} [renderingBuild] TargetRender renderingBuild + * @property {google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|null} [renderingState] TargetRender renderingState + * @property {google.cloud.deploy.v1.Release.TargetRender.FailureCause|null} [failureCause] TargetRender failureCause + * @property {string|null} [failureMessage] TargetRender failureMessage + */ + + /** + * Constructs a new TargetRender. + * @memberof google.cloud.deploy.v1.Release + * @classdesc Represents a TargetRender. + * @implements ITargetRender + * @constructor + * @param {google.cloud.deploy.v1.Release.ITargetRender=} [properties] Properties to set + */ + function TargetRender(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetRender renderingBuild. + * @member {string} renderingBuild + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.renderingBuild = ""; + + /** + * TargetRender renderingState. + * @member {google.cloud.deploy.v1.Release.TargetRender.TargetRenderState} renderingState + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.renderingState = 0; + + /** + * TargetRender failureCause. + * @member {google.cloud.deploy.v1.Release.TargetRender.FailureCause} failureCause + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.failureCause = 0; + + /** + * TargetRender failureMessage. + * @member {string} failureMessage + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.failureMessage = ""; + + /** + * Creates a new TargetRender instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.ITargetRender=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender instance + */ + TargetRender.create = function create(properties) { + return new TargetRender(properties); + }; + + /** + * Encodes the specified TargetRender message. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.ITargetRender} message TargetRender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetRender.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.renderingBuild != null && Object.hasOwnProperty.call(message, "renderingBuild")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderingBuild); + if (message.renderingState != null && Object.hasOwnProperty.call(message, "renderingState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.renderingState); + if (message.failureCause != null && Object.hasOwnProperty.call(message, "failureCause")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failureCause); + if (message.failureMessage != null && Object.hasOwnProperty.call(message, "failureMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.failureMessage); + return writer; + }; + + /** + * Encodes the specified TargetRender message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.ITargetRender} message TargetRender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetRender.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetRender message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetRender.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release.TargetRender(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.renderingBuild = reader.string(); + break; + } + case 2: { + message.renderingState = reader.int32(); + break; + } + case 4: { + message.failureCause = reader.int32(); + break; + } + case 5: { + message.failureMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetRender message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetRender.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetRender message. + * @function verify + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetRender.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.renderingBuild != null && message.hasOwnProperty("renderingBuild")) + if (!$util.isString(message.renderingBuild)) + return "renderingBuild: string expected"; + if (message.renderingState != null && message.hasOwnProperty("renderingState")) + switch (message.renderingState) { + default: + return "renderingState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + switch (message.failureCause) { + default: + return "failureCause: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + if (!$util.isString(message.failureMessage)) + return "failureMessage: string expected"; + return null; + }; + + /** + * Creates a TargetRender message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender + */ + TargetRender.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Release.TargetRender) + return object; + var message = new $root.google.cloud.deploy.v1.Release.TargetRender(); + if (object.renderingBuild != null) + message.renderingBuild = String(object.renderingBuild); + switch (object.renderingState) { + case "TARGET_RENDER_STATE_UNSPECIFIED": + case 0: + message.renderingState = 0; + break; + case "SUCCEEDED": + case 1: + message.renderingState = 1; + break; + case "FAILED": + case 2: + message.renderingState = 2; + break; + case "IN_PROGRESS": + case 3: + message.renderingState = 3; + break; + } + switch (object.failureCause) { + case "FAILURE_CAUSE_UNSPECIFIED": + case 0: + message.failureCause = 0; + break; + case "CLOUD_BUILD_UNAVAILABLE": + case 1: + message.failureCause = 1; + break; + case "EXECUTION_FAILED": + case 2: + message.failureCause = 2; + break; + } + if (object.failureMessage != null) + message.failureMessage = String(object.failureMessage); + return message; + }; + + /** + * Creates a plain object from a TargetRender message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.TargetRender} message TargetRender + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetRender.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.renderingBuild = ""; + object.renderingState = options.enums === String ? "TARGET_RENDER_STATE_UNSPECIFIED" : 0; + object.failureCause = options.enums === String ? "FAILURE_CAUSE_UNSPECIFIED" : 0; + object.failureMessage = ""; + } + if (message.renderingBuild != null && message.hasOwnProperty("renderingBuild")) + object.renderingBuild = message.renderingBuild; + if (message.renderingState != null && message.hasOwnProperty("renderingState")) + object.renderingState = options.enums === String ? $root.google.cloud.deploy.v1.Release.TargetRender.TargetRenderState[message.renderingState] : message.renderingState; + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + object.failureCause = options.enums === String ? $root.google.cloud.deploy.v1.Release.TargetRender.FailureCause[message.failureCause] : message.failureCause; + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + object.failureMessage = message.failureMessage; + return object; + }; + + /** + * Converts this TargetRender to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + * @returns {Object.} JSON object + */ + TargetRender.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetRender + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetRender.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Release.TargetRender"; + }; + + /** + * TargetRenderState enum. + * @name google.cloud.deploy.v1.Release.TargetRender.TargetRenderState + * @enum {number} + * @property {number} TARGET_RENDER_STATE_UNSPECIFIED=0 TARGET_RENDER_STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + */ + TargetRender.TargetRenderState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_RENDER_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + return values; + })(); + + /** + * FailureCause enum. + * @name google.cloud.deploy.v1.Release.TargetRender.FailureCause + * @enum {number} + * @property {number} FAILURE_CAUSE_UNSPECIFIED=0 FAILURE_CAUSE_UNSPECIFIED value + * @property {number} CLOUD_BUILD_UNAVAILABLE=1 CLOUD_BUILD_UNAVAILABLE value + * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value + */ + TargetRender.FailureCause = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_CAUSE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_BUILD_UNAVAILABLE"] = 1; + values[valuesById[2] = "EXECUTION_FAILED"] = 2; + return values; + })(); + + return TargetRender; + })(); + + return Release; + })(); + + v1.BuildArtifact = (function() { + + /** + * Properties of a BuildArtifact. + * @memberof google.cloud.deploy.v1 + * @interface IBuildArtifact + * @property {string|null} [image] BuildArtifact image + * @property {string|null} [tag] BuildArtifact tag + */ + + /** + * Constructs a new BuildArtifact. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a BuildArtifact. + * @implements IBuildArtifact + * @constructor + * @param {google.cloud.deploy.v1.IBuildArtifact=} [properties] Properties to set + */ + function BuildArtifact(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildArtifact image. + * @member {string} image + * @memberof google.cloud.deploy.v1.BuildArtifact + * @instance + */ + BuildArtifact.prototype.image = ""; + + /** + * BuildArtifact tag. + * @member {string} tag + * @memberof google.cloud.deploy.v1.BuildArtifact + * @instance + */ + BuildArtifact.prototype.tag = ""; + + /** + * Creates a new BuildArtifact instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {google.cloud.deploy.v1.IBuildArtifact=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.BuildArtifact} BuildArtifact instance + */ + BuildArtifact.create = function create(properties) { + return new BuildArtifact(properties); + }; + + /** + * Encodes the specified BuildArtifact message. Does not implicitly {@link google.cloud.deploy.v1.BuildArtifact.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {google.cloud.deploy.v1.IBuildArtifact} message BuildArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildArtifact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tag); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.image); + return writer; + }; + + /** + * Encodes the specified BuildArtifact message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.BuildArtifact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {google.cloud.deploy.v1.IBuildArtifact} message BuildArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildArtifact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildArtifact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.BuildArtifact} BuildArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildArtifact.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.BuildArtifact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.image = reader.string(); + break; + } + case 2: { + message.tag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildArtifact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.BuildArtifact} BuildArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildArtifact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildArtifact message. + * @function verify + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildArtifact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + if (message.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + return null; + }; + + /** + * Creates a BuildArtifact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.BuildArtifact} BuildArtifact + */ + BuildArtifact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.BuildArtifact) + return object; + var message = new $root.google.cloud.deploy.v1.BuildArtifact(); + if (object.image != null) + message.image = String(object.image); + if (object.tag != null) + message.tag = String(object.tag); + return message; + }; + + /** + * Creates a plain object from a BuildArtifact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {google.cloud.deploy.v1.BuildArtifact} message BuildArtifact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildArtifact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tag = ""; + object.image = ""; + } + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + return object; + }; + + /** + * Converts this BuildArtifact to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.BuildArtifact + * @instance + * @returns {Object.} JSON object + */ + BuildArtifact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BuildArtifact + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BuildArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.BuildArtifact"; + }; + + return BuildArtifact; + })(); + + v1.TargetArtifact = (function() { + + /** + * Properties of a TargetArtifact. + * @memberof google.cloud.deploy.v1 + * @interface ITargetArtifact + * @property {string|null} [artifactUri] TargetArtifact artifactUri + * @property {string|null} [skaffoldConfigPath] TargetArtifact skaffoldConfigPath + * @property {string|null} [manifestPath] TargetArtifact manifestPath + */ + + /** + * Constructs a new TargetArtifact. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a TargetArtifact. + * @implements ITargetArtifact + * @constructor + * @param {google.cloud.deploy.v1.ITargetArtifact=} [properties] Properties to set + */ + function TargetArtifact(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetArtifact artifactUri. + * @member {string|null|undefined} artifactUri + * @memberof google.cloud.deploy.v1.TargetArtifact + * @instance + */ + TargetArtifact.prototype.artifactUri = null; + + /** + * TargetArtifact skaffoldConfigPath. + * @member {string} skaffoldConfigPath + * @memberof google.cloud.deploy.v1.TargetArtifact + * @instance + */ + TargetArtifact.prototype.skaffoldConfigPath = ""; + + /** + * TargetArtifact manifestPath. + * @member {string} manifestPath + * @memberof google.cloud.deploy.v1.TargetArtifact + * @instance + */ + TargetArtifact.prototype.manifestPath = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetArtifact uri. + * @member {"artifactUri"|undefined} uri + * @memberof google.cloud.deploy.v1.TargetArtifact + * @instance + */ + Object.defineProperty(TargetArtifact.prototype, "uri", { + get: $util.oneOfGetter($oneOfFields = ["artifactUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetArtifact instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {google.cloud.deploy.v1.ITargetArtifact=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.TargetArtifact} TargetArtifact instance + */ + TargetArtifact.create = function create(properties) { + return new TargetArtifact(properties); + }; + + /** + * Encodes the specified TargetArtifact message. Does not implicitly {@link google.cloud.deploy.v1.TargetArtifact.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {google.cloud.deploy.v1.ITargetArtifact} message TargetArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetArtifact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.skaffoldConfigPath != null && Object.hasOwnProperty.call(message, "skaffoldConfigPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.skaffoldConfigPath); + if (message.manifestPath != null && Object.hasOwnProperty.call(message, "manifestPath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.manifestPath); + if (message.artifactUri != null && Object.hasOwnProperty.call(message, "artifactUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.artifactUri); + return writer; + }; + + /** + * Encodes the specified TargetArtifact message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetArtifact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {google.cloud.deploy.v1.ITargetArtifact} message TargetArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetArtifact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetArtifact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.TargetArtifact} TargetArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetArtifact.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.TargetArtifact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.artifactUri = reader.string(); + break; + } + case 2: { + message.skaffoldConfigPath = reader.string(); + break; + } + case 3: { + message.manifestPath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetArtifact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.TargetArtifact} TargetArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetArtifact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetArtifact message. + * @function verify + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetArtifact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.artifactUri != null && message.hasOwnProperty("artifactUri")) { + properties.uri = 1; + if (!$util.isString(message.artifactUri)) + return "artifactUri: string expected"; + } + if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) + if (!$util.isString(message.skaffoldConfigPath)) + return "skaffoldConfigPath: string expected"; + if (message.manifestPath != null && message.hasOwnProperty("manifestPath")) + if (!$util.isString(message.manifestPath)) + return "manifestPath: string expected"; + return null; + }; + + /** + * Creates a TargetArtifact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.TargetArtifact} TargetArtifact + */ + TargetArtifact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.TargetArtifact) + return object; + var message = new $root.google.cloud.deploy.v1.TargetArtifact(); + if (object.artifactUri != null) + message.artifactUri = String(object.artifactUri); + if (object.skaffoldConfigPath != null) + message.skaffoldConfigPath = String(object.skaffoldConfigPath); + if (object.manifestPath != null) + message.manifestPath = String(object.manifestPath); + return message; + }; + + /** + * Creates a plain object from a TargetArtifact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {google.cloud.deploy.v1.TargetArtifact} message TargetArtifact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetArtifact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.skaffoldConfigPath = ""; + object.manifestPath = ""; + } + if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) + object.skaffoldConfigPath = message.skaffoldConfigPath; + if (message.manifestPath != null && message.hasOwnProperty("manifestPath")) + object.manifestPath = message.manifestPath; + if (message.artifactUri != null && message.hasOwnProperty("artifactUri")) { + object.artifactUri = message.artifactUri; + if (options.oneofs) + object.uri = "artifactUri"; + } + return object; + }; + + /** + * Converts this TargetArtifact to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.TargetArtifact + * @instance + * @returns {Object.} JSON object + */ + TargetArtifact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetArtifact + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.TargetArtifact"; + }; + + return TargetArtifact; + })(); + + v1.ListReleasesRequest = (function() { + + /** + * Properties of a ListReleasesRequest. + * @memberof google.cloud.deploy.v1 + * @interface IListReleasesRequest + * @property {string|null} [parent] ListReleasesRequest parent + * @property {number|null} [pageSize] ListReleasesRequest pageSize + * @property {string|null} [pageToken] ListReleasesRequest pageToken + * @property {string|null} [filter] ListReleasesRequest filter + * @property {string|null} [orderBy] ListReleasesRequest orderBy + */ + + /** + * Constructs a new ListReleasesRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListReleasesRequest. + * @implements IListReleasesRequest + * @constructor + * @param {google.cloud.deploy.v1.IListReleasesRequest=} [properties] Properties to set + */ + function ListReleasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReleasesRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + */ + ListReleasesRequest.prototype.parent = ""; + + /** + * ListReleasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + */ + ListReleasesRequest.prototype.pageSize = 0; + + /** + * ListReleasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + */ + ListReleasesRequest.prototype.pageToken = ""; + + /** + * ListReleasesRequest filter. + * @member {string} filter + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + */ + ListReleasesRequest.prototype.filter = ""; + + /** + * ListReleasesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + */ + ListReleasesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListReleasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {google.cloud.deploy.v1.IListReleasesRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListReleasesRequest} ListReleasesRequest instance + */ + ListReleasesRequest.create = function create(properties) { + return new ListReleasesRequest(properties); + }; + + /** + * Encodes the specified ListReleasesRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {google.cloud.deploy.v1.IListReleasesRequest} message ListReleasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReleasesRequest.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 ListReleasesRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {google.cloud.deploy.v1.IListReleasesRequest} message ListReleasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReleasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReleasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListReleasesRequest} ListReleasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReleasesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListReleasesRequest(); + 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 ListReleasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListReleasesRequest} ListReleasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReleasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReleasesRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReleasesRequest.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 ListReleasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListReleasesRequest} ListReleasesRequest + */ + ListReleasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListReleasesRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ListReleasesRequest(); + 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 ListReleasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {google.cloud.deploy.v1.ListReleasesRequest} message ListReleasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReleasesRequest.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 ListReleasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListReleasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReleasesRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReleasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListReleasesRequest"; + }; + + return ListReleasesRequest; + })(); + + v1.ListReleasesResponse = (function() { + + /** + * Properties of a ListReleasesResponse. + * @memberof google.cloud.deploy.v1 + * @interface IListReleasesResponse + * @property {Array.|null} [releases] ListReleasesResponse releases + * @property {string|null} [nextPageToken] ListReleasesResponse nextPageToken + * @property {Array.|null} [unreachable] ListReleasesResponse unreachable + */ + + /** + * Constructs a new ListReleasesResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListReleasesResponse. + * @implements IListReleasesResponse + * @constructor + * @param {google.cloud.deploy.v1.IListReleasesResponse=} [properties] Properties to set + */ + function ListReleasesResponse(properties) { + this.releases = []; + 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]]; + } + + /** + * ListReleasesResponse releases. + * @member {Array.} releases + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @instance + */ + ListReleasesResponse.prototype.releases = $util.emptyArray; + + /** + * ListReleasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @instance + */ + ListReleasesResponse.prototype.nextPageToken = ""; + + /** + * ListReleasesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @instance + */ + ListReleasesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListReleasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {google.cloud.deploy.v1.IListReleasesResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListReleasesResponse} ListReleasesResponse instance + */ + ListReleasesResponse.create = function create(properties) { + return new ListReleasesResponse(properties); + }; + + /** + * Encodes the specified ListReleasesResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {google.cloud.deploy.v1.IListReleasesResponse} message ListReleasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReleasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.releases != null && message.releases.length) + for (var i = 0; i < message.releases.length; ++i) + $root.google.cloud.deploy.v1.Release.encode(message.releases[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 ListReleasesResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {google.cloud.deploy.v1.IListReleasesResponse} message ListReleasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReleasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReleasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListReleasesResponse} ListReleasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReleasesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListReleasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.releases && message.releases.length)) + message.releases = []; + message.releases.push($root.google.cloud.deploy.v1.Release.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 ListReleasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListReleasesResponse} ListReleasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReleasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReleasesResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReleasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.releases != null && message.hasOwnProperty("releases")) { + if (!Array.isArray(message.releases)) + return "releases: array expected"; + for (var i = 0; i < message.releases.length; ++i) { + var error = $root.google.cloud.deploy.v1.Release.verify(message.releases[i]); + if (error) + return "releases." + 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 ListReleasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListReleasesResponse} ListReleasesResponse + */ + ListReleasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListReleasesResponse) + return object; + var message = new $root.google.cloud.deploy.v1.ListReleasesResponse(); + if (object.releases) { + if (!Array.isArray(object.releases)) + throw TypeError(".google.cloud.deploy.v1.ListReleasesResponse.releases: array expected"); + message.releases = []; + for (var i = 0; i < object.releases.length; ++i) { + if (typeof object.releases[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.ListReleasesResponse.releases: object expected"); + message.releases[i] = $root.google.cloud.deploy.v1.Release.fromObject(object.releases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.deploy.v1.ListReleasesResponse.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 ListReleasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {google.cloud.deploy.v1.ListReleasesResponse} message ListReleasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReleasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.releases = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.releases && message.releases.length) { + object.releases = []; + for (var j = 0; j < message.releases.length; ++j) + object.releases[j] = $root.google.cloud.deploy.v1.Release.toObject(message.releases[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 ListReleasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListReleasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReleasesResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReleasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListReleasesResponse"; + }; + + return ListReleasesResponse; + })(); + + v1.GetReleaseRequest = (function() { + + /** + * Properties of a GetReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetReleaseRequest + * @property {string|null} [name] GetReleaseRequest name + */ + + /** + * Constructs a new GetReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetReleaseRequest. + * @implements IGetReleaseRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetReleaseRequest=} [properties] Properties to set + */ + function GetReleaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetReleaseRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @instance + */ + GetReleaseRequest.prototype.name = ""; + + /** + * Creates a new GetReleaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IGetReleaseRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetReleaseRequest} GetReleaseRequest instance + */ + GetReleaseRequest.create = function create(properties) { + return new GetReleaseRequest(properties); + }; + + /** + * Encodes the specified GetReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetReleaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IGetReleaseRequest} message GetReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReleaseRequest.encode = function encode(message, writer) { + 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 GetReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetReleaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IGetReleaseRequest} message GetReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReleaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetReleaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetReleaseRequest} GetReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReleaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetReleaseRequest(); + 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 GetReleaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetReleaseRequest} GetReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReleaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetReleaseRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetReleaseRequest.verify = function verify(message) { + if (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 GetReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetReleaseRequest} GetReleaseRequest + */ + GetReleaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetReleaseRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetReleaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetReleaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {google.cloud.deploy.v1.GetReleaseRequest} message GetReleaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetReleaseRequest.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 GetReleaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @instance + * @returns {Object.} JSON object + */ + GetReleaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetReleaseRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetReleaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetReleaseRequest"; + }; + + return GetReleaseRequest; + })(); + + v1.CreateReleaseRequest = (function() { + + /** + * Properties of a CreateReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @interface ICreateReleaseRequest + * @property {string|null} [parent] CreateReleaseRequest parent + * @property {string|null} [releaseId] CreateReleaseRequest releaseId + * @property {google.cloud.deploy.v1.IRelease|null} [release] CreateReleaseRequest release + * @property {string|null} [requestId] CreateReleaseRequest requestId + * @property {boolean|null} [validateOnly] CreateReleaseRequest validateOnly + */ + + /** + * Constructs a new CreateReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CreateReleaseRequest. + * @implements ICreateReleaseRequest + * @constructor + * @param {google.cloud.deploy.v1.ICreateReleaseRequest=} [properties] Properties to set + */ + function CreateReleaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateReleaseRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + */ + CreateReleaseRequest.prototype.parent = ""; + + /** + * CreateReleaseRequest releaseId. + * @member {string} releaseId + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + */ + CreateReleaseRequest.prototype.releaseId = ""; + + /** + * CreateReleaseRequest release. + * @member {google.cloud.deploy.v1.IRelease|null|undefined} release + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + */ + CreateReleaseRequest.prototype.release = null; + + /** + * CreateReleaseRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + */ + CreateReleaseRequest.prototype.requestId = ""; + + /** + * CreateReleaseRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + */ + CreateReleaseRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateReleaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {google.cloud.deploy.v1.ICreateReleaseRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CreateReleaseRequest} CreateReleaseRequest instance + */ + CreateReleaseRequest.create = function create(properties) { + return new CreateReleaseRequest(properties); + }; + + /** + * Encodes the specified CreateReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateReleaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {google.cloud.deploy.v1.ICreateReleaseRequest} message CreateReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReleaseRequest.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.releaseId != null && Object.hasOwnProperty.call(message, "releaseId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.releaseId); + if (message.release != null && Object.hasOwnProperty.call(message, "release")) + $root.google.cloud.deploy.v1.Release.encode(message.release, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateReleaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {google.cloud.deploy.v1.ICreateReleaseRequest} message CreateReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReleaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateReleaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CreateReleaseRequest} CreateReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReleaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CreateReleaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.releaseId = reader.string(); + break; + } + case 3: { + message.release = $root.google.cloud.deploy.v1.Release.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateReleaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CreateReleaseRequest} CreateReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReleaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateReleaseRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateReleaseRequest.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.releaseId != null && message.hasOwnProperty("releaseId")) + if (!$util.isString(message.releaseId)) + return "releaseId: string expected"; + if (message.release != null && message.hasOwnProperty("release")) { + var error = $root.google.cloud.deploy.v1.Release.verify(message.release); + if (error) + return "release." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CreateReleaseRequest} CreateReleaseRequest + */ + CreateReleaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CreateReleaseRequest) + return object; + var message = new $root.google.cloud.deploy.v1.CreateReleaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.releaseId != null) + message.releaseId = String(object.releaseId); + if (object.release != null) { + if (typeof object.release !== "object") + throw TypeError(".google.cloud.deploy.v1.CreateReleaseRequest.release: object expected"); + message.release = $root.google.cloud.deploy.v1.Release.fromObject(object.release); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateReleaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {google.cloud.deploy.v1.CreateReleaseRequest} message CreateReleaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateReleaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.releaseId = ""; + object.release = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.releaseId != null && message.hasOwnProperty("releaseId")) + object.releaseId = message.releaseId; + if (message.release != null && message.hasOwnProperty("release")) + object.release = $root.google.cloud.deploy.v1.Release.toObject(message.release, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateReleaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateReleaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateReleaseRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateReleaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CreateReleaseRequest"; + }; + + return CreateReleaseRequest; + })(); + + v1.Rollout = (function() { + + /** + * Properties of a Rollout. + * @memberof google.cloud.deploy.v1 + * @interface IRollout + * @property {string|null} [name] Rollout name + * @property {string|null} [uid] Rollout uid + * @property {string|null} [description] Rollout description + * @property {Object.|null} [annotations] Rollout annotations + * @property {Object.|null} [labels] Rollout labels + * @property {google.protobuf.ITimestamp|null} [createTime] Rollout createTime + * @property {google.protobuf.ITimestamp|null} [approveTime] Rollout approveTime + * @property {google.protobuf.ITimestamp|null} [enqueueTime] Rollout enqueueTime + * @property {google.protobuf.ITimestamp|null} [deployStartTime] Rollout deployStartTime + * @property {google.protobuf.ITimestamp|null} [deployEndTime] Rollout deployEndTime + * @property {string|null} [targetId] Rollout targetId + * @property {google.cloud.deploy.v1.Rollout.ApprovalState|null} [approvalState] Rollout approvalState + * @property {google.cloud.deploy.v1.Rollout.State|null} [state] Rollout state + * @property {string|null} [failureReason] Rollout failureReason + * @property {string|null} [deployingBuild] Rollout deployingBuild + * @property {string|null} [etag] Rollout etag + * @property {google.cloud.deploy.v1.Rollout.FailureCause|null} [deployFailureCause] Rollout deployFailureCause + * @property {Array.|null} [phases] Rollout phases + * @property {google.cloud.deploy.v1.IMetadata|null} [metadata] Rollout metadata + */ + + /** + * Constructs a new Rollout. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Rollout. + * @implements IRollout + * @constructor + * @param {google.cloud.deploy.v1.IRollout=} [properties] Properties to set + */ + function Rollout(properties) { + this.annotations = {}; + this.labels = {}; + this.phases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Rollout name. + * @member {string} name + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.name = ""; + + /** + * Rollout uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.uid = ""; + + /** + * Rollout description. + * @member {string} description + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.description = ""; + + /** + * Rollout annotations. + * @member {Object.} annotations + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.annotations = $util.emptyObject; + + /** + * Rollout labels. + * @member {Object.} labels + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.labels = $util.emptyObject; + + /** + * Rollout createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.createTime = null; + + /** + * Rollout approveTime. + * @member {google.protobuf.ITimestamp|null|undefined} approveTime + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.approveTime = null; + + /** + * Rollout enqueueTime. + * @member {google.protobuf.ITimestamp|null|undefined} enqueueTime + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.enqueueTime = null; + + /** + * Rollout deployStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} deployStartTime + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.deployStartTime = null; + + /** + * Rollout deployEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} deployEndTime + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.deployEndTime = null; + + /** + * Rollout targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.targetId = ""; + + /** + * Rollout approvalState. + * @member {google.cloud.deploy.v1.Rollout.ApprovalState} approvalState + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.approvalState = 0; + + /** + * Rollout state. + * @member {google.cloud.deploy.v1.Rollout.State} state + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.state = 0; + + /** + * Rollout failureReason. + * @member {string} failureReason + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.failureReason = ""; + + /** + * Rollout deployingBuild. + * @member {string} deployingBuild + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.deployingBuild = ""; + + /** + * Rollout etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.etag = ""; + + /** + * Rollout deployFailureCause. + * @member {google.cloud.deploy.v1.Rollout.FailureCause} deployFailureCause + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.deployFailureCause = 0; + + /** + * Rollout phases. + * @member {Array.} phases + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.phases = $util.emptyArray; + + /** + * Rollout metadata. + * @member {google.cloud.deploy.v1.IMetadata|null|undefined} metadata + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.metadata = null; + + /** + * Creates a new Rollout instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {google.cloud.deploy.v1.IRollout=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Rollout} Rollout instance + */ + Rollout.create = function create(properties) { + return new Rollout(properties); + }; + + /** + * Encodes the specified Rollout message. Does not implicitly {@link google.cloud.deploy.v1.Rollout.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {google.cloud.deploy.v1.IRollout} message Rollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rollout.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.approveTime != null && Object.hasOwnProperty.call(message, "approveTime")) + $root.google.protobuf.Timestamp.encode(message.approveTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.enqueueTime != null && Object.hasOwnProperty.call(message, "enqueueTime")) + $root.google.protobuf.Timestamp.encode(message.enqueueTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deployStartTime != null && Object.hasOwnProperty.call(message, "deployStartTime")) + $root.google.protobuf.Timestamp.encode(message.deployStartTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.deployEndTime != null && Object.hasOwnProperty.call(message, "deployEndTime")) + $root.google.protobuf.Timestamp.encode(message.deployEndTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.approvalState != null && Object.hasOwnProperty.call(message, "approvalState")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.approvalState); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.state); + if (message.failureReason != null && Object.hasOwnProperty.call(message, "failureReason")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.failureReason); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.etag); + if (message.deployingBuild != null && Object.hasOwnProperty.call(message, "deployingBuild")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.deployingBuild); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.targetId); + if (message.deployFailureCause != null && Object.hasOwnProperty.call(message, "deployFailureCause")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.deployFailureCause); + if (message.phases != null && message.phases.length) + for (var i = 0; i < message.phases.length; ++i) + $root.google.cloud.deploy.v1.Phase.encode(message.phases[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.deploy.v1.Metadata.encode(message.metadata, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Rollout message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Rollout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {google.cloud.deploy.v1.IRollout} message Rollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rollout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Rollout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Rollout} Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rollout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Rollout(), 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.description = reader.string(); + break; + } + case 4: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.approveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.enqueueTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.deployStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.deployEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 18: { + message.targetId = reader.string(); + break; + } + case 12: { + message.approvalState = reader.int32(); + break; + } + case 13: { + message.state = reader.int32(); + break; + } + case 14: { + message.failureReason = reader.string(); + break; + } + case 17: { + message.deployingBuild = reader.string(); + break; + } + case 16: { + message.etag = reader.string(); + break; + } + case 19: { + message.deployFailureCause = reader.int32(); + break; + } + case 23: { + if (!(message.phases && message.phases.length)) + message.phases = []; + message.phases.push($root.google.cloud.deploy.v1.Phase.decode(reader, reader.uint32())); + break; + } + case 24: { + message.metadata = $root.google.cloud.deploy.v1.Metadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Rollout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Rollout} Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rollout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Rollout message. + * @function verify + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Rollout.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.approveTime != null && message.hasOwnProperty("approveTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.approveTime); + if (error) + return "approveTime." + error; + } + if (message.enqueueTime != null && message.hasOwnProperty("enqueueTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.enqueueTime); + if (error) + return "enqueueTime." + error; + } + if (message.deployStartTime != null && message.hasOwnProperty("deployStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deployStartTime); + if (error) + return "deployStartTime." + error; + } + if (message.deployEndTime != null && message.hasOwnProperty("deployEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deployEndTime); + if (error) + return "deployEndTime." + error; + } + if (message.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: string expected"; + if (message.approvalState != null && message.hasOwnProperty("approvalState")) + switch (message.approvalState) { + default: + return "approvalState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.failureReason != null && message.hasOwnProperty("failureReason")) + if (!$util.isString(message.failureReason)) + return "failureReason: string expected"; + if (message.deployingBuild != null && message.hasOwnProperty("deployingBuild")) + if (!$util.isString(message.deployingBuild)) + return "deployingBuild: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deployFailureCause != null && message.hasOwnProperty("deployFailureCause")) + switch (message.deployFailureCause) { + default: + return "deployFailureCause: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.phases != null && message.hasOwnProperty("phases")) { + if (!Array.isArray(message.phases)) + return "phases: array expected"; + for (var i = 0; i < message.phases.length; ++i) { + var error = $root.google.cloud.deploy.v1.Phase.verify(message.phases[i]); + if (error) + return "phases." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.deploy.v1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a Rollout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Rollout} Rollout + */ + Rollout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Rollout) + return object; + var message = new $root.google.cloud.deploy.v1.Rollout(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.description != null) + message.description = String(object.description); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.approveTime != null) { + if (typeof object.approveTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.approveTime: object expected"); + message.approveTime = $root.google.protobuf.Timestamp.fromObject(object.approveTime); + } + if (object.enqueueTime != null) { + if (typeof object.enqueueTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.enqueueTime: object expected"); + message.enqueueTime = $root.google.protobuf.Timestamp.fromObject(object.enqueueTime); + } + if (object.deployStartTime != null) { + if (typeof object.deployStartTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.deployStartTime: object expected"); + message.deployStartTime = $root.google.protobuf.Timestamp.fromObject(object.deployStartTime); + } + if (object.deployEndTime != null) { + if (typeof object.deployEndTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.deployEndTime: object expected"); + message.deployEndTime = $root.google.protobuf.Timestamp.fromObject(object.deployEndTime); + } + if (object.targetId != null) + message.targetId = String(object.targetId); + switch (object.approvalState) { + case "APPROVAL_STATE_UNSPECIFIED": + case 0: + message.approvalState = 0; + break; + case "NEEDS_APPROVAL": + case 1: + message.approvalState = 1; + break; + case "DOES_NOT_NEED_APPROVAL": + case 2: + message.approvalState = 2; + break; + case "APPROVED": + case 3: + message.approvalState = 3; + break; + case "REJECTED": + case 4: + message.approvalState = 4; + break; + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "SUCCEEDED": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "IN_PROGRESS": + case 3: + message.state = 3; + break; + case "PENDING_APPROVAL": + case 4: + message.state = 4; + break; + case "APPROVAL_REJECTED": + case 5: + message.state = 5; + break; + case "PENDING": + case 6: + message.state = 6; + break; + case "PENDING_RELEASE": + case 7: + message.state = 7; + break; + } + if (object.failureReason != null) + message.failureReason = String(object.failureReason); + if (object.deployingBuild != null) + message.deployingBuild = String(object.deployingBuild); + if (object.etag != null) + message.etag = String(object.etag); + switch (object.deployFailureCause) { + case "FAILURE_CAUSE_UNSPECIFIED": + case 0: + message.deployFailureCause = 0; + break; + case "CLOUD_BUILD_UNAVAILABLE": + case 1: + message.deployFailureCause = 1; + break; + case "EXECUTION_FAILED": + case 2: + message.deployFailureCause = 2; + break; + case "DEADLINE_EXCEEDED": + case 3: + message.deployFailureCause = 3; + break; + case "RELEASE_FAILED": + case 4: + message.deployFailureCause = 4; + break; + case "RELEASE_ABANDONED": + case 5: + message.deployFailureCause = 5; + break; + case "VERIFICATION_CONFIG_NOT_FOUND": + case 6: + message.deployFailureCause = 6; + break; + } + if (object.phases) { + if (!Array.isArray(object.phases)) + throw TypeError(".google.cloud.deploy.v1.Rollout.phases: array expected"); + message.phases = []; + for (var i = 0; i < object.phases.length; ++i) { + if (typeof object.phases[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.phases: object expected"); + message.phases[i] = $root.google.cloud.deploy.v1.Phase.fromObject(object.phases[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.metadata: object expected"); + message.metadata = $root.google.cloud.deploy.v1.Metadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a Rollout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {google.cloud.deploy.v1.Rollout} message Rollout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Rollout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phases = []; + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.description = ""; + object.createTime = null; + object.approveTime = null; + object.enqueueTime = null; + object.deployStartTime = null; + object.deployEndTime = null; + object.approvalState = options.enums === String ? "APPROVAL_STATE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.failureReason = ""; + object.etag = ""; + object.deployingBuild = ""; + object.targetId = ""; + object.deployFailureCause = options.enums === String ? "FAILURE_CAUSE_UNSPECIFIED" : 0; + object.metadata = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.approveTime != null && message.hasOwnProperty("approveTime")) + object.approveTime = $root.google.protobuf.Timestamp.toObject(message.approveTime, options); + if (message.enqueueTime != null && message.hasOwnProperty("enqueueTime")) + object.enqueueTime = $root.google.protobuf.Timestamp.toObject(message.enqueueTime, options); + if (message.deployStartTime != null && message.hasOwnProperty("deployStartTime")) + object.deployStartTime = $root.google.protobuf.Timestamp.toObject(message.deployStartTime, options); + if (message.deployEndTime != null && message.hasOwnProperty("deployEndTime")) + object.deployEndTime = $root.google.protobuf.Timestamp.toObject(message.deployEndTime, options); + if (message.approvalState != null && message.hasOwnProperty("approvalState")) + object.approvalState = options.enums === String ? $root.google.cloud.deploy.v1.Rollout.ApprovalState[message.approvalState] : message.approvalState; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.deploy.v1.Rollout.State[message.state] : message.state; + if (message.failureReason != null && message.hasOwnProperty("failureReason")) + object.failureReason = message.failureReason; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deployingBuild != null && message.hasOwnProperty("deployingBuild")) + object.deployingBuild = message.deployingBuild; + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + if (message.deployFailureCause != null && message.hasOwnProperty("deployFailureCause")) + object.deployFailureCause = options.enums === String ? $root.google.cloud.deploy.v1.Rollout.FailureCause[message.deployFailureCause] : message.deployFailureCause; + if (message.phases && message.phases.length) { + object.phases = []; + for (var j = 0; j < message.phases.length; ++j) + object.phases[j] = $root.google.cloud.deploy.v1.Phase.toObject(message.phases[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.deploy.v1.Metadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this Rollout to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Rollout + * @instance + * @returns {Object.} JSON object + */ + Rollout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Rollout + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Rollout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Rollout"; + }; + + /** + * ApprovalState enum. + * @name google.cloud.deploy.v1.Rollout.ApprovalState + * @enum {number} + * @property {number} APPROVAL_STATE_UNSPECIFIED=0 APPROVAL_STATE_UNSPECIFIED value + * @property {number} NEEDS_APPROVAL=1 NEEDS_APPROVAL value + * @property {number} DOES_NOT_NEED_APPROVAL=2 DOES_NOT_NEED_APPROVAL value + * @property {number} APPROVED=3 APPROVED value + * @property {number} REJECTED=4 REJECTED value + */ + Rollout.ApprovalState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "APPROVAL_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEEDS_APPROVAL"] = 1; + values[valuesById[2] = "DOES_NOT_NEED_APPROVAL"] = 2; + values[valuesById[3] = "APPROVED"] = 3; + values[valuesById[4] = "REJECTED"] = 4; + return values; + })(); + + /** + * State enum. + * @name google.cloud.deploy.v1.Rollout.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + * @property {number} PENDING_APPROVAL=4 PENDING_APPROVAL value + * @property {number} APPROVAL_REJECTED=5 APPROVAL_REJECTED value + * @property {number} PENDING=6 PENDING value + * @property {number} PENDING_RELEASE=7 PENDING_RELEASE value + */ + Rollout.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + values[valuesById[4] = "PENDING_APPROVAL"] = 4; + values[valuesById[5] = "APPROVAL_REJECTED"] = 5; + values[valuesById[6] = "PENDING"] = 6; + values[valuesById[7] = "PENDING_RELEASE"] = 7; + return values; + })(); + + /** + * FailureCause enum. + * @name google.cloud.deploy.v1.Rollout.FailureCause + * @enum {number} + * @property {number} FAILURE_CAUSE_UNSPECIFIED=0 FAILURE_CAUSE_UNSPECIFIED value + * @property {number} CLOUD_BUILD_UNAVAILABLE=1 CLOUD_BUILD_UNAVAILABLE value + * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value + * @property {number} DEADLINE_EXCEEDED=3 DEADLINE_EXCEEDED value + * @property {number} RELEASE_FAILED=4 RELEASE_FAILED value + * @property {number} RELEASE_ABANDONED=5 RELEASE_ABANDONED value + * @property {number} VERIFICATION_CONFIG_NOT_FOUND=6 VERIFICATION_CONFIG_NOT_FOUND value + */ + Rollout.FailureCause = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_CAUSE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_BUILD_UNAVAILABLE"] = 1; + values[valuesById[2] = "EXECUTION_FAILED"] = 2; + values[valuesById[3] = "DEADLINE_EXCEEDED"] = 3; + values[valuesById[4] = "RELEASE_FAILED"] = 4; + values[valuesById[5] = "RELEASE_ABANDONED"] = 5; + values[valuesById[6] = "VERIFICATION_CONFIG_NOT_FOUND"] = 6; + return values; + })(); + + return Rollout; + })(); + + v1.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof google.cloud.deploy.v1 + * @interface IMetadata + * @property {google.cloud.deploy.v1.ICloudRunMetadata|null} [cloudRun] Metadata cloudRun + */ + + /** + * Constructs a new Metadata. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {google.cloud.deploy.v1.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metadata cloudRun. + * @member {google.cloud.deploy.v1.ICloudRunMetadata|null|undefined} cloudRun + * @memberof google.cloud.deploy.v1.Metadata + * @instance + */ + Metadata.prototype.cloudRun = null; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {google.cloud.deploy.v1.IMetadata=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.deploy.v1.Metadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {google.cloud.deploy.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudRun != null && Object.hasOwnProperty.call(message, "cloudRun")) + $root.google.cloud.deploy.v1.CloudRunMetadata.encode(message.cloudRun, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {google.cloud.deploy.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudRun != null && message.hasOwnProperty("cloudRun")) { + var error = $root.google.cloud.deploy.v1.CloudRunMetadata.verify(message.cloudRun); + if (error) + return "cloudRun." + error; + } + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Metadata) + return object; + var message = new $root.google.cloud.deploy.v1.Metadata(); + if (object.cloudRun != null) { + if (typeof object.cloudRun !== "object") + throw TypeError(".google.cloud.deploy.v1.Metadata.cloudRun: object expected"); + message.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.fromObject(object.cloudRun); + } + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {google.cloud.deploy.v1.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cloudRun = null; + if (message.cloudRun != null && message.hasOwnProperty("cloudRun")) + object.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.toObject(message.cloudRun, options); + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metadata + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Metadata"; + }; + + return Metadata; + })(); + + v1.DeployJobRunMetadata = (function() { + + /** + * Properties of a DeployJobRunMetadata. + * @memberof google.cloud.deploy.v1 + * @interface IDeployJobRunMetadata + * @property {google.cloud.deploy.v1.ICloudRunMetadata|null} [cloudRun] DeployJobRunMetadata cloudRun + */ + + /** + * Constructs a new DeployJobRunMetadata. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeployJobRunMetadata. + * @implements IDeployJobRunMetadata + * @constructor + * @param {google.cloud.deploy.v1.IDeployJobRunMetadata=} [properties] Properties to set + */ + function DeployJobRunMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployJobRunMetadata cloudRun. + * @member {google.cloud.deploy.v1.ICloudRunMetadata|null|undefined} cloudRun + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @instance + */ + DeployJobRunMetadata.prototype.cloudRun = null; + + /** + * Creates a new DeployJobRunMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {google.cloud.deploy.v1.IDeployJobRunMetadata=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeployJobRunMetadata} DeployJobRunMetadata instance + */ + DeployJobRunMetadata.create = function create(properties) { + return new DeployJobRunMetadata(properties); + }; + + /** + * Encodes the specified DeployJobRunMetadata message. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRunMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {google.cloud.deploy.v1.IDeployJobRunMetadata} message DeployJobRunMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJobRunMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudRun != null && Object.hasOwnProperty.call(message, "cloudRun")) + $root.google.cloud.deploy.v1.CloudRunMetadata.encode(message.cloudRun, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployJobRunMetadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRunMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {google.cloud.deploy.v1.IDeployJobRunMetadata} message DeployJobRunMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJobRunMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployJobRunMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeployJobRunMetadata} DeployJobRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJobRunMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeployJobRunMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployJobRunMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeployJobRunMetadata} DeployJobRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJobRunMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployJobRunMetadata message. + * @function verify + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployJobRunMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudRun != null && message.hasOwnProperty("cloudRun")) { + var error = $root.google.cloud.deploy.v1.CloudRunMetadata.verify(message.cloudRun); + if (error) + return "cloudRun." + error; + } + return null; + }; + + /** + * Creates a DeployJobRunMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeployJobRunMetadata} DeployJobRunMetadata + */ + DeployJobRunMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeployJobRunMetadata) + return object; + var message = new $root.google.cloud.deploy.v1.DeployJobRunMetadata(); + if (object.cloudRun != null) { + if (typeof object.cloudRun !== "object") + throw TypeError(".google.cloud.deploy.v1.DeployJobRunMetadata.cloudRun: object expected"); + message.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.fromObject(object.cloudRun); + } + return message; + }; + + /** + * Creates a plain object from a DeployJobRunMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {google.cloud.deploy.v1.DeployJobRunMetadata} message DeployJobRunMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployJobRunMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cloudRun = null; + if (message.cloudRun != null && message.hasOwnProperty("cloudRun")) + object.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.toObject(message.cloudRun, options); + return object; + }; + + /** + * Converts this DeployJobRunMetadata to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployJobRunMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployJobRunMetadata + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployJobRunMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeployJobRunMetadata"; + }; + + return DeployJobRunMetadata; + })(); + + v1.CloudRunMetadata = (function() { + + /** + * Properties of a CloudRunMetadata. + * @memberof google.cloud.deploy.v1 + * @interface ICloudRunMetadata + * @property {string|null} [service] CloudRunMetadata service + * @property {Array.|null} [serviceUrls] CloudRunMetadata serviceUrls + * @property {string|null} [revision] CloudRunMetadata revision + */ + + /** + * Constructs a new CloudRunMetadata. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CloudRunMetadata. + * @implements ICloudRunMetadata + * @constructor + * @param {google.cloud.deploy.v1.ICloudRunMetadata=} [properties] Properties to set + */ + function CloudRunMetadata(properties) { + this.serviceUrls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudRunMetadata service. + * @member {string} service + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @instance + */ + CloudRunMetadata.prototype.service = ""; + + /** + * CloudRunMetadata serviceUrls. + * @member {Array.} serviceUrls + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @instance + */ + CloudRunMetadata.prototype.serviceUrls = $util.emptyArray; + + /** + * CloudRunMetadata revision. + * @member {string} revision + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @instance + */ + CloudRunMetadata.prototype.revision = ""; + + /** + * Creates a new CloudRunMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {google.cloud.deploy.v1.ICloudRunMetadata=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CloudRunMetadata} CloudRunMetadata instance + */ + CloudRunMetadata.create = function create(properties) { + return new CloudRunMetadata(properties); + }; + + /** + * Encodes the specified CloudRunMetadata message. Does not implicitly {@link google.cloud.deploy.v1.CloudRunMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {google.cloud.deploy.v1.ICloudRunMetadata} message CloudRunMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudRunMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.serviceUrls != null && message.serviceUrls.length) + for (var i = 0; i < message.serviceUrls.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceUrls[i]); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.revision); + return writer; + }; + + /** + * Encodes the specified CloudRunMetadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CloudRunMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {google.cloud.deploy.v1.ICloudRunMetadata} message CloudRunMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudRunMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudRunMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CloudRunMetadata} CloudRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudRunMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CloudRunMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 2: { + if (!(message.serviceUrls && message.serviceUrls.length)) + message.serviceUrls = []; + message.serviceUrls.push(reader.string()); + break; + } + case 3: { + message.revision = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudRunMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CloudRunMetadata} CloudRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudRunMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudRunMetadata message. + * @function verify + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudRunMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.serviceUrls != null && message.hasOwnProperty("serviceUrls")) { + if (!Array.isArray(message.serviceUrls)) + return "serviceUrls: array expected"; + for (var i = 0; i < message.serviceUrls.length; ++i) + if (!$util.isString(message.serviceUrls[i])) + return "serviceUrls: string[] expected"; + } + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isString(message.revision)) + return "revision: string expected"; + return null; + }; + + /** + * Creates a CloudRunMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CloudRunMetadata} CloudRunMetadata + */ + CloudRunMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CloudRunMetadata) + return object; + var message = new $root.google.cloud.deploy.v1.CloudRunMetadata(); + if (object.service != null) + message.service = String(object.service); + if (object.serviceUrls) { + if (!Array.isArray(object.serviceUrls)) + throw TypeError(".google.cloud.deploy.v1.CloudRunMetadata.serviceUrls: array expected"); + message.serviceUrls = []; + for (var i = 0; i < object.serviceUrls.length; ++i) + message.serviceUrls[i] = String(object.serviceUrls[i]); + } + if (object.revision != null) + message.revision = String(object.revision); + return message; + }; + + /** + * Creates a plain object from a CloudRunMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {google.cloud.deploy.v1.CloudRunMetadata} message CloudRunMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudRunMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serviceUrls = []; + if (options.defaults) { + object.service = ""; + object.revision = ""; + } + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.serviceUrls && message.serviceUrls.length) { + object.serviceUrls = []; + for (var j = 0; j < message.serviceUrls.length; ++j) + object.serviceUrls[j] = message.serviceUrls[j]; + } + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + return object; + }; + + /** + * Converts this CloudRunMetadata to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @instance + * @returns {Object.} JSON object + */ + CloudRunMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudRunMetadata + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudRunMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CloudRunMetadata"; + }; + + return CloudRunMetadata; + })(); + + v1.Phase = (function() { + + /** + * Properties of a Phase. + * @memberof google.cloud.deploy.v1 + * @interface IPhase + * @property {string|null} [id] Phase id + * @property {google.cloud.deploy.v1.Phase.State|null} [state] Phase state + * @property {google.cloud.deploy.v1.IDeploymentJobs|null} [deploymentJobs] Phase deploymentJobs + */ + + /** + * Constructs a new Phase. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Phase. + * @implements IPhase + * @constructor + * @param {google.cloud.deploy.v1.IPhase=} [properties] Properties to set + */ + function Phase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Phase id. + * @member {string} id + * @memberof google.cloud.deploy.v1.Phase + * @instance + */ + Phase.prototype.id = ""; + + /** + * Phase state. + * @member {google.cloud.deploy.v1.Phase.State} state + * @memberof google.cloud.deploy.v1.Phase + * @instance + */ + Phase.prototype.state = 0; + + /** + * Phase deploymentJobs. + * @member {google.cloud.deploy.v1.IDeploymentJobs|null|undefined} deploymentJobs + * @memberof google.cloud.deploy.v1.Phase + * @instance + */ + Phase.prototype.deploymentJobs = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Phase jobs. + * @member {"deploymentJobs"|undefined} jobs + * @memberof google.cloud.deploy.v1.Phase + * @instance + */ + Object.defineProperty(Phase.prototype, "jobs", { + get: $util.oneOfGetter($oneOfFields = ["deploymentJobs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Phase instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {google.cloud.deploy.v1.IPhase=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Phase} Phase instance + */ + Phase.create = function create(properties) { + return new Phase(properties); + }; + + /** + * Encodes the specified Phase message. Does not implicitly {@link google.cloud.deploy.v1.Phase.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {google.cloud.deploy.v1.IPhase} message Phase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.deploymentJobs != null && Object.hasOwnProperty.call(message, "deploymentJobs")) + $root.google.cloud.deploy.v1.DeploymentJobs.encode(message.deploymentJobs, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Phase message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Phase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {google.cloud.deploy.v1.IPhase} message Phase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Phase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Phase} Phase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phase.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Phase(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.deploymentJobs = $root.google.cloud.deploy.v1.DeploymentJobs.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Phase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Phase} Phase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Phase message. + * @function verify + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Phase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.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.deploymentJobs != null && message.hasOwnProperty("deploymentJobs")) { + properties.jobs = 1; + { + var error = $root.google.cloud.deploy.v1.DeploymentJobs.verify(message.deploymentJobs); + if (error) + return "deploymentJobs." + error; + } + } + return null; + }; + + /** + * Creates a Phase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Phase} Phase + */ + Phase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Phase) + return object; + var message = new $root.google.cloud.deploy.v1.Phase(); + if (object.id != null) + message.id = String(object.id); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + 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 "ABORTED": + case 5: + message.state = 5; + break; + } + if (object.deploymentJobs != null) { + if (typeof object.deploymentJobs !== "object") + throw TypeError(".google.cloud.deploy.v1.Phase.deploymentJobs: object expected"); + message.deploymentJobs = $root.google.cloud.deploy.v1.DeploymentJobs.fromObject(object.deploymentJobs); + } + return message; + }; + + /** + * Creates a plain object from a Phase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {google.cloud.deploy.v1.Phase} message Phase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Phase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.deploy.v1.Phase.State[message.state] : message.state; + if (message.deploymentJobs != null && message.hasOwnProperty("deploymentJobs")) { + object.deploymentJobs = $root.google.cloud.deploy.v1.DeploymentJobs.toObject(message.deploymentJobs, options); + if (options.oneofs) + object.jobs = "deploymentJobs"; + } + return object; + }; + + /** + * Converts this Phase to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Phase + * @instance + * @returns {Object.} JSON object + */ + Phase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Phase + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Phase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Phase"; + }; + + /** + * State enum. + * @name google.cloud.deploy.v1.Phase.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} IN_PROGRESS=2 IN_PROGRESS value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} ABORTED=5 ABORTED value + */ + Phase.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "IN_PROGRESS"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "ABORTED"] = 5; + return values; + })(); + + return Phase; + })(); + + v1.DeploymentJobs = (function() { + + /** + * Properties of a DeploymentJobs. + * @memberof google.cloud.deploy.v1 + * @interface IDeploymentJobs + * @property {google.cloud.deploy.v1.IJob|null} [deployJob] DeploymentJobs deployJob + * @property {google.cloud.deploy.v1.IJob|null} [verifyJob] DeploymentJobs verifyJob + */ + + /** + * Constructs a new DeploymentJobs. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeploymentJobs. + * @implements IDeploymentJobs + * @constructor + * @param {google.cloud.deploy.v1.IDeploymentJobs=} [properties] Properties to set + */ + function DeploymentJobs(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeploymentJobs deployJob. + * @member {google.cloud.deploy.v1.IJob|null|undefined} deployJob + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @instance + */ + DeploymentJobs.prototype.deployJob = null; + + /** + * DeploymentJobs verifyJob. + * @member {google.cloud.deploy.v1.IJob|null|undefined} verifyJob + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @instance + */ + DeploymentJobs.prototype.verifyJob = null; + + /** + * Creates a new DeploymentJobs instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {google.cloud.deploy.v1.IDeploymentJobs=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeploymentJobs} DeploymentJobs instance + */ + DeploymentJobs.create = function create(properties) { + return new DeploymentJobs(properties); + }; + + /** + * Encodes the specified DeploymentJobs message. Does not implicitly {@link google.cloud.deploy.v1.DeploymentJobs.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {google.cloud.deploy.v1.IDeploymentJobs} message DeploymentJobs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeploymentJobs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployJob != null && Object.hasOwnProperty.call(message, "deployJob")) + $root.google.cloud.deploy.v1.Job.encode(message.deployJob, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.verifyJob != null && Object.hasOwnProperty.call(message, "verifyJob")) + $root.google.cloud.deploy.v1.Job.encode(message.verifyJob, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeploymentJobs message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeploymentJobs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {google.cloud.deploy.v1.IDeploymentJobs} message DeploymentJobs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeploymentJobs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeploymentJobs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeploymentJobs} DeploymentJobs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeploymentJobs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeploymentJobs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deployJob = $root.google.cloud.deploy.v1.Job.decode(reader, reader.uint32()); + break; + } + case 2: { + message.verifyJob = $root.google.cloud.deploy.v1.Job.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeploymentJobs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeploymentJobs} DeploymentJobs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeploymentJobs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeploymentJobs message. + * @function verify + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeploymentJobs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployJob != null && message.hasOwnProperty("deployJob")) { + var error = $root.google.cloud.deploy.v1.Job.verify(message.deployJob); + if (error) + return "deployJob." + error; + } + if (message.verifyJob != null && message.hasOwnProperty("verifyJob")) { + var error = $root.google.cloud.deploy.v1.Job.verify(message.verifyJob); + if (error) + return "verifyJob." + error; + } + return null; + }; + + /** + * Creates a DeploymentJobs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeploymentJobs} DeploymentJobs + */ + DeploymentJobs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeploymentJobs) + return object; + var message = new $root.google.cloud.deploy.v1.DeploymentJobs(); + if (object.deployJob != null) { + if (typeof object.deployJob !== "object") + throw TypeError(".google.cloud.deploy.v1.DeploymentJobs.deployJob: object expected"); + message.deployJob = $root.google.cloud.deploy.v1.Job.fromObject(object.deployJob); + } + if (object.verifyJob != null) { + if (typeof object.verifyJob !== "object") + throw TypeError(".google.cloud.deploy.v1.DeploymentJobs.verifyJob: object expected"); + message.verifyJob = $root.google.cloud.deploy.v1.Job.fromObject(object.verifyJob); + } + return message; + }; + + /** + * Creates a plain object from a DeploymentJobs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {google.cloud.deploy.v1.DeploymentJobs} message DeploymentJobs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeploymentJobs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deployJob = null; + object.verifyJob = null; + } + if (message.deployJob != null && message.hasOwnProperty("deployJob")) + object.deployJob = $root.google.cloud.deploy.v1.Job.toObject(message.deployJob, options); + if (message.verifyJob != null && message.hasOwnProperty("verifyJob")) + object.verifyJob = $root.google.cloud.deploy.v1.Job.toObject(message.verifyJob, options); + return object; + }; + + /** + * Converts this DeploymentJobs to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @instance + * @returns {Object.} JSON object + */ + DeploymentJobs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeploymentJobs + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeploymentJobs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeploymentJobs"; + }; + + return DeploymentJobs; + })(); + + v1.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.deploy.v1 + * @interface IJob + * @property {string|null} [id] Job id + * @property {google.cloud.deploy.v1.Job.State|null} [state] Job state + * @property {string|null} [jobRun] Job jobRun + * @property {google.cloud.deploy.v1.IDeployJob|null} [deployJob] Job deployJob + * @property {google.cloud.deploy.v1.IVerifyJob|null} [verifyJob] Job verifyJob + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.deploy.v1.IJob=} [properties] Properties to set + */ + function Job(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Job id. + * @member {string} id + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Job.prototype.id = ""; + + /** + * Job state. + * @member {google.cloud.deploy.v1.Job.State} state + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Job.prototype.state = 0; + + /** + * Job jobRun. + * @member {string} jobRun + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Job.prototype.jobRun = ""; + + /** + * Job deployJob. + * @member {google.cloud.deploy.v1.IDeployJob|null|undefined} deployJob + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Job.prototype.deployJob = null; + + /** + * Job verifyJob. + * @member {google.cloud.deploy.v1.IVerifyJob|null|undefined} verifyJob + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Job.prototype.verifyJob = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Job jobType. + * @member {"deployJob"|"verifyJob"|undefined} jobType + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Object.defineProperty(Job.prototype, "jobType", { + get: $util.oneOfGetter($oneOfFields = ["deployJob", "verifyJob"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {google.cloud.deploy.v1.IJob=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.deploy.v1.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {google.cloud.deploy.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.jobRun != null && Object.hasOwnProperty.call(message, "jobRun")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobRun); + if (message.deployJob != null && Object.hasOwnProperty.call(message, "deployJob")) + $root.google.cloud.deploy.v1.DeployJob.encode(message.deployJob, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.verifyJob != null && Object.hasOwnProperty.call(message, "verifyJob")) + $root.google.cloud.deploy.v1.VerifyJob.encode(message.verifyJob, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {google.cloud.deploy.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Job(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.jobRun = reader.string(); + break; + } + case 4: { + message.deployJob = $root.google.cloud.deploy.v1.DeployJob.decode(reader, reader.uint32()); + break; + } + case 5: { + message.verifyJob = $root.google.cloud.deploy.v1.VerifyJob.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.jobRun != null && message.hasOwnProperty("jobRun")) + if (!$util.isString(message.jobRun)) + return "jobRun: string expected"; + if (message.deployJob != null && message.hasOwnProperty("deployJob")) { + properties.jobType = 1; + { + var error = $root.google.cloud.deploy.v1.DeployJob.verify(message.deployJob); + if (error) + return "deployJob." + error; + } + } + if (message.verifyJob != null && message.hasOwnProperty("verifyJob")) { + if (properties.jobType === 1) + return "jobType: multiple values"; + properties.jobType = 1; + { + var error = $root.google.cloud.deploy.v1.VerifyJob.verify(message.verifyJob); + if (error) + return "verifyJob." + error; + } + } + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Job) + return object; + var message = new $root.google.cloud.deploy.v1.Job(); + if (object.id != null) + message.id = String(object.id); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "DISABLED": + case 2: + message.state = 2; + break; + case "IN_PROGRESS": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "ABORTED": + case 6: + message.state = 6; + break; + } + if (object.jobRun != null) + message.jobRun = String(object.jobRun); + if (object.deployJob != null) { + if (typeof object.deployJob !== "object") + throw TypeError(".google.cloud.deploy.v1.Job.deployJob: object expected"); + message.deployJob = $root.google.cloud.deploy.v1.DeployJob.fromObject(object.deployJob); + } + if (object.verifyJob != null) { + if (typeof object.verifyJob !== "object") + throw TypeError(".google.cloud.deploy.v1.Job.verifyJob: object expected"); + message.verifyJob = $root.google.cloud.deploy.v1.VerifyJob.fromObject(object.verifyJob); + } + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {google.cloud.deploy.v1.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.jobRun = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.deploy.v1.Job.State[message.state] : message.state; + if (message.jobRun != null && message.hasOwnProperty("jobRun")) + object.jobRun = message.jobRun; + if (message.deployJob != null && message.hasOwnProperty("deployJob")) { + object.deployJob = $root.google.cloud.deploy.v1.DeployJob.toObject(message.deployJob, options); + if (options.oneofs) + object.jobType = "deployJob"; + } + if (message.verifyJob != null && message.hasOwnProperty("verifyJob")) { + object.verifyJob = $root.google.cloud.deploy.v1.VerifyJob.toObject(message.verifyJob, options); + if (options.oneofs) + object.jobType = "verifyJob"; + } + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Job"; + }; + + /** + * State enum. + * @name google.cloud.deploy.v1.Job.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} DISABLED=2 DISABLED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} FAILED=5 FAILED value + * @property {number} ABORTED=6 ABORTED value + */ + Job.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "ABORTED"] = 6; + return values; + })(); + + return Job; + })(); + + v1.DeployJob = (function() { + + /** + * Properties of a DeployJob. + * @memberof google.cloud.deploy.v1 + * @interface IDeployJob + */ + + /** + * Constructs a new DeployJob. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeployJob. + * @implements IDeployJob + * @constructor + * @param {google.cloud.deploy.v1.IDeployJob=} [properties] Properties to set + */ + function DeployJob(properties) { + if (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 DeployJob instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {google.cloud.deploy.v1.IDeployJob=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeployJob} DeployJob instance + */ + DeployJob.create = function create(properties) { + return new DeployJob(properties); + }; + + /** + * Encodes the specified DeployJob message. Does not implicitly {@link google.cloud.deploy.v1.DeployJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {google.cloud.deploy.v1.IDeployJob} message DeployJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeployJob message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {google.cloud.deploy.v1.IDeployJob} message DeployJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeployJob} DeployJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeployJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeployJob} DeployJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployJob message. + * @function verify + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeployJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeployJob} DeployJob + */ + DeployJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeployJob) + return object; + return new $root.google.cloud.deploy.v1.DeployJob(); + }; + + /** + * Creates a plain object from a DeployJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {google.cloud.deploy.v1.DeployJob} message DeployJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployJob.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeployJob to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeployJob + * @instance + * @returns {Object.} JSON object + */ + DeployJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployJob + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeployJob"; + }; + + return DeployJob; + })(); + + v1.VerifyJob = (function() { + + /** + * Properties of a VerifyJob. + * @memberof google.cloud.deploy.v1 + * @interface IVerifyJob + */ + + /** + * Constructs a new VerifyJob. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a VerifyJob. + * @implements IVerifyJob + * @constructor + * @param {google.cloud.deploy.v1.IVerifyJob=} [properties] Properties to set + */ + function VerifyJob(properties) { + if (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 VerifyJob instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {google.cloud.deploy.v1.IVerifyJob=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.VerifyJob} VerifyJob instance + */ + VerifyJob.create = function create(properties) { + return new VerifyJob(properties); + }; + + /** + * Encodes the specified VerifyJob message. Does not implicitly {@link google.cloud.deploy.v1.VerifyJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {google.cloud.deploy.v1.IVerifyJob} message VerifyJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifyJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VerifyJob message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.VerifyJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {google.cloud.deploy.v1.IVerifyJob} message VerifyJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifyJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VerifyJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.VerifyJob} VerifyJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifyJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.VerifyJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VerifyJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.VerifyJob} VerifyJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifyJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VerifyJob message. + * @function verify + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VerifyJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VerifyJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.VerifyJob} VerifyJob + */ + VerifyJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.VerifyJob) + return object; + return new $root.google.cloud.deploy.v1.VerifyJob(); + }; + + /** + * Creates a plain object from a VerifyJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {google.cloud.deploy.v1.VerifyJob} message VerifyJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VerifyJob.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VerifyJob to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.VerifyJob + * @instance + * @returns {Object.} JSON object + */ + VerifyJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VerifyJob + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VerifyJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.VerifyJob"; + }; + + return VerifyJob; + })(); + + v1.ListRolloutsRequest = (function() { + + /** + * Properties of a ListRolloutsRequest. + * @memberof google.cloud.deploy.v1 + * @interface IListRolloutsRequest + * @property {string|null} [parent] ListRolloutsRequest parent + * @property {number|null} [pageSize] ListRolloutsRequest pageSize + * @property {string|null} [pageToken] ListRolloutsRequest pageToken + * @property {string|null} [filter] ListRolloutsRequest filter + * @property {string|null} [orderBy] ListRolloutsRequest orderBy + */ + + /** + * Constructs a new ListRolloutsRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListRolloutsRequest. + * @implements IListRolloutsRequest + * @constructor + * @param {google.cloud.deploy.v1.IListRolloutsRequest=} [properties] Properties to set + */ + function ListRolloutsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRolloutsRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + */ + ListRolloutsRequest.prototype.parent = ""; + + /** + * ListRolloutsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + */ + ListRolloutsRequest.prototype.pageSize = 0; + + /** + * ListRolloutsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + */ + ListRolloutsRequest.prototype.pageToken = ""; + + /** + * ListRolloutsRequest filter. + * @member {string} filter + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + */ + ListRolloutsRequest.prototype.filter = ""; + + /** + * ListRolloutsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + */ + ListRolloutsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListRolloutsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {google.cloud.deploy.v1.IListRolloutsRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListRolloutsRequest} ListRolloutsRequest instance + */ + ListRolloutsRequest.create = function create(properties) { + return new ListRolloutsRequest(properties); + }; + + /** + * Encodes the specified ListRolloutsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {google.cloud.deploy.v1.IListRolloutsRequest} message ListRolloutsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRolloutsRequest.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 ListRolloutsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {google.cloud.deploy.v1.IListRolloutsRequest} message ListRolloutsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRolloutsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRolloutsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListRolloutsRequest} ListRolloutsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRolloutsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListRolloutsRequest(); + 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 ListRolloutsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListRolloutsRequest} ListRolloutsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRolloutsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRolloutsRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRolloutsRequest.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 ListRolloutsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListRolloutsRequest} ListRolloutsRequest + */ + ListRolloutsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListRolloutsRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ListRolloutsRequest(); + 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 ListRolloutsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {google.cloud.deploy.v1.ListRolloutsRequest} message ListRolloutsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRolloutsRequest.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 ListRolloutsRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRolloutsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRolloutsRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRolloutsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListRolloutsRequest"; + }; + + return ListRolloutsRequest; + })(); + + v1.ListRolloutsResponse = (function() { + + /** + * Properties of a ListRolloutsResponse. + * @memberof google.cloud.deploy.v1 + * @interface IListRolloutsResponse + * @property {Array.|null} [rollouts] ListRolloutsResponse rollouts + * @property {string|null} [nextPageToken] ListRolloutsResponse nextPageToken + * @property {Array.|null} [unreachable] ListRolloutsResponse unreachable + */ + + /** + * Constructs a new ListRolloutsResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListRolloutsResponse. + * @implements IListRolloutsResponse + * @constructor + * @param {google.cloud.deploy.v1.IListRolloutsResponse=} [properties] Properties to set + */ + function ListRolloutsResponse(properties) { + this.rollouts = []; + 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]]; + } + + /** + * ListRolloutsResponse rollouts. + * @member {Array.} rollouts + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @instance + */ + ListRolloutsResponse.prototype.rollouts = $util.emptyArray; + + /** + * ListRolloutsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @instance + */ + ListRolloutsResponse.prototype.nextPageToken = ""; + + /** + * ListRolloutsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @instance + */ + ListRolloutsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListRolloutsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {google.cloud.deploy.v1.IListRolloutsResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListRolloutsResponse} ListRolloutsResponse instance + */ + ListRolloutsResponse.create = function create(properties) { + return new ListRolloutsResponse(properties); + }; + + /** + * Encodes the specified ListRolloutsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {google.cloud.deploy.v1.IListRolloutsResponse} message ListRolloutsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRolloutsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rollouts != null && message.rollouts.length) + for (var i = 0; i < message.rollouts.length; ++i) + $root.google.cloud.deploy.v1.Rollout.encode(message.rollouts[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 ListRolloutsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {google.cloud.deploy.v1.IListRolloutsResponse} message ListRolloutsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRolloutsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRolloutsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListRolloutsResponse} ListRolloutsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRolloutsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListRolloutsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rollouts && message.rollouts.length)) + message.rollouts = []; + message.rollouts.push($root.google.cloud.deploy.v1.Rollout.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 ListRolloutsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListRolloutsResponse} ListRolloutsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRolloutsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRolloutsResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRolloutsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rollouts != null && message.hasOwnProperty("rollouts")) { + if (!Array.isArray(message.rollouts)) + return "rollouts: array expected"; + for (var i = 0; i < message.rollouts.length; ++i) { + var error = $root.google.cloud.deploy.v1.Rollout.verify(message.rollouts[i]); + if (error) + return "rollouts." + 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 ListRolloutsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListRolloutsResponse} ListRolloutsResponse + */ + ListRolloutsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListRolloutsResponse) + return object; + var message = new $root.google.cloud.deploy.v1.ListRolloutsResponse(); + if (object.rollouts) { + if (!Array.isArray(object.rollouts)) + throw TypeError(".google.cloud.deploy.v1.ListRolloutsResponse.rollouts: array expected"); + message.rollouts = []; + for (var i = 0; i < object.rollouts.length; ++i) { + if (typeof object.rollouts[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.ListRolloutsResponse.rollouts: object expected"); + message.rollouts[i] = $root.google.cloud.deploy.v1.Rollout.fromObject(object.rollouts[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.deploy.v1.ListRolloutsResponse.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 ListRolloutsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {google.cloud.deploy.v1.ListRolloutsResponse} message ListRolloutsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRolloutsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.rollouts = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.rollouts && message.rollouts.length) { + object.rollouts = []; + for (var j = 0; j < message.rollouts.length; ++j) + object.rollouts[j] = $root.google.cloud.deploy.v1.Rollout.toObject(message.rollouts[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 ListRolloutsResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRolloutsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRolloutsResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRolloutsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListRolloutsResponse"; + }; + + return ListRolloutsResponse; + })(); + + v1.GetRolloutRequest = (function() { + + /** + * Properties of a GetRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetRolloutRequest + * @property {string|null} [name] GetRolloutRequest name + */ + + /** + * Constructs a new GetRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetRolloutRequest. + * @implements IGetRolloutRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetRolloutRequest=} [properties] Properties to set + */ + function GetRolloutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRolloutRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @instance + */ + GetRolloutRequest.prototype.name = ""; + + /** + * Creates a new GetRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IGetRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetRolloutRequest} GetRolloutRequest instance + */ + GetRolloutRequest.create = function create(properties) { + return new GetRolloutRequest(properties); + }; + + /** + * Encodes the specified GetRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IGetRolloutRequest} message GetRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRolloutRequest.encode = function encode(message, writer) { + 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 GetRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IGetRolloutRequest} message GetRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetRolloutRequest} GetRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetRolloutRequest(); + 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 GetRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetRolloutRequest} GetRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRolloutRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRolloutRequest.verify = function verify(message) { + if (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 GetRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetRolloutRequest} GetRolloutRequest + */ + GetRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetRolloutRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetRolloutRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {google.cloud.deploy.v1.GetRolloutRequest} message GetRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRolloutRequest.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 GetRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + GetRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetRolloutRequest"; + }; + + return GetRolloutRequest; + })(); + + v1.CreateRolloutRequest = (function() { + + /** + * Properties of a CreateRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @interface ICreateRolloutRequest + * @property {string|null} [parent] CreateRolloutRequest parent + * @property {string|null} [rolloutId] CreateRolloutRequest rolloutId + * @property {google.cloud.deploy.v1.IRollout|null} [rollout] CreateRolloutRequest rollout + * @property {string|null} [requestId] CreateRolloutRequest requestId + * @property {boolean|null} [validateOnly] CreateRolloutRequest validateOnly + */ + + /** + * Constructs a new CreateRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CreateRolloutRequest. + * @implements ICreateRolloutRequest + * @constructor + * @param {google.cloud.deploy.v1.ICreateRolloutRequest=} [properties] Properties to set + */ + function CreateRolloutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateRolloutRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + */ + CreateRolloutRequest.prototype.parent = ""; + + /** + * CreateRolloutRequest rolloutId. + * @member {string} rolloutId + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + */ + CreateRolloutRequest.prototype.rolloutId = ""; + + /** + * CreateRolloutRequest rollout. + * @member {google.cloud.deploy.v1.IRollout|null|undefined} rollout + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + */ + CreateRolloutRequest.prototype.rollout = null; + + /** + * CreateRolloutRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + */ + CreateRolloutRequest.prototype.requestId = ""; + + /** + * CreateRolloutRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + */ + CreateRolloutRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {google.cloud.deploy.v1.ICreateRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CreateRolloutRequest} CreateRolloutRequest instance + */ + CreateRolloutRequest.create = function create(properties) { + return new CreateRolloutRequest(properties); + }; + + /** + * Encodes the specified CreateRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {google.cloud.deploy.v1.ICreateRolloutRequest} message CreateRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRolloutRequest.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.rolloutId != null && Object.hasOwnProperty.call(message, "rolloutId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rolloutId); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.cloud.deploy.v1.Rollout.encode(message.rollout, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {google.cloud.deploy.v1.ICreateRolloutRequest} message CreateRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CreateRolloutRequest} CreateRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CreateRolloutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.rolloutId = reader.string(); + break; + } + case 3: { + message.rollout = $root.google.cloud.deploy.v1.Rollout.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CreateRolloutRequest} CreateRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRolloutRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRolloutRequest.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.rolloutId != null && message.hasOwnProperty("rolloutId")) + if (!$util.isString(message.rolloutId)) + return "rolloutId: string expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.cloud.deploy.v1.Rollout.verify(message.rollout); + if (error) + return "rollout." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CreateRolloutRequest} CreateRolloutRequest + */ + CreateRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CreateRolloutRequest) + return object; + var message = new $root.google.cloud.deploy.v1.CreateRolloutRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.rolloutId != null) + message.rolloutId = String(object.rolloutId); + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.cloud.deploy.v1.CreateRolloutRequest.rollout: object expected"); + message.rollout = $root.google.cloud.deploy.v1.Rollout.fromObject(object.rollout); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {google.cloud.deploy.v1.CreateRolloutRequest} message CreateRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRolloutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.rolloutId = ""; + object.rollout = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.rolloutId != null && message.hasOwnProperty("rolloutId")) + object.rolloutId = message.rolloutId; + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.cloud.deploy.v1.Rollout.toObject(message.rollout, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CreateRolloutRequest"; + }; + + return CreateRolloutRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.deploy.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.deploy.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.deploy.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.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {google.cloud.deploy.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.deploy.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {google.cloud.deploy.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.deploy.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {google.cloud.deploy.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.deploy.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.deploy.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.deploy.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.deploy.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.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.deploy.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.deploy.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.deploy.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.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.deploy.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.deploy.v1.OperationMetadata + * @static + * @param {google.cloud.deploy.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.deploy.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.deploy.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.deploy.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.ApproveRolloutRequest = (function() { + + /** + * Properties of an ApproveRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @interface IApproveRolloutRequest + * @property {string|null} [name] ApproveRolloutRequest name + * @property {boolean|null} [approved] ApproveRolloutRequest approved + */ + + /** + * Constructs a new ApproveRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an ApproveRolloutRequest. + * @implements IApproveRolloutRequest + * @constructor + * @param {google.cloud.deploy.v1.IApproveRolloutRequest=} [properties] Properties to set + */ + function ApproveRolloutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApproveRolloutRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @instance + */ + ApproveRolloutRequest.prototype.name = ""; + + /** + * ApproveRolloutRequest approved. + * @member {boolean} approved + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @instance + */ + ApproveRolloutRequest.prototype.approved = false; + + /** + * Creates a new ApproveRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ApproveRolloutRequest} ApproveRolloutRequest instance + */ + ApproveRolloutRequest.create = function create(properties) { + return new ApproveRolloutRequest(properties); + }; + + /** + * Encodes the specified ApproveRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutRequest} message ApproveRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApproveRolloutRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.approved != null && Object.hasOwnProperty.call(message, "approved")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.approved); + return writer; + }; + + /** + * Encodes the specified ApproveRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutRequest} message ApproveRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApproveRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApproveRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ApproveRolloutRequest} ApproveRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApproveRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ApproveRolloutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.approved = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApproveRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ApproveRolloutRequest} ApproveRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApproveRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApproveRolloutRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApproveRolloutRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.approved != null && message.hasOwnProperty("approved")) + if (typeof message.approved !== "boolean") + return "approved: boolean expected"; + return null; + }; + + /** + * Creates an ApproveRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ApproveRolloutRequest} ApproveRolloutRequest + */ + ApproveRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ApproveRolloutRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ApproveRolloutRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.approved != null) + message.approved = Boolean(object.approved); + return message; + }; + + /** + * Creates a plain object from an ApproveRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {google.cloud.deploy.v1.ApproveRolloutRequest} message ApproveRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApproveRolloutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.approved = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.approved != null && message.hasOwnProperty("approved")) + object.approved = message.approved; + return object; + }; + + /** + * Converts this ApproveRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + ApproveRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApproveRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApproveRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ApproveRolloutRequest"; + }; + + return ApproveRolloutRequest; + })(); + + v1.ApproveRolloutResponse = (function() { + + /** + * Properties of an ApproveRolloutResponse. + * @memberof google.cloud.deploy.v1 + * @interface IApproveRolloutResponse + */ + + /** + * Constructs a new ApproveRolloutResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an ApproveRolloutResponse. + * @implements IApproveRolloutResponse + * @constructor + * @param {google.cloud.deploy.v1.IApproveRolloutResponse=} [properties] Properties to set + */ + function ApproveRolloutResponse(properties) { + if (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 ApproveRolloutResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ApproveRolloutResponse} ApproveRolloutResponse instance + */ + ApproveRolloutResponse.create = function create(properties) { + return new ApproveRolloutResponse(properties); + }; + + /** + * Encodes the specified ApproveRolloutResponse message. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutResponse} message ApproveRolloutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApproveRolloutResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ApproveRolloutResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutResponse} message ApproveRolloutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApproveRolloutResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApproveRolloutResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ApproveRolloutResponse} ApproveRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApproveRolloutResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ApproveRolloutResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApproveRolloutResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ApproveRolloutResponse} ApproveRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApproveRolloutResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApproveRolloutResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApproveRolloutResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ApproveRolloutResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ApproveRolloutResponse} ApproveRolloutResponse + */ + ApproveRolloutResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ApproveRolloutResponse) + return object; + return new $root.google.cloud.deploy.v1.ApproveRolloutResponse(); + }; + + /** + * Creates a plain object from an ApproveRolloutResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {google.cloud.deploy.v1.ApproveRolloutResponse} message ApproveRolloutResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApproveRolloutResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ApproveRolloutResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @instance + * @returns {Object.} JSON object + */ + ApproveRolloutResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApproveRolloutResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApproveRolloutResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ApproveRolloutResponse"; + }; + + return ApproveRolloutResponse; + })(); + + v1.RetryJobRequest = (function() { + + /** + * Properties of a RetryJobRequest. + * @memberof google.cloud.deploy.v1 + * @interface IRetryJobRequest + * @property {string|null} [rollout] RetryJobRequest rollout + * @property {string|null} [phaseId] RetryJobRequest phaseId + * @property {string|null} [jobId] RetryJobRequest jobId + */ + + /** + * Constructs a new RetryJobRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a RetryJobRequest. + * @implements IRetryJobRequest + * @constructor + * @param {google.cloud.deploy.v1.IRetryJobRequest=} [properties] Properties to set + */ + function RetryJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetryJobRequest rollout. + * @member {string} rollout + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @instance + */ + RetryJobRequest.prototype.rollout = ""; + + /** + * RetryJobRequest phaseId. + * @member {string} phaseId + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @instance + */ + RetryJobRequest.prototype.phaseId = ""; + + /** + * RetryJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @instance + */ + RetryJobRequest.prototype.jobId = ""; + + /** + * Creates a new RetryJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {google.cloud.deploy.v1.IRetryJobRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.RetryJobRequest} RetryJobRequest instance + */ + RetryJobRequest.create = function create(properties) { + return new RetryJobRequest(properties); + }; + + /** + * Encodes the specified RetryJobRequest message. Does not implicitly {@link google.cloud.deploy.v1.RetryJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {google.cloud.deploy.v1.IRetryJobRequest} message RetryJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rollout); + if (message.phaseId != null && Object.hasOwnProperty.call(message, "phaseId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phaseId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); + return writer; + }; + + /** + * Encodes the specified RetryJobRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RetryJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {google.cloud.deploy.v1.IRetryJobRequest} message RetryJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetryJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.RetryJobRequest} RetryJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.RetryJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rollout = reader.string(); + break; + } + case 2: { + message.phaseId = reader.string(); + break; + } + case 3: { + message.jobId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetryJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.RetryJobRequest} RetryJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetryJobRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetryJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) + if (!$util.isString(message.rollout)) + return "rollout: string expected"; + if (message.phaseId != null && message.hasOwnProperty("phaseId")) + if (!$util.isString(message.phaseId)) + return "phaseId: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + return null; + }; + + /** + * Creates a RetryJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.RetryJobRequest} RetryJobRequest + */ + RetryJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.RetryJobRequest) + return object; + var message = new $root.google.cloud.deploy.v1.RetryJobRequest(); + if (object.rollout != null) + message.rollout = String(object.rollout); + if (object.phaseId != null) + message.phaseId = String(object.phaseId); + if (object.jobId != null) + message.jobId = String(object.jobId); + return message; + }; + + /** + * Creates a plain object from a RetryJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {google.cloud.deploy.v1.RetryJobRequest} message RetryJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetryJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rollout = ""; + object.phaseId = ""; + object.jobId = ""; + } + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = message.rollout; + if (message.phaseId != null && message.hasOwnProperty("phaseId")) + object.phaseId = message.phaseId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + return object; + }; + + /** + * Converts this RetryJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @instance + * @returns {Object.} JSON object + */ + RetryJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetryJobRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetryJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.RetryJobRequest"; + }; + + return RetryJobRequest; + })(); + + v1.RetryJobResponse = (function() { + + /** + * Properties of a RetryJobResponse. + * @memberof google.cloud.deploy.v1 + * @interface IRetryJobResponse + */ + + /** + * Constructs a new RetryJobResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a RetryJobResponse. + * @implements IRetryJobResponse + * @constructor + * @param {google.cloud.deploy.v1.IRetryJobResponse=} [properties] Properties to set + */ + function RetryJobResponse(properties) { + if (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 RetryJobResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {google.cloud.deploy.v1.IRetryJobResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.RetryJobResponse} RetryJobResponse instance + */ + RetryJobResponse.create = function create(properties) { + return new RetryJobResponse(properties); + }; + + /** + * Encodes the specified RetryJobResponse message. Does not implicitly {@link google.cloud.deploy.v1.RetryJobResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {google.cloud.deploy.v1.IRetryJobResponse} message RetryJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryJobResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RetryJobResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RetryJobResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {google.cloud.deploy.v1.IRetryJobResponse} message RetryJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryJobResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetryJobResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.RetryJobResponse} RetryJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryJobResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.RetryJobResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetryJobResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.RetryJobResponse} RetryJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryJobResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetryJobResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetryJobResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RetryJobResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.RetryJobResponse} RetryJobResponse + */ + RetryJobResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.RetryJobResponse) + return object; + return new $root.google.cloud.deploy.v1.RetryJobResponse(); + }; + + /** + * Creates a plain object from a RetryJobResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {google.cloud.deploy.v1.RetryJobResponse} message RetryJobResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetryJobResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RetryJobResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @instance + * @returns {Object.} JSON object + */ + RetryJobResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetryJobResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetryJobResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.RetryJobResponse"; + }; + + return RetryJobResponse; + })(); + + v1.AbandonReleaseRequest = (function() { + + /** + * Properties of an AbandonReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @interface IAbandonReleaseRequest + * @property {string|null} [name] AbandonReleaseRequest name + */ + + /** + * Constructs a new AbandonReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an AbandonReleaseRequest. + * @implements IAbandonReleaseRequest + * @constructor + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest=} [properties] Properties to set + */ + function AbandonReleaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AbandonReleaseRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @instance + */ + AbandonReleaseRequest.prototype.name = ""; + + /** + * Creates a new AbandonReleaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.AbandonReleaseRequest} AbandonReleaseRequest instance + */ + AbandonReleaseRequest.create = function create(properties) { + return new AbandonReleaseRequest(properties); + }; + + /** + * Encodes the specified AbandonReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest} message AbandonReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonReleaseRequest.encode = function encode(message, writer) { + 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 AbandonReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest} message AbandonReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonReleaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AbandonReleaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.AbandonReleaseRequest} AbandonReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonReleaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.AbandonReleaseRequest(); + 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 an AbandonReleaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.AbandonReleaseRequest} AbandonReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonReleaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AbandonReleaseRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AbandonReleaseRequest.verify = function verify(message) { + if (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 an AbandonReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.AbandonReleaseRequest} AbandonReleaseRequest + */ + AbandonReleaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.AbandonReleaseRequest) + return object; + var message = new $root.google.cloud.deploy.v1.AbandonReleaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an AbandonReleaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {google.cloud.deploy.v1.AbandonReleaseRequest} message AbandonReleaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AbandonReleaseRequest.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 AbandonReleaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @instance + * @returns {Object.} JSON object + */ + AbandonReleaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AbandonReleaseRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AbandonReleaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.AbandonReleaseRequest"; + }; + + return AbandonReleaseRequest; + })(); + + v1.AbandonReleaseResponse = (function() { + + /** + * Properties of an AbandonReleaseResponse. + * @memberof google.cloud.deploy.v1 + * @interface IAbandonReleaseResponse + */ + + /** + * Constructs a new AbandonReleaseResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an AbandonReleaseResponse. + * @implements IAbandonReleaseResponse + * @constructor + * @param {google.cloud.deploy.v1.IAbandonReleaseResponse=} [properties] Properties to set + */ + function AbandonReleaseResponse(properties) { + if (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 AbandonReleaseResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.AbandonReleaseResponse} AbandonReleaseResponse instance + */ + AbandonReleaseResponse.create = function create(properties) { + return new AbandonReleaseResponse(properties); + }; + + /** + * Encodes the specified AbandonReleaseResponse message. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseResponse} message AbandonReleaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonReleaseResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AbandonReleaseResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseResponse} message AbandonReleaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonReleaseResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AbandonReleaseResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.AbandonReleaseResponse} AbandonReleaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonReleaseResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.AbandonReleaseResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AbandonReleaseResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.AbandonReleaseResponse} AbandonReleaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonReleaseResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AbandonReleaseResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AbandonReleaseResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AbandonReleaseResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.AbandonReleaseResponse} AbandonReleaseResponse + */ + AbandonReleaseResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.AbandonReleaseResponse) + return object; + return new $root.google.cloud.deploy.v1.AbandonReleaseResponse(); + }; + + /** + * Creates a plain object from an AbandonReleaseResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {google.cloud.deploy.v1.AbandonReleaseResponse} message AbandonReleaseResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AbandonReleaseResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AbandonReleaseResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @instance + * @returns {Object.} JSON object + */ + AbandonReleaseResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AbandonReleaseResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AbandonReleaseResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.AbandonReleaseResponse"; + }; + + return AbandonReleaseResponse; + })(); + + v1.JobRun = (function() { + + /** + * Properties of a JobRun. + * @memberof google.cloud.deploy.v1 + * @interface IJobRun + * @property {string|null} [name] JobRun name + * @property {string|null} [uid] JobRun uid + * @property {string|null} [phaseId] JobRun phaseId + * @property {string|null} [jobId] JobRun jobId + * @property {google.protobuf.ITimestamp|null} [createTime] JobRun createTime + * @property {google.protobuf.ITimestamp|null} [startTime] JobRun startTime + * @property {google.protobuf.ITimestamp|null} [endTime] JobRun endTime + * @property {google.cloud.deploy.v1.JobRun.State|null} [state] JobRun state + * @property {google.cloud.deploy.v1.IDeployJobRun|null} [deployJobRun] JobRun deployJobRun + * @property {google.cloud.deploy.v1.IVerifyJobRun|null} [verifyJobRun] JobRun verifyJobRun + * @property {string|null} [etag] JobRun etag + */ + + /** + * Constructs a new JobRun. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a JobRun. + * @implements IJobRun + * @constructor + * @param {google.cloud.deploy.v1.IJobRun=} [properties] Properties to set + */ + function JobRun(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobRun name. + * @member {string} name + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.name = ""; + + /** + * JobRun uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.uid = ""; + + /** + * JobRun phaseId. + * @member {string} phaseId + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.phaseId = ""; + + /** + * JobRun jobId. + * @member {string} jobId + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.jobId = ""; + + /** + * JobRun createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.createTime = null; + + /** + * JobRun startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.startTime = null; + + /** + * JobRun endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.endTime = null; + + /** + * JobRun state. + * @member {google.cloud.deploy.v1.JobRun.State} state + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.state = 0; + + /** + * JobRun deployJobRun. + * @member {google.cloud.deploy.v1.IDeployJobRun|null|undefined} deployJobRun + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.deployJobRun = null; + + /** + * JobRun verifyJobRun. + * @member {google.cloud.deploy.v1.IVerifyJobRun|null|undefined} verifyJobRun + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.verifyJobRun = null; + + /** + * JobRun etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * JobRun jobRun. + * @member {"deployJobRun"|"verifyJobRun"|undefined} jobRun + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + Object.defineProperty(JobRun.prototype, "jobRun", { + get: $util.oneOfGetter($oneOfFields = ["deployJobRun", "verifyJobRun"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new JobRun instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {google.cloud.deploy.v1.IJobRun=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.JobRun} JobRun instance + */ + JobRun.create = function create(properties) { + return new JobRun(properties); + }; + + /** + * Encodes the specified JobRun message. Does not implicitly {@link google.cloud.deploy.v1.JobRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {google.cloud.deploy.v1.IJobRun} message JobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobRun.encode = function encode(message, writer) { + if (!writer) + 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.phaseId != null && Object.hasOwnProperty.call(message, "phaseId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.phaseId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jobId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.deployJobRun != null && Object.hasOwnProperty.call(message, "deployJobRun")) + $root.google.cloud.deploy.v1.DeployJobRun.encode(message.deployJobRun, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.verifyJobRun != null && Object.hasOwnProperty.call(message, "verifyJobRun")) + $root.google.cloud.deploy.v1.VerifyJobRun.encode(message.verifyJobRun, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + return writer; + }; + + /** + * Encodes the specified JobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.JobRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {google.cloud.deploy.v1.IJobRun} message JobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.JobRun} JobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.JobRun(); + 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.phaseId = reader.string(); + break; + } + case 4: { + message.jobId = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.deployJobRun = $root.google.cloud.deploy.v1.DeployJobRun.decode(reader, reader.uint32()); + break; + } + case 10: { + message.verifyJobRun = $root.google.cloud.deploy.v1.VerifyJobRun.decode(reader, reader.uint32()); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.JobRun} JobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobRun message. + * @function verify + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobRun.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.phaseId != null && message.hasOwnProperty("phaseId")) + if (!$util.isString(message.phaseId)) + return "phaseId: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.deployJobRun != null && message.hasOwnProperty("deployJobRun")) { + properties.jobRun = 1; + { + var error = $root.google.cloud.deploy.v1.DeployJobRun.verify(message.deployJobRun); + if (error) + return "deployJobRun." + error; + } + } + if (message.verifyJobRun != null && message.hasOwnProperty("verifyJobRun")) { + if (properties.jobRun === 1) + return "jobRun: multiple values"; + properties.jobRun = 1; + { + var error = $root.google.cloud.deploy.v1.VerifyJobRun.verify(message.verifyJobRun); + if (error) + return "verifyJobRun." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a JobRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.JobRun} JobRun + */ + JobRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.JobRun) + return object; + var message = new $root.google.cloud.deploy.v1.JobRun(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.phaseId != null) + message.phaseId = String(object.phaseId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.JobRun.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.deploy.v1.JobRun.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.deploy.v1.JobRun.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "IN_PROGRESS": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + if (object.deployJobRun != null) { + if (typeof object.deployJobRun !== "object") + throw TypeError(".google.cloud.deploy.v1.JobRun.deployJobRun: object expected"); + message.deployJobRun = $root.google.cloud.deploy.v1.DeployJobRun.fromObject(object.deployJobRun); + } + if (object.verifyJobRun != null) { + if (typeof object.verifyJobRun !== "object") + throw TypeError(".google.cloud.deploy.v1.JobRun.verifyJobRun: object expected"); + message.verifyJobRun = $root.google.cloud.deploy.v1.VerifyJobRun.fromObject(object.verifyJobRun); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a JobRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {google.cloud.deploy.v1.JobRun} message JobRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.phaseId = ""; + object.jobId = ""; + object.createTime = null; + object.startTime = null; + object.endTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 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.phaseId != null && message.hasOwnProperty("phaseId")) + object.phaseId = message.phaseId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.deploy.v1.JobRun.State[message.state] : message.state; + if (message.deployJobRun != null && message.hasOwnProperty("deployJobRun")) { + object.deployJobRun = $root.google.cloud.deploy.v1.DeployJobRun.toObject(message.deployJobRun, options); + if (options.oneofs) + object.jobRun = "deployJobRun"; + } + if (message.verifyJobRun != null && message.hasOwnProperty("verifyJobRun")) { + object.verifyJobRun = $root.google.cloud.deploy.v1.VerifyJobRun.toObject(message.verifyJobRun, options); + if (options.oneofs) + object.jobRun = "verifyJobRun"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this JobRun to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.JobRun + * @instance + * @returns {Object.} JSON object + */ + JobRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobRun + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.JobRun"; + }; + + /** + * State enum. + * @name google.cloud.deploy.v1.JobRun.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + */ + JobRun.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + return JobRun; + })(); + + v1.DeployJobRun = (function() { + + /** + * Properties of a DeployJobRun. + * @memberof google.cloud.deploy.v1 + * @interface IDeployJobRun + * @property {string|null} [build] DeployJobRun build + * @property {google.cloud.deploy.v1.DeployJobRun.FailureCause|null} [failureCause] DeployJobRun failureCause + * @property {string|null} [failureMessage] DeployJobRun failureMessage + * @property {google.cloud.deploy.v1.IDeployJobRunMetadata|null} [metadata] DeployJobRun metadata + */ + + /** + * Constructs a new DeployJobRun. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeployJobRun. + * @implements IDeployJobRun + * @constructor + * @param {google.cloud.deploy.v1.IDeployJobRun=} [properties] Properties to set + */ + function DeployJobRun(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployJobRun build. + * @member {string} build + * @memberof google.cloud.deploy.v1.DeployJobRun + * @instance + */ + DeployJobRun.prototype.build = ""; + + /** + * DeployJobRun failureCause. + * @member {google.cloud.deploy.v1.DeployJobRun.FailureCause} failureCause + * @memberof google.cloud.deploy.v1.DeployJobRun + * @instance + */ + DeployJobRun.prototype.failureCause = 0; + + /** + * DeployJobRun failureMessage. + * @member {string} failureMessage + * @memberof google.cloud.deploy.v1.DeployJobRun + * @instance + */ + DeployJobRun.prototype.failureMessage = ""; + + /** + * DeployJobRun metadata. + * @member {google.cloud.deploy.v1.IDeployJobRunMetadata|null|undefined} metadata + * @memberof google.cloud.deploy.v1.DeployJobRun + * @instance + */ + DeployJobRun.prototype.metadata = null; + + /** + * Creates a new DeployJobRun instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {google.cloud.deploy.v1.IDeployJobRun=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeployJobRun} DeployJobRun instance + */ + DeployJobRun.create = function create(properties) { + return new DeployJobRun(properties); + }; + + /** + * Encodes the specified DeployJobRun message. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {google.cloud.deploy.v1.IDeployJobRun} message DeployJobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJobRun.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.build != null && Object.hasOwnProperty.call(message, "build")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.build); + if (message.failureCause != null && Object.hasOwnProperty.call(message, "failureCause")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.failureCause); + if (message.failureMessage != null && Object.hasOwnProperty.call(message, "failureMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.failureMessage); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.deploy.v1.DeployJobRunMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployJobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {google.cloud.deploy.v1.IDeployJobRun} message DeployJobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJobRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployJobRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeployJobRun} DeployJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJobRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeployJobRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.build = reader.string(); + break; + } + case 2: { + message.failureCause = reader.int32(); + break; + } + case 3: { + message.failureMessage = reader.string(); + break; + } + case 4: { + message.metadata = $root.google.cloud.deploy.v1.DeployJobRunMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployJobRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeployJobRun} DeployJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJobRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployJobRun message. + * @function verify + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployJobRun.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.build != null && message.hasOwnProperty("build")) + if (!$util.isString(message.build)) + return "build: string expected"; + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + switch (message.failureCause) { + default: + return "failureCause: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + if (!$util.isString(message.failureMessage)) + return "failureMessage: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.deploy.v1.DeployJobRunMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a DeployJobRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeployJobRun} DeployJobRun + */ + DeployJobRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeployJobRun) + return object; + var message = new $root.google.cloud.deploy.v1.DeployJobRun(); + if (object.build != null) + message.build = String(object.build); + switch (object.failureCause) { + case "FAILURE_CAUSE_UNSPECIFIED": + case 0: + message.failureCause = 0; + break; + case "CLOUD_BUILD_UNAVAILABLE": + case 1: + message.failureCause = 1; + break; + case "EXECUTION_FAILED": + case 2: + message.failureCause = 2; + break; + case "DEADLINE_EXCEEDED": + case 3: + message.failureCause = 3; + break; + } + if (object.failureMessage != null) + message.failureMessage = String(object.failureMessage); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.deploy.v1.DeployJobRun.metadata: object expected"); + message.metadata = $root.google.cloud.deploy.v1.DeployJobRunMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a DeployJobRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {google.cloud.deploy.v1.DeployJobRun} message DeployJobRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployJobRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.build = ""; + object.failureCause = options.enums === String ? "FAILURE_CAUSE_UNSPECIFIED" : 0; + object.failureMessage = ""; + object.metadata = null; + } + if (message.build != null && message.hasOwnProperty("build")) + object.build = message.build; + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + object.failureCause = options.enums === String ? $root.google.cloud.deploy.v1.DeployJobRun.FailureCause[message.failureCause] : message.failureCause; + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + object.failureMessage = message.failureMessage; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.deploy.v1.DeployJobRunMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this DeployJobRun to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeployJobRun + * @instance + * @returns {Object.} JSON object + */ + DeployJobRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployJobRun + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployJobRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeployJobRun"; + }; + + /** + * FailureCause enum. + * @name google.cloud.deploy.v1.DeployJobRun.FailureCause + * @enum {number} + * @property {number} FAILURE_CAUSE_UNSPECIFIED=0 FAILURE_CAUSE_UNSPECIFIED value + * @property {number} CLOUD_BUILD_UNAVAILABLE=1 CLOUD_BUILD_UNAVAILABLE value + * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value + * @property {number} DEADLINE_EXCEEDED=3 DEADLINE_EXCEEDED value + */ + DeployJobRun.FailureCause = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_CAUSE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_BUILD_UNAVAILABLE"] = 1; + values[valuesById[2] = "EXECUTION_FAILED"] = 2; + values[valuesById[3] = "DEADLINE_EXCEEDED"] = 3; + return values; + })(); + + return DeployJobRun; + })(); + + v1.VerifyJobRun = (function() { + + /** + * Properties of a VerifyJobRun. + * @memberof google.cloud.deploy.v1 + * @interface IVerifyJobRun + * @property {string|null} [build] VerifyJobRun build + * @property {string|null} [artifactUri] VerifyJobRun artifactUri + * @property {string|null} [eventLogPath] VerifyJobRun eventLogPath + * @property {google.cloud.deploy.v1.VerifyJobRun.FailureCause|null} [failureCause] VerifyJobRun failureCause + * @property {string|null} [failureMessage] VerifyJobRun failureMessage + */ + + /** + * Constructs a new VerifyJobRun. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a VerifyJobRun. + * @implements IVerifyJobRun + * @constructor + * @param {google.cloud.deploy.v1.IVerifyJobRun=} [properties] Properties to set + */ + function VerifyJobRun(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VerifyJobRun build. + * @member {string} build + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + */ + VerifyJobRun.prototype.build = ""; + + /** + * VerifyJobRun artifactUri. + * @member {string} artifactUri + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + */ + VerifyJobRun.prototype.artifactUri = ""; + + /** + * VerifyJobRun eventLogPath. + * @member {string} eventLogPath + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + */ + VerifyJobRun.prototype.eventLogPath = ""; + + /** + * VerifyJobRun failureCause. + * @member {google.cloud.deploy.v1.VerifyJobRun.FailureCause} failureCause + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + */ + VerifyJobRun.prototype.failureCause = 0; + + /** + * VerifyJobRun failureMessage. + * @member {string} failureMessage + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + */ + VerifyJobRun.prototype.failureMessage = ""; + + /** + * Creates a new VerifyJobRun instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {google.cloud.deploy.v1.IVerifyJobRun=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.VerifyJobRun} VerifyJobRun instance + */ + VerifyJobRun.create = function create(properties) { + return new VerifyJobRun(properties); + }; + + /** + * Encodes the specified VerifyJobRun message. Does not implicitly {@link google.cloud.deploy.v1.VerifyJobRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {google.cloud.deploy.v1.IVerifyJobRun} message VerifyJobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifyJobRun.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.build != null && Object.hasOwnProperty.call(message, "build")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.build); + if (message.artifactUri != null && Object.hasOwnProperty.call(message, "artifactUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.artifactUri); + if (message.eventLogPath != null && Object.hasOwnProperty.call(message, "eventLogPath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.eventLogPath); + if (message.failureCause != null && Object.hasOwnProperty.call(message, "failureCause")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failureCause); + if (message.failureMessage != null && Object.hasOwnProperty.call(message, "failureMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.failureMessage); + return writer; + }; + + /** + * Encodes the specified VerifyJobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.VerifyJobRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {google.cloud.deploy.v1.IVerifyJobRun} message VerifyJobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifyJobRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VerifyJobRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.VerifyJobRun} VerifyJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifyJobRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.VerifyJobRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.build = reader.string(); + break; + } + case 2: { + message.artifactUri = reader.string(); + break; + } + case 3: { + message.eventLogPath = reader.string(); + break; + } + case 4: { + message.failureCause = reader.int32(); + break; + } + case 5: { + message.failureMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VerifyJobRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.VerifyJobRun} VerifyJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifyJobRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VerifyJobRun message. + * @function verify + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VerifyJobRun.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.build != null && message.hasOwnProperty("build")) + if (!$util.isString(message.build)) + return "build: string expected"; + if (message.artifactUri != null && message.hasOwnProperty("artifactUri")) + if (!$util.isString(message.artifactUri)) + return "artifactUri: string expected"; + if (message.eventLogPath != null && message.hasOwnProperty("eventLogPath")) + if (!$util.isString(message.eventLogPath)) + return "eventLogPath: string expected"; + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + switch (message.failureCause) { + default: + return "failureCause: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + if (!$util.isString(message.failureMessage)) + return "failureMessage: string expected"; + return null; + }; + + /** + * Creates a VerifyJobRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.VerifyJobRun} VerifyJobRun + */ + VerifyJobRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.VerifyJobRun) + return object; + var message = new $root.google.cloud.deploy.v1.VerifyJobRun(); + if (object.build != null) + message.build = String(object.build); + if (object.artifactUri != null) + message.artifactUri = String(object.artifactUri); + if (object.eventLogPath != null) + message.eventLogPath = String(object.eventLogPath); + switch (object.failureCause) { + case "FAILURE_CAUSE_UNSPECIFIED": + case 0: + message.failureCause = 0; + break; + case "CLOUD_BUILD_UNAVAILABLE": + case 1: + message.failureCause = 1; + break; + case "EXECUTION_FAILED": + case 2: + message.failureCause = 2; + break; + case "DEADLINE_EXCEEDED": + case 3: + message.failureCause = 3; + break; + case "VERIFICATION_CONFIG_NOT_FOUND": + case 4: + message.failureCause = 4; + break; + } + if (object.failureMessage != null) + message.failureMessage = String(object.failureMessage); + return message; + }; + + /** + * Creates a plain object from a VerifyJobRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {google.cloud.deploy.v1.VerifyJobRun} message VerifyJobRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VerifyJobRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.build = ""; + object.artifactUri = ""; + object.eventLogPath = ""; + object.failureCause = options.enums === String ? "FAILURE_CAUSE_UNSPECIFIED" : 0; + object.failureMessage = ""; + } + if (message.build != null && message.hasOwnProperty("build")) + object.build = message.build; + if (message.artifactUri != null && message.hasOwnProperty("artifactUri")) + object.artifactUri = message.artifactUri; + if (message.eventLogPath != null && message.hasOwnProperty("eventLogPath")) + object.eventLogPath = message.eventLogPath; + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + object.failureCause = options.enums === String ? $root.google.cloud.deploy.v1.VerifyJobRun.FailureCause[message.failureCause] : message.failureCause; + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + object.failureMessage = message.failureMessage; + return object; + }; + + /** + * Converts this VerifyJobRun to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + * @returns {Object.} JSON object + */ + VerifyJobRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VerifyJobRun + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VerifyJobRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.VerifyJobRun"; + }; + + /** + * FailureCause enum. + * @name google.cloud.deploy.v1.VerifyJobRun.FailureCause + * @enum {number} + * @property {number} FAILURE_CAUSE_UNSPECIFIED=0 FAILURE_CAUSE_UNSPECIFIED value + * @property {number} CLOUD_BUILD_UNAVAILABLE=1 CLOUD_BUILD_UNAVAILABLE value + * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value + * @property {number} DEADLINE_EXCEEDED=3 DEADLINE_EXCEEDED value + * @property {number} VERIFICATION_CONFIG_NOT_FOUND=4 VERIFICATION_CONFIG_NOT_FOUND value + */ + VerifyJobRun.FailureCause = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_CAUSE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_BUILD_UNAVAILABLE"] = 1; + values[valuesById[2] = "EXECUTION_FAILED"] = 2; + values[valuesById[3] = "DEADLINE_EXCEEDED"] = 3; + values[valuesById[4] = "VERIFICATION_CONFIG_NOT_FOUND"] = 4; + return values; + })(); + + return VerifyJobRun; + })(); + + v1.ListJobRunsRequest = (function() { + + /** + * Properties of a ListJobRunsRequest. + * @memberof google.cloud.deploy.v1 + * @interface IListJobRunsRequest + * @property {string|null} [parent] ListJobRunsRequest parent + * @property {number|null} [pageSize] ListJobRunsRequest pageSize + * @property {string|null} [pageToken] ListJobRunsRequest pageToken + * @property {string|null} [filter] ListJobRunsRequest filter + * @property {string|null} [orderBy] ListJobRunsRequest orderBy + */ + + /** + * Constructs a new ListJobRunsRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListJobRunsRequest. + * @implements IListJobRunsRequest + * @constructor + * @param {google.cloud.deploy.v1.IListJobRunsRequest=} [properties] Properties to set + */ + function ListJobRunsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + */ + ListJobRunsRequest.prototype.parent = ""; + + /** + * ListJobRunsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + */ + ListJobRunsRequest.prototype.pageSize = 0; + + /** + * ListJobRunsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + */ + ListJobRunsRequest.prototype.pageToken = ""; + + /** + * ListJobRunsRequest filter. + * @member {string} filter + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + */ + ListJobRunsRequest.prototype.filter = ""; + + /** + * ListJobRunsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + */ + ListJobRunsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListJobRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {google.cloud.deploy.v1.IListJobRunsRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListJobRunsRequest} ListJobRunsRequest instance + */ + ListJobRunsRequest.create = function create(properties) { + return new ListJobRunsRequest(properties); + }; + + /** + * Encodes the specified ListJobRunsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {google.cloud.deploy.v1.IListJobRunsRequest} message ListJobRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobRunsRequest.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 ListJobRunsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {google.cloud.deploy.v1.IListJobRunsRequest} message ListJobRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListJobRunsRequest} ListJobRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListJobRunsRequest(); + 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 ListJobRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListJobRunsRequest} ListJobRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobRunsRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobRunsRequest.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 ListJobRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListJobRunsRequest} ListJobRunsRequest + */ + ListJobRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListJobRunsRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ListJobRunsRequest(); + 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 ListJobRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {google.cloud.deploy.v1.ListJobRunsRequest} message ListJobRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobRunsRequest.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 ListJobRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobRunsRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListJobRunsRequest"; + }; + + return ListJobRunsRequest; + })(); + + v1.ListJobRunsResponse = (function() { + + /** + * Properties of a ListJobRunsResponse. + * @memberof google.cloud.deploy.v1 + * @interface IListJobRunsResponse + * @property {Array.|null} [jobRuns] ListJobRunsResponse jobRuns + * @property {string|null} [nextPageToken] ListJobRunsResponse nextPageToken + * @property {Array.|null} [unreachable] ListJobRunsResponse unreachable + */ + + /** + * Constructs a new ListJobRunsResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListJobRunsResponse. + * @implements IListJobRunsResponse + * @constructor + * @param {google.cloud.deploy.v1.IListJobRunsResponse=} [properties] Properties to set + */ + function ListJobRunsResponse(properties) { + this.jobRuns = []; + 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]]; + } + + /** + * ListJobRunsResponse jobRuns. + * @member {Array.} jobRuns + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @instance + */ + ListJobRunsResponse.prototype.jobRuns = $util.emptyArray; + + /** + * ListJobRunsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @instance + */ + ListJobRunsResponse.prototype.nextPageToken = ""; + + /** + * ListJobRunsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @instance + */ + ListJobRunsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListJobRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {google.cloud.deploy.v1.IListJobRunsResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListJobRunsResponse} ListJobRunsResponse instance + */ + ListJobRunsResponse.create = function create(properties) { + return new ListJobRunsResponse(properties); + }; + + /** + * Encodes the specified ListJobRunsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {google.cloud.deploy.v1.IListJobRunsResponse} message ListJobRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobRuns != null && message.jobRuns.length) + for (var i = 0; i < message.jobRuns.length; ++i) + $root.google.cloud.deploy.v1.JobRun.encode(message.jobRuns[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 ListJobRunsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {google.cloud.deploy.v1.IListJobRunsResponse} message ListJobRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListJobRunsResponse} ListJobRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListJobRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobRuns && message.jobRuns.length)) + message.jobRuns = []; + message.jobRuns.push($root.google.cloud.deploy.v1.JobRun.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 ListJobRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListJobRunsResponse} ListJobRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobRunsResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobRuns != null && message.hasOwnProperty("jobRuns")) { + if (!Array.isArray(message.jobRuns)) + return "jobRuns: array expected"; + for (var i = 0; i < message.jobRuns.length; ++i) { + var error = $root.google.cloud.deploy.v1.JobRun.verify(message.jobRuns[i]); + if (error) + return "jobRuns." + 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 ListJobRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListJobRunsResponse} ListJobRunsResponse + */ + ListJobRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListJobRunsResponse) + return object; + var message = new $root.google.cloud.deploy.v1.ListJobRunsResponse(); + if (object.jobRuns) { + if (!Array.isArray(object.jobRuns)) + throw TypeError(".google.cloud.deploy.v1.ListJobRunsResponse.jobRuns: array expected"); + message.jobRuns = []; + for (var i = 0; i < object.jobRuns.length; ++i) { + if (typeof object.jobRuns[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.ListJobRunsResponse.jobRuns: object expected"); + message.jobRuns[i] = $root.google.cloud.deploy.v1.JobRun.fromObject(object.jobRuns[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.deploy.v1.ListJobRunsResponse.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 ListJobRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {google.cloud.deploy.v1.ListJobRunsResponse} message ListJobRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobRuns = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.jobRuns && message.jobRuns.length) { + object.jobRuns = []; + for (var j = 0; j < message.jobRuns.length; ++j) + object.jobRuns[j] = $root.google.cloud.deploy.v1.JobRun.toObject(message.jobRuns[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 ListJobRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobRunsResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListJobRunsResponse"; + }; + + return ListJobRunsResponse; + })(); + + v1.GetJobRunRequest = (function() { + + /** + * Properties of a GetJobRunRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetJobRunRequest + * @property {string|null} [name] GetJobRunRequest name + */ + + /** + * Constructs a new GetJobRunRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetJobRunRequest. + * @implements IGetJobRunRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetJobRunRequest=} [properties] Properties to set + */ + function GetJobRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobRunRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @instance + */ + GetJobRunRequest.prototype.name = ""; + + /** + * Creates a new GetJobRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {google.cloud.deploy.v1.IGetJobRunRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetJobRunRequest} GetJobRunRequest instance + */ + GetJobRunRequest.create = function create(properties) { + return new GetJobRunRequest(properties); + }; + + /** + * Encodes the specified GetJobRunRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetJobRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {google.cloud.deploy.v1.IGetJobRunRequest} message GetJobRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRunRequest.encode = function encode(message, writer) { + 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 GetJobRunRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetJobRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {google.cloud.deploy.v1.IGetJobRunRequest} message GetJobRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetJobRunRequest} GetJobRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetJobRunRequest(); + 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 GetJobRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetJobRunRequest} GetJobRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRunRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRunRequest.verify = function verify(message) { + if (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 GetJobRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetJobRunRequest} GetJobRunRequest + */ + GetJobRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetJobRunRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetJobRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {google.cloud.deploy.v1.GetJobRunRequest} message GetJobRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRunRequest.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 GetJobRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRunRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetJobRunRequest"; + }; + + return GetJobRunRequest; + })(); + + v1.Config = (function() { + + /** + * Properties of a Config. + * @memberof google.cloud.deploy.v1 + * @interface IConfig + * @property {string|null} [name] Config name + * @property {Array.|null} [supportedVersions] Config supportedVersions + * @property {string|null} [defaultSkaffoldVersion] Config defaultSkaffoldVersion + */ + + /** + * Constructs a new Config. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Config. + * @implements IConfig + * @constructor + * @param {google.cloud.deploy.v1.IConfig=} [properties] Properties to set + */ + function Config(properties) { + this.supportedVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Config name. + * @member {string} name + * @memberof google.cloud.deploy.v1.Config + * @instance + */ + Config.prototype.name = ""; + + /** + * Config supportedVersions. + * @member {Array.} supportedVersions + * @memberof google.cloud.deploy.v1.Config + * @instance + */ + Config.prototype.supportedVersions = $util.emptyArray; + + /** + * Config defaultSkaffoldVersion. + * @member {string} defaultSkaffoldVersion + * @memberof google.cloud.deploy.v1.Config + * @instance + */ + Config.prototype.defaultSkaffoldVersion = ""; + + /** + * Creates a new Config instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {google.cloud.deploy.v1.IConfig=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Config} Config instance + */ + Config.create = function create(properties) { + return new Config(properties); + }; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.deploy.v1.Config.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {google.cloud.deploy.v1.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.supportedVersions != null && message.supportedVersions.length) + for (var i = 0; i < message.supportedVersions.length; ++i) + $root.google.cloud.deploy.v1.SkaffoldVersion.encode(message.supportedVersions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.defaultSkaffoldVersion != null && Object.hasOwnProperty.call(message, "defaultSkaffoldVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.defaultSkaffoldVersion); + return writer; + }; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Config.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {google.cloud.deploy.v1.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Config message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Config(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.supportedVersions && message.supportedVersions.length)) + message.supportedVersions = []; + message.supportedVersions.push($root.google.cloud.deploy.v1.SkaffoldVersion.decode(reader, reader.uint32())); + break; + } + case 3: { + message.defaultSkaffoldVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Config message. + * @function verify + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Config.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.supportedVersions != null && message.hasOwnProperty("supportedVersions")) { + if (!Array.isArray(message.supportedVersions)) + return "supportedVersions: array expected"; + for (var i = 0; i < message.supportedVersions.length; ++i) { + var error = $root.google.cloud.deploy.v1.SkaffoldVersion.verify(message.supportedVersions[i]); + if (error) + return "supportedVersions." + error; + } + } + if (message.defaultSkaffoldVersion != null && message.hasOwnProperty("defaultSkaffoldVersion")) + if (!$util.isString(message.defaultSkaffoldVersion)) + return "defaultSkaffoldVersion: string expected"; + return null; + }; + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Config} Config + */ + Config.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Config) + return object; + var message = new $root.google.cloud.deploy.v1.Config(); + if (object.name != null) + message.name = String(object.name); + if (object.supportedVersions) { + if (!Array.isArray(object.supportedVersions)) + throw TypeError(".google.cloud.deploy.v1.Config.supportedVersions: array expected"); + message.supportedVersions = []; + for (var i = 0; i < object.supportedVersions.length; ++i) { + if (typeof object.supportedVersions[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Config.supportedVersions: object expected"); + message.supportedVersions[i] = $root.google.cloud.deploy.v1.SkaffoldVersion.fromObject(object.supportedVersions[i]); + } + } + if (object.defaultSkaffoldVersion != null) + message.defaultSkaffoldVersion = String(object.defaultSkaffoldVersion); + return message; + }; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {google.cloud.deploy.v1.Config} message Config + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Config.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedVersions = []; + if (options.defaults) { + object.name = ""; + object.defaultSkaffoldVersion = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.supportedVersions && message.supportedVersions.length) { + object.supportedVersions = []; + for (var j = 0; j < message.supportedVersions.length; ++j) + object.supportedVersions[j] = $root.google.cloud.deploy.v1.SkaffoldVersion.toObject(message.supportedVersions[j], options); + } + if (message.defaultSkaffoldVersion != null && message.hasOwnProperty("defaultSkaffoldVersion")) + object.defaultSkaffoldVersion = message.defaultSkaffoldVersion; + return object; + }; + + /** + * Converts this Config to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Config + * @instance + * @returns {Object.} JSON object + */ + Config.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Config + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Config.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Config"; + }; + + return Config; + })(); + + v1.SkaffoldVersion = (function() { + + /** + * Properties of a SkaffoldVersion. + * @memberof google.cloud.deploy.v1 + * @interface ISkaffoldVersion + * @property {string|null} [version] SkaffoldVersion version + * @property {google.type.IDate|null} [supportEndDate] SkaffoldVersion supportEndDate + */ + + /** + * Constructs a new SkaffoldVersion. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a SkaffoldVersion. + * @implements ISkaffoldVersion + * @constructor + * @param {google.cloud.deploy.v1.ISkaffoldVersion=} [properties] Properties to set + */ + function SkaffoldVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SkaffoldVersion version. + * @member {string} version + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @instance + */ + SkaffoldVersion.prototype.version = ""; + + /** + * SkaffoldVersion supportEndDate. + * @member {google.type.IDate|null|undefined} supportEndDate + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @instance + */ + SkaffoldVersion.prototype.supportEndDate = null; + + /** + * Creates a new SkaffoldVersion instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {google.cloud.deploy.v1.ISkaffoldVersion=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.SkaffoldVersion} SkaffoldVersion instance + */ + SkaffoldVersion.create = function create(properties) { + return new SkaffoldVersion(properties); + }; + + /** + * Encodes the specified SkaffoldVersion message. Does not implicitly {@link google.cloud.deploy.v1.SkaffoldVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {google.cloud.deploy.v1.ISkaffoldVersion} message SkaffoldVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkaffoldVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.supportEndDate != null && Object.hasOwnProperty.call(message, "supportEndDate")) + $root.google.type.Date.encode(message.supportEndDate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SkaffoldVersion message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.SkaffoldVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {google.cloud.deploy.v1.ISkaffoldVersion} message SkaffoldVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkaffoldVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SkaffoldVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.SkaffoldVersion} SkaffoldVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkaffoldVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.SkaffoldVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.supportEndDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SkaffoldVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.SkaffoldVersion} SkaffoldVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkaffoldVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SkaffoldVersion message. + * @function verify + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SkaffoldVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.supportEndDate != null && message.hasOwnProperty("supportEndDate")) { + var error = $root.google.type.Date.verify(message.supportEndDate); + if (error) + return "supportEndDate." + error; + } + return null; + }; + + /** + * Creates a SkaffoldVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.SkaffoldVersion} SkaffoldVersion + */ + SkaffoldVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.SkaffoldVersion) + return object; + var message = new $root.google.cloud.deploy.v1.SkaffoldVersion(); + if (object.version != null) + message.version = String(object.version); + if (object.supportEndDate != null) { + if (typeof object.supportEndDate !== "object") + throw TypeError(".google.cloud.deploy.v1.SkaffoldVersion.supportEndDate: object expected"); + message.supportEndDate = $root.google.type.Date.fromObject(object.supportEndDate); + } + return message; + }; + + /** + * Creates a plain object from a SkaffoldVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {google.cloud.deploy.v1.SkaffoldVersion} message SkaffoldVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SkaffoldVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.supportEndDate = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.supportEndDate != null && message.hasOwnProperty("supportEndDate")) + object.supportEndDate = $root.google.type.Date.toObject(message.supportEndDate, options); + return object; + }; + + /** + * Converts this SkaffoldVersion to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @instance + * @returns {Object.} JSON object + */ + SkaffoldVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SkaffoldVersion + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SkaffoldVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.SkaffoldVersion"; + }; + + return SkaffoldVersion; + })(); + + v1.GetConfigRequest = (function() { + + /** + * Properties of a GetConfigRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetConfigRequest + * @property {string|null} [name] GetConfigRequest name + */ + + /** + * Constructs a new GetConfigRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetConfigRequest. + * @implements IGetConfigRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetConfigRequest=} [properties] Properties to set + */ + function GetConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConfigRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @instance + */ + GetConfigRequest.prototype.name = ""; + + /** + * Creates a new GetConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {google.cloud.deploy.v1.IGetConfigRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetConfigRequest} GetConfigRequest instance + */ + GetConfigRequest.create = function create(properties) { + return new GetConfigRequest(properties); + }; + + /** + * Encodes the specified GetConfigRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {google.cloud.deploy.v1.IGetConfigRequest} message GetConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConfigRequest.encode = function encode(message, writer) { + 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 GetConfigRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {google.cloud.deploy.v1.IGetConfigRequest} message GetConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetConfigRequest} GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetConfigRequest(); + 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 GetConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetConfigRequest} GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConfigRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConfigRequest.verify = function verify(message) { + if (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 GetConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetConfigRequest} GetConfigRequest + */ + GetConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetConfigRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {google.cloud.deploy.v1.GetConfigRequest} message GetConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConfigRequest.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 GetConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConfigRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetConfigRequest"; + }; + + return GetConfigRequest; + })(); + + v1.DeliveryPipelineNotificationEvent = (function() { + + /** + * Properties of a DeliveryPipelineNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @interface IDeliveryPipelineNotificationEvent + * @property {string|null} [message] DeliveryPipelineNotificationEvent message + * @property {string|null} [deliveryPipeline] DeliveryPipelineNotificationEvent deliveryPipeline + * @property {google.cloud.deploy.v1.Type|null} [type] DeliveryPipelineNotificationEvent type + */ + + /** + * Constructs a new DeliveryPipelineNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeliveryPipelineNotificationEvent. + * @implements IDeliveryPipelineNotificationEvent + * @constructor + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent=} [properties] Properties to set + */ + function DeliveryPipelineNotificationEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeliveryPipelineNotificationEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + */ + DeliveryPipelineNotificationEvent.prototype.message = ""; + + /** + * DeliveryPipelineNotificationEvent deliveryPipeline. + * @member {string} deliveryPipeline + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + */ + DeliveryPipelineNotificationEvent.prototype.deliveryPipeline = ""; + + /** + * DeliveryPipelineNotificationEvent type. + * @member {google.cloud.deploy.v1.Type} type + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + */ + DeliveryPipelineNotificationEvent.prototype.type = 0; + + /** + * Creates a new DeliveryPipelineNotificationEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent instance + */ + DeliveryPipelineNotificationEvent.create = function create(properties) { + return new DeliveryPipelineNotificationEvent(properties); + }; + + /** + * Encodes the specified DeliveryPipelineNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryPipelineNotificationEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.deliveryPipeline != null && Object.hasOwnProperty.call(message, "deliveryPipeline")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deliveryPipeline); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + return writer; + }; + + /** + * Encodes the specified DeliveryPipelineNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryPipelineNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryPipelineNotificationEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.deliveryPipeline = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryPipelineNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeliveryPipelineNotificationEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeliveryPipelineNotificationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + if (!$util.isString(message.deliveryPipeline)) + return "deliveryPipeline: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DeliveryPipelineNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + */ + DeliveryPipelineNotificationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent) + return object; + var message = new $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.deliveryPipeline != null) + message.deliveryPipeline = String(object.deliveryPipeline); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case 1: + message.type = 1; + break; + case "TYPE_RENDER_STATUES_CHANGE": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DeliveryPipelineNotificationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeliveryPipelineNotificationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.deliveryPipeline = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + object.deliveryPipeline = message.deliveryPipeline; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this DeliveryPipelineNotificationEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + * @returns {Object.} JSON object + */ + DeliveryPipelineNotificationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeliveryPipelineNotificationEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeliveryPipelineNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"; + }; + + return DeliveryPipelineNotificationEvent; + })(); + + /** + * Type enum. + * @name google.cloud.deploy.v1.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} TYPE_PUBSUB_NOTIFICATION_FAILURE=1 TYPE_PUBSUB_NOTIFICATION_FAILURE value + * @property {number} TYPE_RENDER_STATUES_CHANGE=2 TYPE_RENDER_STATUES_CHANGE value + */ + v1.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TYPE_PUBSUB_NOTIFICATION_FAILURE"] = 1; + values[valuesById[2] = "TYPE_RENDER_STATUES_CHANGE"] = 2; + return values; + })(); + + v1.JobRunNotificationEvent = (function() { + + /** + * Properties of a JobRunNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @interface IJobRunNotificationEvent + * @property {string|null} [message] JobRunNotificationEvent message + * @property {string|null} [jobRun] JobRunNotificationEvent jobRun + * @property {string|null} [pipelineUid] JobRunNotificationEvent pipelineUid + * @property {string|null} [releaseUid] JobRunNotificationEvent releaseUid + * @property {string|null} [rolloutUid] JobRunNotificationEvent rolloutUid + * @property {string|null} [targetId] JobRunNotificationEvent targetId + * @property {google.cloud.deploy.v1.Type|null} [type] JobRunNotificationEvent type + */ + + /** + * Constructs a new JobRunNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a JobRunNotificationEvent. + * @implements IJobRunNotificationEvent + * @constructor + * @param {google.cloud.deploy.v1.IJobRunNotificationEvent=} [properties] Properties to set + */ + function JobRunNotificationEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobRunNotificationEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.message = ""; + + /** + * JobRunNotificationEvent jobRun. + * @member {string} jobRun + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.jobRun = ""; + + /** + * JobRunNotificationEvent pipelineUid. + * @member {string} pipelineUid + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.pipelineUid = ""; + + /** + * JobRunNotificationEvent releaseUid. + * @member {string} releaseUid + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.releaseUid = ""; + + /** + * JobRunNotificationEvent rolloutUid. + * @member {string} rolloutUid + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.rolloutUid = ""; + + /** + * JobRunNotificationEvent targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.targetId = ""; + + /** + * JobRunNotificationEvent type. + * @member {google.cloud.deploy.v1.Type} type + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.type = 0; + + /** + * Creates a new JobRunNotificationEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IJobRunNotificationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.JobRunNotificationEvent} JobRunNotificationEvent instance + */ + JobRunNotificationEvent.create = function create(properties) { + return new JobRunNotificationEvent(properties); + }; + + /** + * Encodes the specified JobRunNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.JobRunNotificationEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IJobRunNotificationEvent} message JobRunNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobRunNotificationEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.jobRun != null && Object.hasOwnProperty.call(message, "jobRun")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobRun); + if (message.pipelineUid != null && Object.hasOwnProperty.call(message, "pipelineUid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pipelineUid); + if (message.releaseUid != null && Object.hasOwnProperty.call(message, "releaseUid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.releaseUid); + if (message.rolloutUid != null && Object.hasOwnProperty.call(message, "rolloutUid")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.rolloutUid); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.targetId); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.type); + return writer; + }; + + /** + * Encodes the specified JobRunNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.JobRunNotificationEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IJobRunNotificationEvent} message JobRunNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobRunNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobRunNotificationEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.JobRunNotificationEvent} JobRunNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobRunNotificationEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.JobRunNotificationEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.jobRun = reader.string(); + break; + } + case 3: { + message.pipelineUid = reader.string(); + break; + } + case 4: { + message.releaseUid = reader.string(); + break; + } + case 5: { + message.rolloutUid = reader.string(); + break; + } + case 6: { + message.targetId = reader.string(); + break; + } + case 7: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobRunNotificationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.JobRunNotificationEvent} JobRunNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobRunNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobRunNotificationEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobRunNotificationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.jobRun != null && message.hasOwnProperty("jobRun")) + if (!$util.isString(message.jobRun)) + return "jobRun: string expected"; + if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) + if (!$util.isString(message.pipelineUid)) + return "pipelineUid: string expected"; + if (message.releaseUid != null && message.hasOwnProperty("releaseUid")) + if (!$util.isString(message.releaseUid)) + return "releaseUid: string expected"; + if (message.rolloutUid != null && message.hasOwnProperty("rolloutUid")) + if (!$util.isString(message.rolloutUid)) + return "rolloutUid: string expected"; + if (message.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a JobRunNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.JobRunNotificationEvent} JobRunNotificationEvent + */ + JobRunNotificationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.JobRunNotificationEvent) + return object; + var message = new $root.google.cloud.deploy.v1.JobRunNotificationEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.jobRun != null) + message.jobRun = String(object.jobRun); + if (object.pipelineUid != null) + message.pipelineUid = String(object.pipelineUid); + if (object.releaseUid != null) + message.releaseUid = String(object.releaseUid); + if (object.rolloutUid != null) + message.rolloutUid = String(object.rolloutUid); + if (object.targetId != null) + message.targetId = String(object.targetId); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case 1: + message.type = 1; + break; + case "TYPE_RENDER_STATUES_CHANGE": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a JobRunNotificationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {google.cloud.deploy.v1.JobRunNotificationEvent} message JobRunNotificationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobRunNotificationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.jobRun = ""; + object.pipelineUid = ""; + object.releaseUid = ""; + object.rolloutUid = ""; + object.targetId = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.jobRun != null && message.hasOwnProperty("jobRun")) + object.jobRun = message.jobRun; + if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) + object.pipelineUid = message.pipelineUid; + if (message.releaseUid != null && message.hasOwnProperty("releaseUid")) + object.releaseUid = message.releaseUid; + if (message.rolloutUid != null && message.hasOwnProperty("rolloutUid")) + object.rolloutUid = message.rolloutUid; + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this JobRunNotificationEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + * @returns {Object.} JSON object + */ + JobRunNotificationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobRunNotificationEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobRunNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.JobRunNotificationEvent"; + }; + + return JobRunNotificationEvent; + })(); + + v1.ReleaseNotificationEvent = (function() { + + /** + * Properties of a ReleaseNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @interface IReleaseNotificationEvent + * @property {string|null} [message] ReleaseNotificationEvent message + * @property {string|null} [release] ReleaseNotificationEvent release + * @property {google.cloud.deploy.v1.Type|null} [type] ReleaseNotificationEvent type + */ + + /** + * Constructs a new ReleaseNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ReleaseNotificationEvent. + * @implements IReleaseNotificationEvent + * @constructor + * @param {google.cloud.deploy.v1.IReleaseNotificationEvent=} [properties] Properties to set + */ + function ReleaseNotificationEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReleaseNotificationEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @instance + */ + ReleaseNotificationEvent.prototype.message = ""; + + /** + * ReleaseNotificationEvent release. + * @member {string} release + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @instance + */ + ReleaseNotificationEvent.prototype.release = ""; + + /** + * ReleaseNotificationEvent type. + * @member {google.cloud.deploy.v1.Type} type + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @instance + */ + ReleaseNotificationEvent.prototype.type = 0; + + /** + * Creates a new ReleaseNotificationEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseNotificationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ReleaseNotificationEvent} ReleaseNotificationEvent instance + */ + ReleaseNotificationEvent.create = function create(properties) { + return new ReleaseNotificationEvent(properties); + }; + + /** + * Encodes the specified ReleaseNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.ReleaseNotificationEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseNotificationEvent} message ReleaseNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseNotificationEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.release != null && Object.hasOwnProperty.call(message, "release")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.release); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + return writer; + }; + + /** + * Encodes the specified ReleaseNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ReleaseNotificationEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseNotificationEvent} message ReleaseNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReleaseNotificationEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ReleaseNotificationEvent} ReleaseNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseNotificationEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ReleaseNotificationEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.release = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReleaseNotificationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ReleaseNotificationEvent} ReleaseNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReleaseNotificationEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReleaseNotificationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.release != null && message.hasOwnProperty("release")) + if (!$util.isString(message.release)) + return "release: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ReleaseNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ReleaseNotificationEvent} ReleaseNotificationEvent + */ + ReleaseNotificationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ReleaseNotificationEvent) + return object; + var message = new $root.google.cloud.deploy.v1.ReleaseNotificationEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.release != null) + message.release = String(object.release); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case 1: + message.type = 1; + break; + case "TYPE_RENDER_STATUES_CHANGE": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ReleaseNotificationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {google.cloud.deploy.v1.ReleaseNotificationEvent} message ReleaseNotificationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReleaseNotificationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.release = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.release != null && message.hasOwnProperty("release")) + object.release = message.release; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this ReleaseNotificationEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @instance + * @returns {Object.} JSON object + */ + ReleaseNotificationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReleaseNotificationEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReleaseNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ReleaseNotificationEvent"; + }; + + return ReleaseNotificationEvent; + })(); + + v1.ReleaseRenderEvent = (function() { + + /** + * Properties of a ReleaseRenderEvent. + * @memberof google.cloud.deploy.v1 + * @interface IReleaseRenderEvent + * @property {string|null} [message] ReleaseRenderEvent message + * @property {string|null} [release] ReleaseRenderEvent release + */ + + /** + * Constructs a new ReleaseRenderEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ReleaseRenderEvent. + * @implements IReleaseRenderEvent + * @constructor + * @param {google.cloud.deploy.v1.IReleaseRenderEvent=} [properties] Properties to set + */ + function ReleaseRenderEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReleaseRenderEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @instance + */ + ReleaseRenderEvent.prototype.message = ""; + + /** + * ReleaseRenderEvent release. + * @member {string} release + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @instance + */ + ReleaseRenderEvent.prototype.release = ""; + + /** + * Creates a new ReleaseRenderEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseRenderEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ReleaseRenderEvent} ReleaseRenderEvent instance + */ + ReleaseRenderEvent.create = function create(properties) { + return new ReleaseRenderEvent(properties); + }; + + /** + * Encodes the specified ReleaseRenderEvent message. Does not implicitly {@link google.cloud.deploy.v1.ReleaseRenderEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseRenderEvent} message ReleaseRenderEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseRenderEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.release != null && Object.hasOwnProperty.call(message, "release")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.release); + return writer; + }; + + /** + * Encodes the specified ReleaseRenderEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ReleaseRenderEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseRenderEvent} message ReleaseRenderEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseRenderEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReleaseRenderEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ReleaseRenderEvent} ReleaseRenderEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseRenderEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ReleaseRenderEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.release = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReleaseRenderEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ReleaseRenderEvent} ReleaseRenderEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseRenderEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReleaseRenderEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReleaseRenderEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.release != null && message.hasOwnProperty("release")) + if (!$util.isString(message.release)) + return "release: string expected"; + return null; + }; + + /** + * Creates a ReleaseRenderEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ReleaseRenderEvent} ReleaseRenderEvent + */ + ReleaseRenderEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ReleaseRenderEvent) + return object; + var message = new $root.google.cloud.deploy.v1.ReleaseRenderEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.release != null) + message.release = String(object.release); + return message; + }; + + /** + * Creates a plain object from a ReleaseRenderEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {google.cloud.deploy.v1.ReleaseRenderEvent} message ReleaseRenderEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReleaseRenderEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.release = ""; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.release != null && message.hasOwnProperty("release")) + object.release = message.release; + return object; + }; + + /** + * Converts this ReleaseRenderEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @instance + * @returns {Object.} JSON object + */ + ReleaseRenderEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReleaseRenderEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReleaseRenderEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ReleaseRenderEvent"; + }; + + return ReleaseRenderEvent; + })(); + + v1.RolloutNotificationEvent = (function() { + + /** + * Properties of a RolloutNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @interface IRolloutNotificationEvent + * @property {string|null} [message] RolloutNotificationEvent message + * @property {string|null} [pipelineUid] RolloutNotificationEvent pipelineUid + * @property {string|null} [releaseUid] RolloutNotificationEvent releaseUid + * @property {string|null} [rollout] RolloutNotificationEvent rollout + * @property {google.cloud.deploy.v1.Type|null} [type] RolloutNotificationEvent type + * @property {string|null} [targetId] RolloutNotificationEvent targetId + */ + + /** + * Constructs a new RolloutNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a RolloutNotificationEvent. + * @implements IRolloutNotificationEvent + * @constructor + * @param {google.cloud.deploy.v1.IRolloutNotificationEvent=} [properties] Properties to set + */ + function RolloutNotificationEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RolloutNotificationEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.message = ""; + + /** + * RolloutNotificationEvent pipelineUid. + * @member {string} pipelineUid + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.pipelineUid = ""; + + /** + * RolloutNotificationEvent releaseUid. + * @member {string} releaseUid + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.releaseUid = ""; + + /** + * RolloutNotificationEvent rollout. + * @member {string} rollout + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.rollout = ""; + + /** + * RolloutNotificationEvent type. + * @member {google.cloud.deploy.v1.Type} type + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.type = 0; + + /** + * RolloutNotificationEvent targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.targetId = ""; + + /** + * Creates a new RolloutNotificationEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IRolloutNotificationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.RolloutNotificationEvent} RolloutNotificationEvent instance + */ + RolloutNotificationEvent.create = function create(properties) { + return new RolloutNotificationEvent(properties); + }; + + /** + * Encodes the specified RolloutNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.RolloutNotificationEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IRolloutNotificationEvent} message RolloutNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutNotificationEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.pipelineUid != null && Object.hasOwnProperty.call(message, "pipelineUid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pipelineUid); + if (message.releaseUid != null && Object.hasOwnProperty.call(message, "releaseUid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.releaseUid); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.rollout); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.targetId); + return writer; + }; + + /** + * Encodes the specified RolloutNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RolloutNotificationEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IRolloutNotificationEvent} message RolloutNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RolloutNotificationEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.RolloutNotificationEvent} RolloutNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutNotificationEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.RolloutNotificationEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.pipelineUid = reader.string(); + break; + } + case 3: { + message.releaseUid = reader.string(); + break; + } + case 4: { + message.rollout = reader.string(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.targetId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RolloutNotificationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.RolloutNotificationEvent} RolloutNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RolloutNotificationEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RolloutNotificationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) + if (!$util.isString(message.pipelineUid)) + return "pipelineUid: string expected"; + if (message.releaseUid != null && message.hasOwnProperty("releaseUid")) + if (!$util.isString(message.releaseUid)) + return "releaseUid: string expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) + if (!$util.isString(message.rollout)) + return "rollout: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: string expected"; + return null; + }; + + /** + * Creates a RolloutNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.RolloutNotificationEvent} RolloutNotificationEvent + */ + RolloutNotificationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.RolloutNotificationEvent) + return object; + var message = new $root.google.cloud.deploy.v1.RolloutNotificationEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.pipelineUid != null) + message.pipelineUid = String(object.pipelineUid); + if (object.releaseUid != null) + message.releaseUid = String(object.releaseUid); + if (object.rollout != null) + message.rollout = String(object.rollout); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case 1: + message.type = 1; + break; + case "TYPE_RENDER_STATUES_CHANGE": + case 2: + message.type = 2; + break; + } + if (object.targetId != null) + message.targetId = String(object.targetId); + return message; + }; + + /** + * Creates a plain object from a RolloutNotificationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {google.cloud.deploy.v1.RolloutNotificationEvent} message RolloutNotificationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RolloutNotificationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.pipelineUid = ""; + object.releaseUid = ""; + object.rollout = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.targetId = ""; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) + object.pipelineUid = message.pipelineUid; + if (message.releaseUid != null && message.hasOwnProperty("releaseUid")) + object.releaseUid = message.releaseUid; + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = message.rollout; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] : message.type; + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + return object; + }; + + /** + * Converts this RolloutNotificationEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + * @returns {Object.} JSON object + */ + RolloutNotificationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RolloutNotificationEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RolloutNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.RolloutNotificationEvent"; + }; + + return RolloutNotificationEvent; + })(); + + v1.TargetNotificationEvent = (function() { + + /** + * Properties of a TargetNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @interface ITargetNotificationEvent + * @property {string|null} [message] TargetNotificationEvent message + * @property {string|null} [target] TargetNotificationEvent target + * @property {google.cloud.deploy.v1.Type|null} [type] TargetNotificationEvent type + */ + + /** + * Constructs a new TargetNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a TargetNotificationEvent. + * @implements ITargetNotificationEvent + * @constructor + * @param {google.cloud.deploy.v1.ITargetNotificationEvent=} [properties] Properties to set + */ + function TargetNotificationEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetNotificationEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @instance + */ + TargetNotificationEvent.prototype.message = ""; + + /** + * TargetNotificationEvent target. + * @member {string} target + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @instance + */ + TargetNotificationEvent.prototype.target = ""; + + /** + * TargetNotificationEvent type. + * @member {google.cloud.deploy.v1.Type} type + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @instance + */ + TargetNotificationEvent.prototype.type = 0; + + /** + * Creates a new TargetNotificationEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {google.cloud.deploy.v1.ITargetNotificationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.TargetNotificationEvent} TargetNotificationEvent instance + */ + TargetNotificationEvent.create = function create(properties) { + return new TargetNotificationEvent(properties); + }; + + /** + * Encodes the specified TargetNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.TargetNotificationEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {google.cloud.deploy.v1.ITargetNotificationEvent} message TargetNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetNotificationEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.target); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + return writer; + }; + + /** + * Encodes the specified TargetNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetNotificationEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {google.cloud.deploy.v1.ITargetNotificationEvent} message TargetNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetNotificationEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.TargetNotificationEvent} TargetNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetNotificationEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.TargetNotificationEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.target = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetNotificationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.TargetNotificationEvent} TargetNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetNotificationEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetNotificationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TargetNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.TargetNotificationEvent} TargetNotificationEvent + */ + TargetNotificationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.TargetNotificationEvent) + return object; + var message = new $root.google.cloud.deploy.v1.TargetNotificationEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.target != null) + message.target = String(object.target); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case 1: + message.type = 1; + break; + case "TYPE_RENDER_STATUES_CHANGE": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TargetNotificationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {google.cloud.deploy.v1.TargetNotificationEvent} message TargetNotificationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetNotificationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.target = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this TargetNotificationEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @instance + * @returns {Object.} JSON object + */ + TargetNotificationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetNotificationEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.TargetNotificationEvent"; + }; + + return TargetNotificationEvent; + })(); + + return v1; + })(); + + return deploy; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + /** + * 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) { + 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: + 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] : 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]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + 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) { + 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) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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) { + 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] : 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) { + 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) { + 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: + 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] : 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] : 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]] : 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) { + 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] : 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) { + 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] : 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.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; + })(); + + 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; + })(); + + 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; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-deploy/protos/protos.json b/packages/google-cloud-deploy/protos/protos.json new file mode 100644 index 00000000000..85547b0e1f5 --- /dev/null +++ b/packages/google-cloud-deploy/protos/protos.json @@ -0,0 +1,4142 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "deploy": { + "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy", + "java_multiple_files": true, + "java_outer_classname": "TargetNotificationPayloadProto", + "java_package": "com.google.cloud.deploy.v1", + "(google.api.resource_definition).type": "gkehub.googleapis.com/Membership", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/memberships/{membership}" + }, + "nested": { + "CloudDeploy": { + "options": { + "(google.api.default_host)": "clouddeploy.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListDeliveryPipelines": { + "requestType": "ListDeliveryPipelinesRequest", + "responseType": "ListDeliveryPipelinesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/deliveryPipelines", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/deliveryPipelines" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDeliveryPipeline": { + "requestType": "GetDeliveryPipelineRequest", + "responseType": "DeliveryPipeline", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDeliveryPipeline": { + "requestType": "CreateDeliveryPipelineRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/deliveryPipelines", + "(google.api.http).body": "delivery_pipeline", + "(google.api.method_signature)": "parent,delivery_pipeline,delivery_pipeline_id", + "(google.longrunning.operation_info).response_type": "DeliveryPipeline", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/deliveryPipelines", + "body": "delivery_pipeline" + } + }, + { + "(google.api.method_signature)": "parent,delivery_pipeline,delivery_pipeline_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeliveryPipeline", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateDeliveryPipeline": { + "requestType": "UpdateDeliveryPipelineRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{delivery_pipeline.name=projects/*/locations/*/deliveryPipelines/*}", + "(google.api.http).body": "delivery_pipeline", + "(google.api.method_signature)": "delivery_pipeline,update_mask", + "(google.longrunning.operation_info).response_type": "DeliveryPipeline", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{delivery_pipeline.name=projects/*/locations/*/deliveryPipelines/*}", + "body": "delivery_pipeline" + } + }, + { + "(google.api.method_signature)": "delivery_pipeline,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeliveryPipeline", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteDeliveryPipeline": { + "requestType": "DeleteDeliveryPipelineRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/deliveryPipelines/*}", + "(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/*/deliveryPipelines/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListTargets": { + "requestType": "ListTargetsRequest", + "responseType": "ListTargetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/targets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/targets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTarget": { + "requestType": "GetTargetRequest", + "responseType": "Target", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/targets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/targets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTarget": { + "requestType": "CreateTargetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/targets", + "(google.api.http).body": "target", + "(google.api.method_signature)": "parent,target,target_id", + "(google.longrunning.operation_info).response_type": "Target", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/targets", + "body": "target" + } + }, + { + "(google.api.method_signature)": "parent,target,target_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Target", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateTarget": { + "requestType": "UpdateTargetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{target.name=projects/*/locations/*/targets/*}", + "(google.api.http).body": "target", + "(google.api.method_signature)": "target,update_mask", + "(google.longrunning.operation_info).response_type": "Target", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{target.name=projects/*/locations/*/targets/*}", + "body": "target" + } + }, + { + "(google.api.method_signature)": "target,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Target", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteTarget": { + "requestType": "DeleteTargetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/targets/*}", + "(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/*/targets/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListReleases": { + "requestType": "ListReleasesRequest", + "responseType": "ListReleasesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetRelease": { + "requestType": "GetReleaseRequest", + "responseType": "Release", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateRelease": { + "requestType": "CreateReleaseRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases", + "(google.api.http).body": "release", + "(google.api.method_signature)": "parent,release,release_id", + "(google.longrunning.operation_info).response_type": "Release", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases", + "body": "release" + } + }, + { + "(google.api.method_signature)": "parent,release,release_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Release", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "AbandonRelease": { + "requestType": "AbandonReleaseRequest", + "responseType": "AbandonReleaseResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}:abandon", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}:abandon", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ApproveRollout": { + "requestType": "ApproveRolloutRequest", + "responseType": "ApproveRolloutResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:approve", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:approve", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListRollouts": { + "requestType": "ListRolloutsRequest", + "responseType": "ListRolloutsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetRollout": { + "requestType": "GetRolloutRequest", + "responseType": "Rollout", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateRollout": { + "requestType": "CreateRolloutRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts", + "(google.api.http).body": "rollout", + "(google.api.method_signature)": "parent,rollout,rollout_id", + "(google.longrunning.operation_info).response_type": "Rollout", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts", + "body": "rollout" + } + }, + { + "(google.api.method_signature)": "parent,rollout,rollout_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Rollout", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RetryJob": { + "requestType": "RetryJobRequest", + "responseType": "RetryJobResponse", + "options": { + "(google.api.http).post": "/v1/{rollout=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:retryJob", + "(google.api.http).body": "*", + "(google.api.method_signature)": "rollout,phase_id,job_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{rollout=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:retryJob", + "body": "*" + } + }, + { + "(google.api.method_signature)": "rollout,phase_id,job_id" + } + ] + }, + "ListJobRuns": { + "requestType": "ListJobRunsRequest", + "responseType": "ListJobRunsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}/jobRuns", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}/jobRuns" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetJobRun": { + "requestType": "GetJobRunRequest", + "responseType": "JobRun", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*/jobRuns/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*/jobRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetConfig": { + "requestType": "GetConfigRequest", + "responseType": "Config", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/config}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/config}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "DeliveryPipeline": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/DeliveryPipeline", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}" + }, + "oneofs": { + "pipeline": { + "oneof": [ + "serialPipeline" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serialPipeline": { + "type": "SerialPipeline", + "id": 8 + }, + "condition": { + "type": "PipelineCondition", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 10 + }, + "suspended": { + "type": "bool", + "id": 12 + } + } + }, + "SerialPipeline": { + "fields": { + "stages": { + "rule": "repeated", + "type": "Stage", + "id": 1 + } + } + }, + "Stage": { + "fields": { + "targetId": { + "type": "string", + "id": 1 + }, + "profiles": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "strategy": { + "type": "Strategy", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Strategy": { + "oneofs": { + "deploymentStrategy": { + "oneof": [ + "standard" + ] + } + }, + "fields": { + "standard": { + "type": "Standard", + "id": 1 + } + } + }, + "Standard": { + "fields": { + "verify": { + "type": "bool", + "id": 1 + } + } + }, + "PipelineReadyCondition": { + "fields": { + "status": { + "type": "bool", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "TargetsPresentCondition": { + "fields": { + "status": { + "type": "bool", + "id": 1 + }, + "missingTargets": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Target" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "PipelineCondition": { + "fields": { + "pipelineReadyCondition": { + "type": "PipelineReadyCondition", + "id": 1 + }, + "targetsPresentCondition": { + "type": "TargetsPresentCondition", + "id": 3 + } + } + }, + "ListDeliveryPipelinesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListDeliveryPipelinesResponse": { + "fields": { + "deliveryPipelines": { + "rule": "repeated", + "type": "DeliveryPipeline", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetDeliveryPipelineRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + } + } + }, + "CreateDeliveryPipelineRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + }, + "deliveryPipelineId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deliveryPipeline": { + "type": "DeliveryPipeline", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateDeliveryPipelineRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deliveryPipeline": { + "type": "DeliveryPipeline", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteDeliveryPipelineRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Target": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/Target", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/targets/{target}" + }, + "oneofs": { + "deploymentTarget": { + "oneof": [ + "gke", + "anthosCluster", + "run" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "targetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requireApproval": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gke": { + "type": "GkeCluster", + "id": 15 + }, + "anthosCluster": { + "type": "AnthosCluster", + "id": 17 + }, + "run": { + "type": "CloudRunLocation", + "id": 18 + }, + "etag": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "executionConfigs": { + "rule": "repeated", + "type": "ExecutionConfig", + "id": 16 + } + } + }, + "ExecutionConfig": { + "oneofs": { + "executionEnvironment": { + "oneof": [ + "defaultPool", + "privatePool" + ] + } + }, + "fields": { + "usages": { + "rule": "repeated", + "type": "ExecutionEnvironmentUsage", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "defaultPool": { + "type": "DefaultPool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "privatePool": { + "type": "PrivatePool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "workerPool": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "serviceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "artifactStorage": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "executionTimeout": { + "type": "google.protobuf.Duration", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ExecutionEnvironmentUsage": { + "values": { + "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED": 0, + "RENDER": 1, + "DEPLOY": 2, + "VERIFY": 3 + } + } + } + }, + "DefaultPool": { + "fields": { + "serviceAccount": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "artifactStorage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PrivatePool": { + "fields": { + "workerPool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "serviceAccount": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "artifactStorage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GkeCluster": { + "fields": { + "cluster": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "container.googleapis.com/Cluster" + } + }, + "internalIp": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AnthosCluster": { + "fields": { + "membership": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "gkehub.googleapis.com/Membership" + } + } + } + }, + "CloudRunLocation": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + } + } + }, + "ListTargetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "clouddeploy.googleapis.com/Target" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTargetsResponse": { + "fields": { + "targets": { + "rule": "repeated", + "type": "Target", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetTargetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Target" + } + } + } + }, + "CreateTargetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "clouddeploy.googleapis.com/Target" + } + }, + "targetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "target": { + "type": "Target", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateTargetRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "target": { + "type": "Target", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteTargetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Target" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Release": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/Release", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "abandoned": { + "type": "bool", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "renderStartTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "renderEndTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "skaffoldConfigUri": { + "type": "string", + "id": 17 + }, + "skaffoldConfigPath": { + "type": "string", + "id": 9 + }, + "buildArtifacts": { + "rule": "repeated", + "type": "BuildArtifact", + "id": 10 + }, + "deliveryPipelineSnapshot": { + "type": "DeliveryPipeline", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetSnapshots": { + "rule": "repeated", + "type": "Target", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "renderState": { + "type": "RenderState", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 16 + }, + "skaffoldVersion": { + "type": "string", + "id": 19 + }, + "targetArtifacts": { + "keyType": "string", + "type": "TargetArtifact", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetRenders": { + "keyType": "string", + "type": "TargetRender", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "RenderState": { + "values": { + "RENDER_STATE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2, + "IN_PROGRESS": 3 + } + }, + "TargetRender": { + "fields": { + "renderingBuild": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "renderingState": { + "type": "TargetRenderState", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureCause": { + "type": "FailureCause", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "TargetRenderState": { + "values": { + "TARGET_RENDER_STATE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2, + "IN_PROGRESS": 3 + } + }, + "FailureCause": { + "values": { + "FAILURE_CAUSE_UNSPECIFIED": 0, + "CLOUD_BUILD_UNAVAILABLE": 1, + "EXECUTION_FAILED": 2 + } + } + } + } + } + }, + "BuildArtifact": { + "fields": { + "image": { + "type": "string", + "id": 3 + }, + "tag": { + "type": "string", + "id": 2 + } + } + }, + "TargetArtifact": { + "oneofs": { + "uri": { + "oneof": [ + "artifactUri" + ] + } + }, + "fields": { + "artifactUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "skaffoldConfigPath": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "manifestPath": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListReleasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListReleasesResponse": { + "fields": { + "releases": { + "rule": "repeated", + "type": "Release", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetReleaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Release" + } + } + } + }, + "CreateReleaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + }, + "releaseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "release": { + "type": "Release", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Rollout": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/Rollout", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "approveTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enqueueTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deployStartTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deployEndTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetId": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "approvalState": { + "type": "ApprovalState", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureReason": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deployingBuild": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "etag": { + "type": "string", + "id": 16 + }, + "deployFailureCause": { + "type": "FailureCause", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "phases": { + "rule": "repeated", + "type": "Phase", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metadata": { + "type": "Metadata", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ApprovalState": { + "values": { + "APPROVAL_STATE_UNSPECIFIED": 0, + "NEEDS_APPROVAL": 1, + "DOES_NOT_NEED_APPROVAL": 2, + "APPROVED": 3, + "REJECTED": 4 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2, + "IN_PROGRESS": 3, + "PENDING_APPROVAL": 4, + "APPROVAL_REJECTED": 5, + "PENDING": 6, + "PENDING_RELEASE": 7 + } + }, + "FailureCause": { + "values": { + "FAILURE_CAUSE_UNSPECIFIED": 0, + "CLOUD_BUILD_UNAVAILABLE": 1, + "EXECUTION_FAILED": 2, + "DEADLINE_EXCEEDED": 3, + "RELEASE_FAILED": 4, + "RELEASE_ABANDONED": 5, + "VERIFICATION_CONFIG_NOT_FOUND": 6 + } + } + } + }, + "Metadata": { + "fields": { + "cloudRun": { + "type": "CloudRunMetadata", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DeployJobRunMetadata": { + "fields": { + "cloudRun": { + "type": "CloudRunMetadata", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CloudRunMetadata": { + "fields": { + "service": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceUrls": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revision": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Phase": { + "oneofs": { + "jobs": { + "oneof": [ + "deploymentJobs" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deploymentJobs": { + "type": "DeploymentJobs", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "IN_PROGRESS": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "ABORTED": 5 + } + } + } + }, + "DeploymentJobs": { + "fields": { + "deployJob": { + "type": "Job", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verifyJob": { + "type": "Job", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Job": { + "oneofs": { + "jobType": { + "oneof": [ + "deployJob", + "verifyJob" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "jobRun": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/JobRun" + } + }, + "deployJob": { + "type": "DeployJob", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verifyJob": { + "type": "VerifyJob", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "DISABLED": 2, + "IN_PROGRESS": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "ABORTED": 6 + } + } + } + }, + "DeployJob": { + "fields": {} + }, + "VerifyJob": { + "fields": {} + }, + "ListRolloutsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Release" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListRolloutsResponse": { + "fields": { + "rollouts": { + "rule": "repeated", + "type": "Rollout", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetRolloutRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Rollout" + } + } + } + }, + "CreateRolloutRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Release" + } + }, + "rolloutId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rollout": { + "type": "Rollout", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ApproveRolloutRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Rollout" + } + }, + "approved": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ApproveRolloutResponse": { + "fields": {} + }, + "RetryJobRequest": { + "fields": { + "rollout": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Rollout" + } + }, + "phaseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RetryJobResponse": { + "fields": {} + }, + "AbandonReleaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Release" + } + } + } + }, + "AbandonReleaseResponse": { + "fields": {} + }, + "JobRun": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/JobRun", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run}" + }, + "oneofs": { + "jobRun": { + "oneof": [ + "deployJobRun", + "verifyJobRun" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "phaseId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "jobId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deployJobRun": { + "type": "DeployJobRun", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verifyJobRun": { + "type": "VerifyJobRun", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "SUCCEEDED": 2, + "FAILED": 3 + } + } + } + }, + "DeployJobRun": { + "fields": { + "build": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "failureCause": { + "type": "FailureCause", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metadata": { + "type": "DeployJobRunMetadata", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "FailureCause": { + "values": { + "FAILURE_CAUSE_UNSPECIFIED": 0, + "CLOUD_BUILD_UNAVAILABLE": 1, + "EXECUTION_FAILED": 2, + "DEADLINE_EXCEEDED": 3 + } + } + } + }, + "VerifyJobRun": { + "fields": { + "build": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "artifactUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventLogPath": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureCause": { + "type": "FailureCause", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "FailureCause": { + "values": { + "FAILURE_CAUSE_UNSPECIFIED": 0, + "CLOUD_BUILD_UNAVAILABLE": 1, + "EXECUTION_FAILED": 2, + "DEADLINE_EXCEEDED": 3, + "VERIFICATION_CONFIG_NOT_FOUND": 4 + } + } + } + }, + "ListJobRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Rollout" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListJobRunsResponse": { + "fields": { + "jobRuns": { + "rule": "repeated", + "type": "JobRun", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetJobRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/JobRun" + } + } + } + }, + "Config": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/Config", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/config" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "supportedVersions": { + "rule": "repeated", + "type": "SkaffoldVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultSkaffoldVersion": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SkaffoldVersion": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "supportEndDate": { + "type": "google.type.Date", + "id": 2 + } + } + }, + "GetConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Config" + } + } + } + }, + "DeliveryPipelineNotificationEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "deliveryPipeline": { + "type": "string", + "id": 2 + }, + "type": { + "type": "Type", + "id": 3 + } + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "TYPE_PUBSUB_NOTIFICATION_FAILURE": 1, + "TYPE_RENDER_STATUES_CHANGE": 2 + } + }, + "JobRunNotificationEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "jobRun": { + "type": "string", + "id": 2 + }, + "pipelineUid": { + "type": "string", + "id": 3 + }, + "releaseUid": { + "type": "string", + "id": 4 + }, + "rolloutUid": { + "type": "string", + "id": 5 + }, + "targetId": { + "type": "string", + "id": 6 + }, + "type": { + "type": "Type", + "id": 7 + } + } + }, + "ReleaseNotificationEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "release": { + "type": "string", + "id": 2 + }, + "type": { + "type": "Type", + "id": 3 + } + } + }, + "ReleaseRenderEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "release": { + "type": "string", + "id": 2 + } + } + }, + "RolloutNotificationEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "pipelineUid": { + "type": "string", + "id": 2 + }, + "releaseUid": { + "type": "string", + "id": 3 + }, + "rollout": { + "type": "string", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "targetId": { + "type": "string", + "id": 6 + } + } + }, + "TargetNotificationEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "target": { + "type": "string", + "id": 2 + }, + "type": { + "type": "Type", + "id": 3 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "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 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "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 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/date;date", + "java_multiple_files": true, + "java_outer_classname": "DateProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-deploy/samples/README.md b/packages/google-cloud-deploy/samples/README.md new file mode 100644 index 00000000000..abc48423577 --- /dev/null +++ b/packages/google-cloud-deploy/samples/README.md @@ -0,0 +1,464 @@ +[//]: # "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 + +# [Google Cloud Deploy: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Cloud_deploy.abandon_release](#cloud_deploy.abandon_release) + * [Cloud_deploy.approve_rollout](#cloud_deploy.approve_rollout) + * [Cloud_deploy.create_delivery_pipeline](#cloud_deploy.create_delivery_pipeline) + * [Cloud_deploy.create_release](#cloud_deploy.create_release) + * [Cloud_deploy.create_rollout](#cloud_deploy.create_rollout) + * [Cloud_deploy.create_target](#cloud_deploy.create_target) + * [Cloud_deploy.delete_delivery_pipeline](#cloud_deploy.delete_delivery_pipeline) + * [Cloud_deploy.delete_target](#cloud_deploy.delete_target) + * [Cloud_deploy.get_config](#cloud_deploy.get_config) + * [Cloud_deploy.get_delivery_pipeline](#cloud_deploy.get_delivery_pipeline) + * [Cloud_deploy.get_job_run](#cloud_deploy.get_job_run) + * [Cloud_deploy.get_release](#cloud_deploy.get_release) + * [Cloud_deploy.get_rollout](#cloud_deploy.get_rollout) + * [Cloud_deploy.get_target](#cloud_deploy.get_target) + * [Cloud_deploy.list_delivery_pipelines](#cloud_deploy.list_delivery_pipelines) + * [Cloud_deploy.list_job_runs](#cloud_deploy.list_job_runs) + * [Cloud_deploy.list_releases](#cloud_deploy.list_releases) + * [Cloud_deploy.list_rollouts](#cloud_deploy.list_rollouts) + * [Cloud_deploy.list_targets](#cloud_deploy.list_targets) + * [Cloud_deploy.retry_job](#cloud_deploy.retry_job) + * [Cloud_deploy.update_delivery_pipeline](#cloud_deploy.update_delivery_pipeline) + * [Cloud_deploy.update_target](#cloud_deploy.update_target) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Cloud_deploy.abandon_release + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js` + + +----- + + + + +### Cloud_deploy.approve_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js` + + +----- + + + + +### Cloud_deploy.create_delivery_pipeline + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js` + + +----- + + + + +### Cloud_deploy.create_release + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js` + + +----- + + + + +### Cloud_deploy.create_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js` + + +----- + + + + +### Cloud_deploy.create_target + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js` + + +----- + + + + +### Cloud_deploy.delete_delivery_pipeline + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js` + + +----- + + + + +### Cloud_deploy.delete_target + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js` + + +----- + + + + +### Cloud_deploy.get_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js` + + +----- + + + + +### Cloud_deploy.get_delivery_pipeline + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js` + + +----- + + + + +### Cloud_deploy.get_job_run + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js` + + +----- + + + + +### Cloud_deploy.get_release + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js` + + +----- + + + + +### Cloud_deploy.get_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js` + + +----- + + + + +### Cloud_deploy.get_target + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js` + + +----- + + + + +### Cloud_deploy.list_delivery_pipelines + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js` + + +----- + + + + +### Cloud_deploy.list_job_runs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js` + + +----- + + + + +### Cloud_deploy.list_releases + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js` + + +----- + + + + +### Cloud_deploy.list_rollouts + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js` + + +----- + + + + +### Cloud_deploy.list_targets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js` + + +----- + + + + +### Cloud_deploy.retry_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js` + + +----- + + + + +### Cloud_deploy.update_delivery_pipeline + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js` + + +----- + + + + +### Cloud_deploy.update_target + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/deploy/ diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js new file mode 100644 index 00000000000..efbb667979a --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js @@ -0,0 +1,63 @@ +// 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 clouddeploy_v1_generated_CloudDeploy_AbandonRelease_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Release. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callAbandonRelease() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.abandonRelease(request); + console.log(response); + } + + callAbandonRelease(); + // [END clouddeploy_v1_generated_CloudDeploy_AbandonRelease_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js new file mode 100644 index 00000000000..e998b6c1ba3 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js @@ -0,0 +1,68 @@ +// 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, approved) { + // [START clouddeploy_v1_generated_CloudDeploy_ApproveRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + */ + // const name = 'abc123' + /** + * Required. True = approve; false = reject + */ + // const approved = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callApproveRollout() { + // Construct request + const request = { + name, + approved, + }; + + // Run request + const response = await deployClient.approveRollout(request); + console.log(response); + } + + callApproveRollout(); + // [END clouddeploy_v1_generated_CloudDeploy_ApproveRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js new file mode 100644 index 00000000000..4432b55be54 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js @@ -0,0 +1,92 @@ +// 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, deliveryPipelineId, deliveryPipeline) { + // [START clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent collection in which the `DeliveryPipeline` should be created. + * Format should be projects/{project_id}/locations/{location_name}. + */ + // const parent = 'abc123' + /** + * Required. ID of the `DeliveryPipeline`. + */ + // const deliveryPipelineId = 'abc123' + /** + * Required. The `DeliveryPipeline` to create. + */ + // const deliveryPipeline = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callCreateDeliveryPipeline() { + // Construct request + const request = { + parent, + deliveryPipelineId, + deliveryPipeline, + }; + + // Run request + const [operation] = await deployClient.createDeliveryPipeline(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateDeliveryPipeline(); + // [END clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js new file mode 100644 index 00000000000..7179e441622 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js @@ -0,0 +1,93 @@ +// 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, releaseId, release) { + // [START clouddeploy_v1_generated_CloudDeploy_CreateRelease_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent collection in which the `Release` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + */ + // const parent = 'abc123' + /** + * Required. ID of the `Release`. + */ + // const releaseId = 'abc123' + /** + * Required. The `Release` to create. + */ + // const release = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callCreateRelease() { + // Construct request + const request = { + parent, + releaseId, + release, + }; + + // Run request + const [operation] = await deployClient.createRelease(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateRelease(); + // [END clouddeploy_v1_generated_CloudDeploy_CreateRelease_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js new file mode 100644 index 00000000000..9d04a45da3a --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js @@ -0,0 +1,93 @@ +// 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, rolloutId, rollout) { + // [START clouddeploy_v1_generated_CloudDeploy_CreateRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent collection in which the `Rollout` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + */ + // const parent = 'abc123' + /** + * Required. ID of the `Rollout`. + */ + // const rolloutId = 'abc123' + /** + * Required. The `Rollout` to create. + */ + // const rollout = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callCreateRollout() { + // Construct request + const request = { + parent, + rolloutId, + rollout, + }; + + // Run request + const [operation] = await deployClient.createRollout(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateRollout(); + // [END clouddeploy_v1_generated_CloudDeploy_CreateRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js new file mode 100644 index 00000000000..7241169b91e --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js @@ -0,0 +1,93 @@ +// 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, targetId, target) { + // [START clouddeploy_v1_generated_CloudDeploy_CreateTarget_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent collection in which the `Target` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}. + */ + // const parent = 'abc123' + /** + * Required. ID of the `Target`. + */ + // const targetId = 'abc123' + /** + * Required. The `Target` to create. + */ + // const target = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callCreateTarget() { + // Construct request + const request = { + parent, + targetId, + target, + }; + + // Run request + const [operation] = await deployClient.createTarget(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTarget(); + // [END clouddeploy_v1_generated_CloudDeploy_CreateTarget_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js new file mode 100644 index 00000000000..45ee126c493 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js @@ -0,0 +1,99 @@ +// 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 clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `DeliveryPipeline` to delete. Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + */ + // const name = 'abc123' + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * `DeliveryPipeline` will succeed. + */ + // const allowMissing = true + /** + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + */ + // const validateOnly = true + /** + * Optional. If set to true, all child resources under this pipeline will also be + * deleted. Otherwise, the request will only work if the pipeline has + * no child resources. + */ + // const force = true + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callDeleteDeliveryPipeline() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await deployClient.deleteDeliveryPipeline(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDeliveryPipeline(); + // [END clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js new file mode 100644 index 00000000000..924acdecddd --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js @@ -0,0 +1,93 @@ +// 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 clouddeploy_v1_generated_CloudDeploy_DeleteTarget_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `Target` to delete. Format should be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + */ + // const name = 'abc123' + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * DeliveryPipeline will succeed. + */ + // const allowMissing = true + /** + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + */ + // const validateOnly = true + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callDeleteTarget() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await deployClient.deleteTarget(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteTarget(); + // [END clouddeploy_v1_generated_CloudDeploy_DeleteTarget_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js new file mode 100644 index 00000000000..020fa675477 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js @@ -0,0 +1,61 @@ +// 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 clouddeploy_v1_generated_CloudDeploy_GetConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 requested configuration. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getConfig(request); + console.log(response); + } + + callGetConfig(); + // [END clouddeploy_v1_generated_CloudDeploy_GetConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js new file mode 100644 index 00000000000..4446e09eb6a --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.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 clouddeploy_v1_generated_CloudDeploy_GetDeliveryPipeline_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `DeliveryPipeline`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetDeliveryPipeline() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getDeliveryPipeline(request); + console.log(response); + } + + callGetDeliveryPipeline(); + // [END clouddeploy_v1_generated_CloudDeploy_GetDeliveryPipeline_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js new file mode 100644 index 00000000000..e7e9147e027 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.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 clouddeploy_v1_generated_CloudDeploy_GetJobRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `JobRun`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetJobRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getJobRun(request); + console.log(response); + } + + callGetJobRun(); + // [END clouddeploy_v1_generated_CloudDeploy_GetJobRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js new file mode 100644 index 00000000000..4130f1f1f3d --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.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 clouddeploy_v1_generated_CloudDeploy_GetRelease_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Release`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetRelease() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getRelease(request); + console.log(response); + } + + callGetRelease(); + // [END clouddeploy_v1_generated_CloudDeploy_GetRelease_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js new file mode 100644 index 00000000000..d5e64fa2b0a --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.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 clouddeploy_v1_generated_CloudDeploy_GetRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Rollout`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetRollout() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getRollout(request); + console.log(response); + } + + callGetRollout(); + // [END clouddeploy_v1_generated_CloudDeploy_GetRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js new file mode 100644 index 00000000000..55d5e963204 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.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 clouddeploy_v1_generated_CloudDeploy_GetTarget_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Target`. Format must be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetTarget() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getTarget(request); + console.log(response); + } + + callGetTarget(); + // [END clouddeploy_v1_generated_CloudDeploy_GetTarget_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js new file mode 100644 index 00000000000..63298cdfc0e --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js @@ -0,0 +1,87 @@ +// 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 clouddeploy_v1_generated_CloudDeploy_ListDeliveryPipelines_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + */ + // const parent = 'abc123' + /** + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Filter pipelines to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callListDeliveryPipelines() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listDeliveryPipelinesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDeliveryPipelines(); + // [END clouddeploy_v1_generated_CloudDeploy_ListDeliveryPipelines_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js new file mode 100644 index 00000000000..0bc1c0a6669 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.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 clouddeploy_v1_generated_CloudDeploy_ListJobRuns_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `Rollout` which owns this collection of `JobRun` objects. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `JobRun` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `JobRun` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListJobRuns` call. Provide this + * to retrieve the subsequent page. + * When paginating, all other provided parameters match the call that provided + * the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter results to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callListJobRuns() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listJobRunsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobRuns(); + // [END clouddeploy_v1_generated_CloudDeploy_ListJobRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js new file mode 100644 index 00000000000..d635dcdad8a --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.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 clouddeploy_v1_generated_CloudDeploy_ListReleases_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter releases to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callListReleases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listReleasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListReleases(); + // [END clouddeploy_v1_generated_CloudDeploy_ListReleases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js new file mode 100644 index 00000000000..cb6dab835da --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.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 clouddeploy_v1_generated_CloudDeploy_ListRollouts_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `Release` which owns this collection of `Rollout` objects. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callListRollouts() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listRolloutsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRollouts(); + // [END clouddeploy_v1_generated_CloudDeploy_ListRollouts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js new file mode 100644 index 00000000000..34c7cf51d83 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js @@ -0,0 +1,86 @@ +// 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 clouddeploy_v1_generated_CloudDeploy_ListTargets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter targets to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callListTargets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listTargetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTargets(); + // [END clouddeploy_v1_generated_CloudDeploy_ListTargets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js new file mode 100644 index 00000000000..94725595566 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js @@ -0,0 +1,73 @@ +// 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(rollout, phaseId, jobId) { + // [START clouddeploy_v1_generated_CloudDeploy_RetryJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + */ + // const rollout = 'abc123' + /** + * Required. The phase ID the Job to retry belongs to. + */ + // const phaseId = 'abc123' + /** + * Required. The job ID for the Job to retry. + */ + // const jobId = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callRetryJob() { + // Construct request + const request = { + rollout, + phaseId, + jobId, + }; + + // Run request + const response = await deployClient.retryJob(request); + console.log(response); + } + + callRetryJob(); + // [END clouddeploy_v1_generated_CloudDeploy_RetryJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js new file mode 100644 index 00000000000..0cad66e7f56 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js @@ -0,0 +1,95 @@ +// 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(updateMask, deliveryPipeline) { + // [START clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * `DeliveryPipeline` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The `DeliveryPipeline` to update. + */ + // const deliveryPipeline = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, updating a `DeliveryPipeline` that does not exist will + * result in the creation of a new `DeliveryPipeline`. + */ + // const allowMissing = true + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callUpdateDeliveryPipeline() { + // Construct request + const request = { + updateMask, + deliveryPipeline, + }; + + // Run request + const [operation] = await deployClient.updateDeliveryPipeline(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateDeliveryPipeline(); + // [END clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js new file mode 100644 index 00000000000..aa31f9966a1 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js @@ -0,0 +1,95 @@ +// 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(updateMask, target) { + // [START clouddeploy_v1_generated_CloudDeploy_UpdateTarget_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Target resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The `Target` to update. + */ + // const target = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, updating a `Target` that does not exist will + * result in the creation of a new `Target`. + */ + // const allowMissing = true + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callUpdateTarget() { + // Construct request + const request = { + updateMask, + target, + }; + + // Run request + const [operation] = await deployClient.updateTarget(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateTarget(); + // [END clouddeploy_v1_generated_CloudDeploy_UpdateTarget_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata.google.cloud.deploy.v1.json b/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata.google.cloud.deploy.v1.json new file mode 100644 index 00000000000..98bb9f40d25 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata.google.cloud.deploy.v1.json @@ -0,0 +1,1119 @@ +{ + "clientLibrary": { + "name": "nodejs-deploy", + "version": "2.2.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.deploy.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ListDeliveryPipelines_async", + "title": "CloudDeploy listDeliveryPipelines Sample", + "origin": "API_DEFINITION", + "description": " Lists DeliveryPipelines in a given project and location.", + "canonical": true, + "file": "cloud_deploy.list_delivery_pipelines.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDeliveryPipelines", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListDeliveryPipelines", + "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.deploy.v1.ListDeliveryPipelinesResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ListDeliveryPipelines", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListDeliveryPipelines", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetDeliveryPipeline_async", + "title": "CloudDeploy getDeliveryPipeline Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single DeliveryPipeline.", + "canonical": true, + "file": "cloud_deploy.get_delivery_pipeline.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetDeliveryPipeline", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.DeliveryPipeline", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetDeliveryPipeline", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_async", + "title": "CloudDeploy createDeliveryPipeline Sample", + "origin": "API_DEFINITION", + "description": " Creates a new DeliveryPipeline in a given project and location.", + "canonical": true, + "file": "cloud_deploy.create_delivery_pipeline.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateDeliveryPipeline", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "delivery_pipeline_id", + "type": "TYPE_STRING" + }, + { + "name": "delivery_pipeline", + "type": ".google.cloud.deploy.v1.DeliveryPipeline" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "CreateDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateDeliveryPipeline", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_async", + "title": "CloudDeploy updateDeliveryPipeline Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single DeliveryPipeline.", + "canonical": true, + "file": "cloud_deploy.update_delivery_pipeline.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.UpdateDeliveryPipeline", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "delivery_pipeline", + "type": ".google.cloud.deploy.v1.DeliveryPipeline" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "UpdateDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.UpdateDeliveryPipeline", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_async", + "title": "CloudDeploy deleteDeliveryPipeline Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single DeliveryPipeline.", + "canonical": true, + "file": "cloud_deploy.delete_delivery_pipeline.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 91, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.DeleteDeliveryPipeline", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "DeleteDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.DeleteDeliveryPipeline", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ListTargets_async", + "title": "CloudDeploy listTargets Sample", + "origin": "API_DEFINITION", + "description": " Lists Targets in a given project and location.", + "canonical": true, + "file": "cloud_deploy.list_targets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTargets", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListTargets", + "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.deploy.v1.ListTargetsResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ListTargets", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListTargets", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetTarget_async", + "title": "CloudDeploy getTarget Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Target.", + "canonical": true, + "file": "cloud_deploy.get_target.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetTarget", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.Target", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetTarget", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_CreateTarget_async", + "title": "CloudDeploy createTarget Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Target in a given project and location.", + "canonical": true, + "file": "cloud_deploy.create_target.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateTarget", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "target_id", + "type": "TYPE_STRING" + }, + { + "name": "target", + "type": ".google.cloud.deploy.v1.Target" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "CreateTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateTarget", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_UpdateTarget_async", + "title": "CloudDeploy updateTarget Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Target.", + "canonical": true, + "file": "cloud_deploy.update_target.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.UpdateTarget", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "target", + "type": ".google.cloud.deploy.v1.Target" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "UpdateTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.UpdateTarget", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_DeleteTarget_async", + "title": "CloudDeploy deleteTarget Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Target.", + "canonical": true, + "file": "cloud_deploy.delete_target.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.DeleteTarget", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "DeleteTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.DeleteTarget", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ListReleases_async", + "title": "CloudDeploy listReleases Sample", + "origin": "API_DEFINITION", + "description": " Lists Releases in a given project and location.", + "canonical": true, + "file": "cloud_deploy.list_releases.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListReleases", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListReleases", + "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.deploy.v1.ListReleasesResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ListReleases", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListReleases", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetRelease_async", + "title": "CloudDeploy getRelease Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Release.", + "canonical": true, + "file": "cloud_deploy.get_release.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetRelease", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.Release", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetRelease", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_CreateRelease_async", + "title": "CloudDeploy createRelease Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Release in a given project and location.", + "canonical": true, + "file": "cloud_deploy.create_release.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateRelease", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "release_id", + "type": "TYPE_STRING" + }, + { + "name": "release", + "type": ".google.cloud.deploy.v1.Release" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "CreateRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateRelease", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_AbandonRelease_async", + "title": "CloudDeploy abandonRelease Sample", + "origin": "API_DEFINITION", + "description": " Abandons a Release in the Delivery Pipeline.", + "canonical": true, + "file": "cloud_deploy.abandon_release.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AbandonRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.AbandonRelease", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.AbandonReleaseResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "AbandonRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.AbandonRelease", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ApproveRollout_async", + "title": "CloudDeploy approveRollout Sample", + "origin": "API_DEFINITION", + "description": " Approves a Rollout.", + "canonical": true, + "file": "cloud_deploy.approve_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApproveRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ApproveRollout", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "approved", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.deploy.v1.ApproveRolloutResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ApproveRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ApproveRollout", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ListRollouts_async", + "title": "CloudDeploy listRollouts Sample", + "origin": "API_DEFINITION", + "description": " Lists Rollouts in a given project and location.", + "canonical": true, + "file": "cloud_deploy.list_rollouts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRollouts", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListRollouts", + "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.deploy.v1.ListRolloutsResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ListRollouts", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListRollouts", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetRollout_async", + "title": "CloudDeploy getRollout Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Rollout.", + "canonical": true, + "file": "cloud_deploy.get_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetRollout", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.Rollout", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetRollout", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_CreateRollout_async", + "title": "CloudDeploy createRollout Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Rollout in a given project and location.", + "canonical": true, + "file": "cloud_deploy.create_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateRollout", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "rollout_id", + "type": "TYPE_STRING" + }, + { + "name": "rollout", + "type": ".google.cloud.deploy.v1.Rollout" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "CreateRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateRollout", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_RetryJob_async", + "title": "CloudDeploy retryJob Sample", + "origin": "API_DEFINITION", + "description": " Retries the specified Job in a Rollout.", + "canonical": true, + "file": "cloud_deploy.retry_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetryJob", + "fullName": "google.cloud.deploy.v1.CloudDeploy.RetryJob", + "async": true, + "parameters": [ + { + "name": "rollout", + "type": "TYPE_STRING" + }, + { + "name": "phase_id", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.RetryJobResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "RetryJob", + "fullName": "google.cloud.deploy.v1.CloudDeploy.RetryJob", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ListJobRuns_async", + "title": "CloudDeploy listJobRuns Sample", + "origin": "API_DEFINITION", + "description": " Lists JobRuns in a given project and location.", + "canonical": true, + "file": "cloud_deploy.list_job_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobRuns", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListJobRuns", + "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.deploy.v1.ListJobRunsResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ListJobRuns", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListJobRuns", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetJobRun_async", + "title": "CloudDeploy getJobRun Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single JobRun.", + "canonical": true, + "file": "cloud_deploy.get_job_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJobRun", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetJobRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.JobRun", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetJobRun", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetJobRun", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetConfig_async", + "title": "CloudDeploy getConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets the configuration for a location.", + "canonical": true, + "file": "cloud_deploy.get_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConfig", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.Config", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetConfig", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetConfig", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-deploy/samples/package.json b/packages/google-cloud-deploy/samples/package.json new file mode 100644 index 00000000000..ce386e55197 --- /dev/null +++ b/packages/google-cloud-deploy/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-deploy", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/deploy": "^2.2.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^9.0.0" + } +} diff --git a/packages/google-cloud-deploy/samples/quickstart.js b/packages/google-cloud-deploy/samples/quickstart.js new file mode 100644 index 00000000000..62c40ac106e --- /dev/null +++ b/packages/google-cloud-deploy/samples/quickstart.js @@ -0,0 +1,78 @@ +// 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. + +'use strict'; + +function main(parent) { + // [START clouddeploy_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + */ + // const parent = 'abc123' + /** + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function listDeliveryPipelines() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listDeliveryPipelinesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listDeliveryPipelines(); + // [END clouddeploy_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/test/quickstart.js b/packages/google-cloud-deploy/samples/test/quickstart.js new file mode 100644 index 00000000000..3c783c46cc2 --- /dev/null +++ b/packages/google-cloud-deploy/samples/test/quickstart.js @@ -0,0 +1,48 @@ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file 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 {CloudDeployClient} = require('@google-cloud/deploy'); +// 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 CloudDeployClient(); + +describe('Quickstart', () => { + 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-deploy/src/index.ts b/packages/google-cloud-deploy/src/index.ts new file mode 100644 index 00000000000..50fdb29ebeb --- /dev/null +++ b/packages/google-cloud-deploy/src/index.ts @@ -0,0 +1,27 @@ +// 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const CloudDeployClient = v1.CloudDeployClient; +type CloudDeployClient = v1.CloudDeployClient; + +export {v1, CloudDeployClient}; +export default {v1, CloudDeployClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts b/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts new file mode 100644 index 00000000000..581b14d6c4f --- /dev/null +++ b/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts @@ -0,0 +1,4848 @@ +// 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, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/cloud_deploy_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_deploy_client_config.json'; +const version = require('../../../package.json').version; + +/** + * CloudDeploy service creates and manages Continuous Delivery operations + * on Google Cloud Platform via Skaffold (https://skaffold.dev). + * @class + * @memberof v1 + */ +export class CloudDeployClient { + 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + cloudDeployStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudDeployClient. + * + * @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 CloudDeployClient({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 CloudDeployClient; + 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== '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 = { + buildPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/builds/{build}' + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}' + ), + configPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/config' + ), + deliveryPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}' + ), + jobRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + membershipPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/memberships/{membership}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + releasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}' + ), + rolloutPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}' + ), + targetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/targets/{target}' + ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listDeliveryPipelines: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'deliveryPipelines' + ), + listTargets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'targets' + ), + listReleases: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'releases' + ), + listRollouts: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'rollouts' + ), + listJobRuns: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobRuns' + ), + }; + + 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/*/deliveryPipelines/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/targets/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/deliveryPipelines/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/targets/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/deliveryPipelines/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/targets/*}: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 createDeliveryPipelineResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.DeliveryPipeline' + ) as gax.protobuf.Type; + const createDeliveryPipelineMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateDeliveryPipelineResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.DeliveryPipeline' + ) as gax.protobuf.Type; + const updateDeliveryPipelineMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteDeliveryPipelineResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteDeliveryPipelineMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createTargetResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.Target' + ) as gax.protobuf.Type; + const createTargetMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateTargetResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.Target' + ) as gax.protobuf.Type; + const updateTargetMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteTargetResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteTargetMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createReleaseResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.Release' + ) as gax.protobuf.Type; + const createReleaseMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createRolloutResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.Rollout' + ) as gax.protobuf.Type; + const createRolloutMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createDeliveryPipeline: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDeliveryPipelineResponse.decode.bind( + createDeliveryPipelineResponse + ), + createDeliveryPipelineMetadata.decode.bind( + createDeliveryPipelineMetadata + ) + ), + updateDeliveryPipeline: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDeliveryPipelineResponse.decode.bind( + updateDeliveryPipelineResponse + ), + updateDeliveryPipelineMetadata.decode.bind( + updateDeliveryPipelineMetadata + ) + ), + deleteDeliveryPipeline: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDeliveryPipelineResponse.decode.bind( + deleteDeliveryPipelineResponse + ), + deleteDeliveryPipelineMetadata.decode.bind( + deleteDeliveryPipelineMetadata + ) + ), + createTarget: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTargetResponse.decode.bind(createTargetResponse), + createTargetMetadata.decode.bind(createTargetMetadata) + ), + updateTarget: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTargetResponse.decode.bind(updateTargetResponse), + updateTargetMetadata.decode.bind(updateTargetMetadata) + ), + deleteTarget: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTargetResponse.decode.bind(deleteTargetResponse), + deleteTargetMetadata.decode.bind(deleteTargetMetadata) + ), + createRelease: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createReleaseResponse.decode.bind(createReleaseResponse), + createReleaseMetadata.decode.bind(createReleaseMetadata) + ), + createRollout: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createRolloutResponse.decode.bind(createRolloutResponse), + createRolloutMetadata.decode.bind(createRolloutMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.deploy.v1.CloudDeploy', + 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.cloudDeployStub) { + return this.cloudDeployStub; + } + + // Put together the "service stub" for + // google.cloud.deploy.v1.CloudDeploy. + this.cloudDeployStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.deploy.v1.CloudDeploy' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.deploy.v1.CloudDeploy, + 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 cloudDeployStubMethods = [ + 'listDeliveryPipelines', + 'getDeliveryPipeline', + 'createDeliveryPipeline', + 'updateDeliveryPipeline', + 'deleteDeliveryPipeline', + 'listTargets', + 'getTarget', + 'createTarget', + 'updateTarget', + 'deleteTarget', + 'listReleases', + 'getRelease', + 'createRelease', + 'abandonRelease', + 'approveRollout', + 'listRollouts', + 'getRollout', + 'createRollout', + 'retryJob', + 'listJobRuns', + 'getJobRun', + 'getConfig', + ]; + for (const methodName of cloudDeployStubMethods) { + const callPromise = this.cloudDeployStub.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.cloudDeployStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'clouddeploy.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 'clouddeploy.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 -- + // ------------------- + /** + * Gets details of a single DeliveryPipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `DeliveryPipeline`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DeliveryPipeline]{@link google.cloud.deploy.v1.DeliveryPipeline}. + * 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/cloud_deploy.get_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetDeliveryPipeline_async + */ + getDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest | undefined, + {} | undefined + ] + >; + getDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + | protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + | protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + | protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + | protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.getDeliveryPipeline(request, options, callback); + } + /** + * Gets details of a single Target. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `Target`. Format must be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Target]{@link google.cloud.deploy.v1.Target}. + * 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/cloud_deploy.get_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetTarget_async + */ + getTarget( + request?: protos.google.cloud.deploy.v1.IGetTargetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | undefined, + {} | undefined + ] + >; + getTarget( + request: protos.google.cloud.deploy.v1.IGetTargetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | null | undefined, + {} | null | undefined + > + ): void; + getTarget( + request: protos.google.cloud.deploy.v1.IGetTargetRequest, + callback: Callback< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | null | undefined, + {} | null | undefined + > + ): void; + getTarget( + request?: protos.google.cloud.deploy.v1.IGetTargetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.getTarget(request, options, callback); + } + /** + * Gets details of a single Release. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `Release`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Release]{@link google.cloud.deploy.v1.Release}. + * 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/cloud_deploy.get_release.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetRelease_async + */ + getRelease( + request?: protos.google.cloud.deploy.v1.IGetReleaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | undefined, + {} | undefined + ] + >; + getRelease( + request: protos.google.cloud.deploy.v1.IGetReleaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | null | undefined, + {} | null | undefined + > + ): void; + getRelease( + request: protos.google.cloud.deploy.v1.IGetReleaseRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | null | undefined, + {} | null | undefined + > + ): void; + getRelease( + request?: protos.google.cloud.deploy.v1.IGetReleaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.getRelease(request, options, callback); + } + /** + * Abandons a Release in the Delivery Pipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the Release. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AbandonReleaseResponse]{@link google.cloud.deploy.v1.AbandonReleaseResponse}. + * 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/cloud_deploy.abandon_release.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_AbandonRelease_async + */ + abandonRelease( + request?: protos.google.cloud.deploy.v1.IAbandonReleaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + protos.google.cloud.deploy.v1.IAbandonReleaseRequest | undefined, + {} | undefined + ] + >; + abandonRelease( + request: protos.google.cloud.deploy.v1.IAbandonReleaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + protos.google.cloud.deploy.v1.IAbandonReleaseRequest | null | undefined, + {} | null | undefined + > + ): void; + abandonRelease( + request: protos.google.cloud.deploy.v1.IAbandonReleaseRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + protos.google.cloud.deploy.v1.IAbandonReleaseRequest | null | undefined, + {} | null | undefined + > + ): void; + abandonRelease( + request?: protos.google.cloud.deploy.v1.IAbandonReleaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + | protos.google.cloud.deploy.v1.IAbandonReleaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + protos.google.cloud.deploy.v1.IAbandonReleaseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + protos.google.cloud.deploy.v1.IAbandonReleaseRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.abandonRelease(request, options, callback); + } + /** + * Approves a Rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * @param {boolean} request.approved + * Required. True = approve; false = reject + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ApproveRolloutResponse]{@link google.cloud.deploy.v1.ApproveRolloutResponse}. + * 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/cloud_deploy.approve_rollout.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ApproveRollout_async + */ + approveRollout( + request?: protos.google.cloud.deploy.v1.IApproveRolloutRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + protos.google.cloud.deploy.v1.IApproveRolloutRequest | undefined, + {} | undefined + ] + >; + approveRollout( + request: protos.google.cloud.deploy.v1.IApproveRolloutRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + protos.google.cloud.deploy.v1.IApproveRolloutRequest | null | undefined, + {} | null | undefined + > + ): void; + approveRollout( + request: protos.google.cloud.deploy.v1.IApproveRolloutRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + protos.google.cloud.deploy.v1.IApproveRolloutRequest | null | undefined, + {} | null | undefined + > + ): void; + approveRollout( + request?: protos.google.cloud.deploy.v1.IApproveRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + | protos.google.cloud.deploy.v1.IApproveRolloutRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + protos.google.cloud.deploy.v1.IApproveRolloutRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + protos.google.cloud.deploy.v1.IApproveRolloutRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.approveRollout(request, options, callback); + } + /** + * Gets details of a single Rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `Rollout`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Rollout]{@link google.cloud.deploy.v1.Rollout}. + * 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/cloud_deploy.get_rollout.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetRollout_async + */ + getRollout( + request?: protos.google.cloud.deploy.v1.IGetRolloutRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | undefined, + {} | undefined + ] + >; + getRollout( + request: protos.google.cloud.deploy.v1.IGetRolloutRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | null | undefined, + {} | null | undefined + > + ): void; + getRollout( + request: protos.google.cloud.deploy.v1.IGetRolloutRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | null | undefined, + {} | null | undefined + > + ): void; + getRollout( + request?: protos.google.cloud.deploy.v1.IGetRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.getRollout(request, options, callback); + } + /** + * Retries the specified Job in a Rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.rollout + * Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * @param {string} request.phaseId + * Required. The phase ID the Job to retry belongs to. + * @param {string} request.jobId + * Required. The job ID for the Job to retry. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RetryJobResponse]{@link google.cloud.deploy.v1.RetryJobResponse}. + * 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/cloud_deploy.retry_job.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_RetryJob_async + */ + retryJob( + request?: protos.google.cloud.deploy.v1.IRetryJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | undefined, + {} | undefined + ] + >; + retryJob( + request: protos.google.cloud.deploy.v1.IRetryJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | null | undefined, + {} | null | undefined + > + ): void; + retryJob( + request: protos.google.cloud.deploy.v1.IRetryJobRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | null | undefined, + {} | null | undefined + > + ): void; + retryJob( + request?: protos.google.cloud.deploy.v1.IRetryJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + rollout: request.rollout ?? '', + }); + this.initialize(); + return this.innerApiCalls.retryJob(request, options, callback); + } + /** + * Gets details of a single JobRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `JobRun`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [JobRun]{@link google.cloud.deploy.v1.JobRun}. + * 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/cloud_deploy.get_job_run.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetJobRun_async + */ + getJobRun( + request?: protos.google.cloud.deploy.v1.IGetJobRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | undefined, + {} | undefined + ] + >; + getJobRun( + request: protos.google.cloud.deploy.v1.IGetJobRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | null | undefined, + {} | null | undefined + > + ): void; + getJobRun( + request: protos.google.cloud.deploy.v1.IGetJobRunRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | null | undefined, + {} | null | undefined + > + ): void; + getJobRun( + request?: protos.google.cloud.deploy.v1.IGetJobRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.getJobRun(request, options, callback); + } + /** + * Gets the configuration for a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of requested configuration. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Config]{@link google.cloud.deploy.v1.Config}. + * 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/cloud_deploy.get_config.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetConfig_async + */ + getConfig( + request?: protos.google.cloud.deploy.v1.IGetConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | undefined, + {} | undefined + ] + >; + getConfig( + request: protos.google.cloud.deploy.v1.IGetConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | null | undefined, + {} | null | undefined + > + ): void; + getConfig( + request: protos.google.cloud.deploy.v1.IGetConfigRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | null | undefined, + {} | null | undefined + > + ): void; + getConfig( + request?: protos.google.cloud.deploy.v1.IGetConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.getConfig(request, options, callback); + } + + /** + * Creates a new DeliveryPipeline in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent collection in which the `DeliveryPipeline` should be created. + * Format should be projects/{project_id}/locations/{location_name}. + * @param {string} request.deliveryPipelineId + * Required. ID of the `DeliveryPipeline`. + * @param {google.cloud.deploy.v1.DeliveryPipeline} request.deliveryPipeline + * Required. The `DeliveryPipeline` to create. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_deploy.create_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_async + */ + createDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createDeliveryPipeline( + request: protos.google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDeliveryPipeline( + request: protos.google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.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.createDeliveryPipeline( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createDeliveryPipeline()`. + * @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/cloud_deploy.create_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_async + */ + async checkCreateDeliveryPipelineProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.DeliveryPipeline, + protos.google.cloud.deploy.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.createDeliveryPipeline, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.DeliveryPipeline, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single DeliveryPipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * `DeliveryPipeline` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.deploy.v1.DeliveryPipeline} request.deliveryPipeline + * Required. The `DeliveryPipeline` to update. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. If set to true, updating a `DeliveryPipeline` that does not exist will + * result in the creation of a new `DeliveryPipeline`. + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_deploy.update_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_async + */ + updateDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.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({ + 'delivery_pipeline.name': request.deliveryPipeline!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDeliveryPipeline( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateDeliveryPipeline()`. + * @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/cloud_deploy.update_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_async + */ + async checkUpdateDeliveryPipelineProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.DeliveryPipeline, + protos.google.cloud.deploy.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.updateDeliveryPipeline, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.DeliveryPipeline, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Deletes a single DeliveryPipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `DeliveryPipeline` to delete. Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. If set to true, then deleting an already deleted or non-existing + * `DeliveryPipeline` will succeed. + * @param {boolean} [request.validateOnly] + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * @param {boolean} [request.force] + * Optional. If set to true, all child resources under this pipeline will also be + * deleted. Otherwise, the request will only work if the pipeline has + * no child resources. + * @param {string} [request.etag] + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_deploy.delete_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_async + */ + deleteDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.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.deleteDeliveryPipeline( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteDeliveryPipeline()`. + * @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/cloud_deploy.delete_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_async + */ + async checkDeleteDeliveryPipelineProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.deploy.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.deleteDeliveryPipeline, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Creates a new Target in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent collection in which the `Target` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}. + * @param {string} request.targetId + * Required. ID of the `Target`. + * @param {google.cloud.deploy.v1.Target} request.target + * Required. The `Target` to create. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_deploy.create_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateTarget_async + */ + createTarget( + request?: protos.google.cloud.deploy.v1.ICreateTargetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createTarget( + request: protos.google.cloud.deploy.v1.ICreateTargetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTarget( + request: protos.google.cloud.deploy.v1.ICreateTargetRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTarget( + request?: protos.google.cloud.deploy.v1.ICreateTargetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.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.createTarget(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createTarget()`. + * @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/cloud_deploy.create_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateTarget_async + */ + async checkCreateTargetProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.Target, + protos.google.cloud.deploy.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.createTarget, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.Target, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Target. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Target resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.deploy.v1.Target} request.target + * Required. The `Target` to update. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. If set to true, updating a `Target` that does not exist will + * result in the creation of a new `Target`. + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_deploy.update_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateTarget_async + */ + updateTarget( + request?: protos.google.cloud.deploy.v1.IUpdateTargetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateTarget( + request: protos.google.cloud.deploy.v1.IUpdateTargetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTarget( + request: protos.google.cloud.deploy.v1.IUpdateTargetRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTarget( + request?: protos.google.cloud.deploy.v1.IUpdateTargetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.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({ + 'target.name': request.target!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTarget(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateTarget()`. + * @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/cloud_deploy.update_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateTarget_async + */ + async checkUpdateTargetProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.Target, + protos.google.cloud.deploy.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.updateTarget, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.Target, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Deletes a single Target. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `Target` to delete. Format should be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. If set to true, then deleting an already deleted or non-existing + * DeliveryPipeline will succeed. + * @param {boolean} [request.validateOnly] + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * @param {string} [request.etag] + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_deploy.delete_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteTarget_async + */ + deleteTarget( + request?: protos.google.cloud.deploy.v1.IDeleteTargetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteTarget( + request: protos.google.cloud.deploy.v1.IDeleteTargetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTarget( + request: protos.google.cloud.deploy.v1.IDeleteTargetRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTarget( + request?: protos.google.cloud.deploy.v1.IDeleteTargetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.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.deleteTarget(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteTarget()`. + * @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/cloud_deploy.delete_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteTarget_async + */ + async checkDeleteTargetProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.deploy.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.deleteTarget, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Creates a new Release in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent collection in which the `Release` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @param {string} request.releaseId + * Required. ID of the `Release`. + * @param {google.cloud.deploy.v1.Release} request.release + * Required. The `Release` to create. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_deploy.create_release.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRelease_async + */ + createRelease( + request?: protos.google.cloud.deploy.v1.ICreateReleaseRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createRelease( + request: protos.google.cloud.deploy.v1.ICreateReleaseRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRelease( + request: protos.google.cloud.deploy.v1.ICreateReleaseRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRelease( + request?: protos.google.cloud.deploy.v1.ICreateReleaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.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.createRelease(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createRelease()`. + * @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/cloud_deploy.create_release.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRelease_async + */ + async checkCreateReleaseProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.Release, + protos.google.cloud.deploy.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.createRelease, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.Release, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Creates a new Rollout in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent collection in which the `Rollout` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * @param {string} request.rolloutId + * Required. ID of the `Rollout`. + * @param {google.cloud.deploy.v1.Rollout} request.rollout + * Required. The `Rollout` to create. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_deploy.create_rollout.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRollout_async + */ + createRollout( + request?: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createRollout( + request: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRollout( + request: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRollout( + request?: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.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.createRollout(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createRollout()`. + * @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/cloud_deploy.create_rollout.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRollout_async + */ + async checkCreateRolloutProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.Rollout, + protos.google.cloud.deploy.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.createRollout, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.Rollout, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Lists DeliveryPipelines in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} request.pageSize + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} request.filter + * Filter pipelines to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} request.orderBy + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DeliveryPipeline]{@link google.cloud.deploy.v1.DeliveryPipeline}. + * 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 `listDeliveryPipelinesAsync()` + * 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. + */ + listDeliveryPipelines( + request?: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeliveryPipeline[], + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest | null, + protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + ] + >; + listDeliveryPipelines( + request: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + | protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeliveryPipeline + > + ): void; + listDeliveryPipelines( + request: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + | protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeliveryPipeline + > + ): void; + listDeliveryPipelines( + request?: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + | protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeliveryPipeline + >, + callback?: PaginationCallback< + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + | protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeliveryPipeline + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeliveryPipeline[], + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest | null, + protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listDeliveryPipelines(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 parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} request.pageSize + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} request.filter + * Filter pipelines to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} request.orderBy + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DeliveryPipeline]{@link google.cloud.deploy.v1.DeliveryPipeline} 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 `listDeliveryPipelinesAsync()` + * 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. + */ + listDeliveryPipelinesStream( + request?: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + 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['listDeliveryPipelines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeliveryPipelines.createStream( + this.innerApiCalls.listDeliveryPipelines as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDeliveryPipelines`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} request.pageSize + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} request.filter + * Filter pipelines to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} request.orderBy + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [DeliveryPipeline]{@link google.cloud.deploy.v1.DeliveryPipeline}. 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/cloud_deploy.list_delivery_pipelines.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ListDeliveryPipelines_async + */ + listDeliveryPipelinesAsync( + request?: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + 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['listDeliveryPipelines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeliveryPipelines.asyncIterate( + this.innerApiCalls['listDeliveryPipelines'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Targets in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter targets to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Target]{@link google.cloud.deploy.v1.Target}. + * 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 `listTargetsAsync()` + * 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. + */ + listTargets( + request?: protos.google.cloud.deploy.v1.IListTargetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.ITarget[], + protos.google.cloud.deploy.v1.IListTargetsRequest | null, + protos.google.cloud.deploy.v1.IListTargetsResponse + ] + >; + listTargets( + request: protos.google.cloud.deploy.v1.IListTargetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListTargetsRequest, + protos.google.cloud.deploy.v1.IListTargetsResponse | null | undefined, + protos.google.cloud.deploy.v1.ITarget + > + ): void; + listTargets( + request: protos.google.cloud.deploy.v1.IListTargetsRequest, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListTargetsRequest, + protos.google.cloud.deploy.v1.IListTargetsResponse | null | undefined, + protos.google.cloud.deploy.v1.ITarget + > + ): void; + listTargets( + request?: protos.google.cloud.deploy.v1.IListTargetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.deploy.v1.IListTargetsRequest, + protos.google.cloud.deploy.v1.IListTargetsResponse | null | undefined, + protos.google.cloud.deploy.v1.ITarget + >, + callback?: PaginationCallback< + protos.google.cloud.deploy.v1.IListTargetsRequest, + protos.google.cloud.deploy.v1.IListTargetsResponse | null | undefined, + protos.google.cloud.deploy.v1.ITarget + > + ): Promise< + [ + protos.google.cloud.deploy.v1.ITarget[], + protos.google.cloud.deploy.v1.IListTargetsRequest | null, + protos.google.cloud.deploy.v1.IListTargetsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listTargets(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 parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter targets to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Target]{@link google.cloud.deploy.v1.Target} 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 `listTargetsAsync()` + * 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. + */ + listTargetsStream( + request?: protos.google.cloud.deploy.v1.IListTargetsRequest, + 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['listTargets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTargets.createStream( + this.innerApiCalls.listTargets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTargets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter targets to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [Target]{@link google.cloud.deploy.v1.Target}. 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/cloud_deploy.list_targets.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ListTargets_async + */ + listTargetsAsync( + request?: protos.google.cloud.deploy.v1.IListTargetsRequest, + 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['listTargets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTargets.asyncIterate( + this.innerApiCalls['listTargets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Releases in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter releases to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Release]{@link google.cloud.deploy.v1.Release}. + * 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 `listReleasesAsync()` + * 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. + */ + listReleases( + request?: protos.google.cloud.deploy.v1.IListReleasesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IRelease[], + protos.google.cloud.deploy.v1.IListReleasesRequest | null, + protos.google.cloud.deploy.v1.IListReleasesResponse + ] + >; + listReleases( + request: protos.google.cloud.deploy.v1.IListReleasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListReleasesRequest, + protos.google.cloud.deploy.v1.IListReleasesResponse | null | undefined, + protos.google.cloud.deploy.v1.IRelease + > + ): void; + listReleases( + request: protos.google.cloud.deploy.v1.IListReleasesRequest, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListReleasesRequest, + protos.google.cloud.deploy.v1.IListReleasesResponse | null | undefined, + protos.google.cloud.deploy.v1.IRelease + > + ): void; + listReleases( + request?: protos.google.cloud.deploy.v1.IListReleasesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.deploy.v1.IListReleasesRequest, + | protos.google.cloud.deploy.v1.IListReleasesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IRelease + >, + callback?: PaginationCallback< + protos.google.cloud.deploy.v1.IListReleasesRequest, + protos.google.cloud.deploy.v1.IListReleasesResponse | null | undefined, + protos.google.cloud.deploy.v1.IRelease + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IRelease[], + protos.google.cloud.deploy.v1.IListReleasesRequest | null, + protos.google.cloud.deploy.v1.IListReleasesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listReleases(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 `DeliveryPipeline` which owns this collection of `Release` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter releases to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Release]{@link google.cloud.deploy.v1.Release} 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 `listReleasesAsync()` + * 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. + */ + listReleasesStream( + request?: protos.google.cloud.deploy.v1.IListReleasesRequest, + 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['listReleases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReleases.createStream( + this.innerApiCalls.listReleases as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listReleases`, 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 `DeliveryPipeline` which owns this collection of `Release` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter releases to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [Release]{@link google.cloud.deploy.v1.Release}. 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/cloud_deploy.list_releases.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ListReleases_async + */ + listReleasesAsync( + request?: protos.google.cloud.deploy.v1.IListReleasesRequest, + 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['listReleases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReleases.asyncIterate( + this.innerApiCalls['listReleases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Rollouts in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The `Release` which owns this collection of `Rollout` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Rollout]{@link google.cloud.deploy.v1.Rollout}. + * 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 `listRolloutsAsync()` + * 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. + */ + listRollouts( + request?: protos.google.cloud.deploy.v1.IListRolloutsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IRollout[], + protos.google.cloud.deploy.v1.IListRolloutsRequest | null, + protos.google.cloud.deploy.v1.IListRolloutsResponse + ] + >; + listRollouts( + request: protos.google.cloud.deploy.v1.IListRolloutsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListRolloutsRequest, + protos.google.cloud.deploy.v1.IListRolloutsResponse | null | undefined, + protos.google.cloud.deploy.v1.IRollout + > + ): void; + listRollouts( + request: protos.google.cloud.deploy.v1.IListRolloutsRequest, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListRolloutsRequest, + protos.google.cloud.deploy.v1.IListRolloutsResponse | null | undefined, + protos.google.cloud.deploy.v1.IRollout + > + ): void; + listRollouts( + request?: protos.google.cloud.deploy.v1.IListRolloutsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.deploy.v1.IListRolloutsRequest, + | protos.google.cloud.deploy.v1.IListRolloutsResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IRollout + >, + callback?: PaginationCallback< + protos.google.cloud.deploy.v1.IListRolloutsRequest, + protos.google.cloud.deploy.v1.IListRolloutsResponse | null | undefined, + protos.google.cloud.deploy.v1.IRollout + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IRollout[], + protos.google.cloud.deploy.v1.IListRolloutsRequest | null, + protos.google.cloud.deploy.v1.IListRolloutsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listRollouts(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 `Release` which owns this collection of `Rollout` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Rollout]{@link google.cloud.deploy.v1.Rollout} 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 `listRolloutsAsync()` + * 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. + */ + listRolloutsStream( + request?: protos.google.cloud.deploy.v1.IListRolloutsRequest, + 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['listRollouts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRollouts.createStream( + this.innerApiCalls.listRollouts as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRollouts`, 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 `Release` which owns this collection of `Rollout` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [Rollout]{@link google.cloud.deploy.v1.Rollout}. 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/cloud_deploy.list_rollouts.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ListRollouts_async + */ + listRolloutsAsync( + request?: protos.google.cloud.deploy.v1.IListRolloutsRequest, + 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['listRollouts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRollouts.asyncIterate( + this.innerApiCalls['listRollouts'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists JobRuns in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The `Rollout` which owns this collection of `JobRun` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `JobRun` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `JobRun` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListJobRuns` call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other provided parameters match the call that provided + * the page token. + * @param {string} [request.filter] + * Optional. Filter results to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [JobRun]{@link google.cloud.deploy.v1.JobRun}. + * 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 `listJobRunsAsync()` + * 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. + */ + listJobRuns( + request?: protos.google.cloud.deploy.v1.IListJobRunsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IJobRun[], + protos.google.cloud.deploy.v1.IListJobRunsRequest | null, + protos.google.cloud.deploy.v1.IListJobRunsResponse + ] + >; + listJobRuns( + request: protos.google.cloud.deploy.v1.IListJobRunsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListJobRunsRequest, + protos.google.cloud.deploy.v1.IListJobRunsResponse | null | undefined, + protos.google.cloud.deploy.v1.IJobRun + > + ): void; + listJobRuns( + request: protos.google.cloud.deploy.v1.IListJobRunsRequest, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListJobRunsRequest, + protos.google.cloud.deploy.v1.IListJobRunsResponse | null | undefined, + protos.google.cloud.deploy.v1.IJobRun + > + ): void; + listJobRuns( + request?: protos.google.cloud.deploy.v1.IListJobRunsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.deploy.v1.IListJobRunsRequest, + protos.google.cloud.deploy.v1.IListJobRunsResponse | null | undefined, + protos.google.cloud.deploy.v1.IJobRun + >, + callback?: PaginationCallback< + protos.google.cloud.deploy.v1.IListJobRunsRequest, + protos.google.cloud.deploy.v1.IListJobRunsResponse | null | undefined, + protos.google.cloud.deploy.v1.IJobRun + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IJobRun[], + protos.google.cloud.deploy.v1.IListJobRunsRequest | null, + protos.google.cloud.deploy.v1.IListJobRunsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listJobRuns(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 `Rollout` which owns this collection of `JobRun` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `JobRun` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `JobRun` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListJobRuns` call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other provided parameters match the call that provided + * the page token. + * @param {string} [request.filter] + * Optional. Filter results to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [JobRun]{@link google.cloud.deploy.v1.JobRun} 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 `listJobRunsAsync()` + * 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. + */ + listJobRunsStream( + request?: protos.google.cloud.deploy.v1.IListJobRunsRequest, + 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['listJobRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobRuns.createStream( + this.innerApiCalls.listJobRuns as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listJobRuns`, 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 `Rollout` which owns this collection of `JobRun` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `JobRun` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `JobRun` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListJobRuns` call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other provided parameters match the call that provided + * the page token. + * @param {string} [request.filter] + * Optional. Filter results to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [JobRun]{@link google.cloud.deploy.v1.JobRun}. 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/cloud_deploy.list_job_runs.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ListJobRuns_async + */ + listJobRunsAsync( + request?: protos.google.cloud.deploy.v1.IListJobRunsRequest, + 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['listJobRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobRuns.asyncIterate( + this.innerApiCalls['listJobRuns'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified build resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} build + * @returns {string} Resource name string. + */ + buildPath(project: string, location: string, build: string) { + return this.pathTemplates.buildPathTemplate.render({ + project: project, + location: location, + build: build, + }); + } + + /** + * Parse the project from Build resource. + * + * @param {string} buildName + * A fully-qualified path representing Build resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBuildName(buildName: string) { + return this.pathTemplates.buildPathTemplate.match(buildName).project; + } + + /** + * Parse the location from Build resource. + * + * @param {string} buildName + * A fully-qualified path representing Build resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBuildName(buildName: string) { + return this.pathTemplates.buildPathTemplate.match(buildName).location; + } + + /** + * Parse the build from Build resource. + * + * @param {string} buildName + * A fully-qualified path representing Build resource. + * @returns {string} A string representing the build. + */ + matchBuildFromBuildName(buildName: string) { + return this.pathTemplates.buildPathTemplate.match(buildName).build; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project: string, location: string, cluster: string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified config resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + configPath(project: string, location: string) { + return this.pathTemplates.configPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Config resource. + * + * @param {string} configName + * A fully-qualified path representing Config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConfigName(configName: string) { + return this.pathTemplates.configPathTemplate.match(configName).project; + } + + /** + * Parse the location from Config resource. + * + * @param {string} configName + * A fully-qualified path representing Config resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConfigName(configName: string) { + return this.pathTemplates.configPathTemplate.match(configName).location; + } + + /** + * Return a fully-qualified deliveryPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} delivery_pipeline + * @returns {string} Resource name string. + */ + deliveryPipelinePath( + project: string, + location: string, + deliveryPipeline: string + ) { + return this.pathTemplates.deliveryPipelinePathTemplate.render({ + project: project, + location: location, + delivery_pipeline: deliveryPipeline, + }); + } + + /** + * Parse the project from DeliveryPipeline resource. + * + * @param {string} deliveryPipelineName + * A fully-qualified path representing DeliveryPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeliveryPipelineName(deliveryPipelineName: string) { + return this.pathTemplates.deliveryPipelinePathTemplate.match( + deliveryPipelineName + ).project; + } + + /** + * Parse the location from DeliveryPipeline resource. + * + * @param {string} deliveryPipelineName + * A fully-qualified path representing DeliveryPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeliveryPipelineName(deliveryPipelineName: string) { + return this.pathTemplates.deliveryPipelinePathTemplate.match( + deliveryPipelineName + ).location; + } + + /** + * Parse the delivery_pipeline from DeliveryPipeline resource. + * + * @param {string} deliveryPipelineName + * A fully-qualified path representing DeliveryPipeline resource. + * @returns {string} A string representing the delivery_pipeline. + */ + matchDeliveryPipelineFromDeliveryPipelineName(deliveryPipelineName: string) { + return this.pathTemplates.deliveryPipelinePathTemplate.match( + deliveryPipelineName + ).delivery_pipeline; + } + + /** + * Return a fully-qualified jobRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} delivery_pipeline + * @param {string} release + * @param {string} rollout + * @param {string} job_run + * @returns {string} Resource name string. + */ + jobRunPath( + project: string, + location: string, + deliveryPipeline: string, + release: string, + rollout: string, + jobRun: string + ) { + return this.pathTemplates.jobRunPathTemplate.render({ + project: project, + location: location, + delivery_pipeline: deliveryPipeline, + release: release, + rollout: rollout, + job_run: jobRun, + }); + } + + /** + * Parse the project from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName).project; + } + + /** + * Parse the location from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName).location; + } + + /** + * Parse the delivery_pipeline from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the delivery_pipeline. + */ + matchDeliveryPipelineFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName) + .delivery_pipeline; + } + + /** + * Parse the release from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the release. + */ + matchReleaseFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName).release; + } + + /** + * Parse the rollout from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the rollout. + */ + matchRolloutFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName).rollout; + } + + /** + * Parse the job_run from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the job_run. + */ + matchJobRunFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName).job_run; + } + + /** + * 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 membership resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} membership + * @returns {string} Resource name string. + */ + membershipPath(project: string, location: string, membership: string) { + return this.pathTemplates.membershipPathTemplate.render({ + project: project, + location: location, + membership: membership, + }); + } + + /** + * Parse the project from Membership resource. + * + * @param {string} membershipName + * A fully-qualified path representing Membership resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMembershipName(membershipName: string) { + return this.pathTemplates.membershipPathTemplate.match(membershipName) + .project; + } + + /** + * Parse the location from Membership resource. + * + * @param {string} membershipName + * A fully-qualified path representing Membership resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMembershipName(membershipName: string) { + return this.pathTemplates.membershipPathTemplate.match(membershipName) + .location; + } + + /** + * Parse the membership from Membership resource. + * + * @param {string} membershipName + * A fully-qualified path representing Membership resource. + * @returns {string} A string representing the membership. + */ + matchMembershipFromMembershipName(membershipName: string) { + return this.pathTemplates.membershipPathTemplate.match(membershipName) + .membership; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified release resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} delivery_pipeline + * @param {string} release + * @returns {string} Resource name string. + */ + releasePath( + project: string, + location: string, + deliveryPipeline: string, + release: string + ) { + return this.pathTemplates.releasePathTemplate.render({ + project: project, + location: location, + delivery_pipeline: deliveryPipeline, + release: release, + }); + } + + /** + * Parse the project from Release resource. + * + * @param {string} releaseName + * A fully-qualified path representing Release resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReleaseName(releaseName: string) { + return this.pathTemplates.releasePathTemplate.match(releaseName).project; + } + + /** + * Parse the location from Release resource. + * + * @param {string} releaseName + * A fully-qualified path representing Release resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReleaseName(releaseName: string) { + return this.pathTemplates.releasePathTemplate.match(releaseName).location; + } + + /** + * Parse the delivery_pipeline from Release resource. + * + * @param {string} releaseName + * A fully-qualified path representing Release resource. + * @returns {string} A string representing the delivery_pipeline. + */ + matchDeliveryPipelineFromReleaseName(releaseName: string) { + return this.pathTemplates.releasePathTemplate.match(releaseName) + .delivery_pipeline; + } + + /** + * Parse the release from Release resource. + * + * @param {string} releaseName + * A fully-qualified path representing Release resource. + * @returns {string} A string representing the release. + */ + matchReleaseFromReleaseName(releaseName: string) { + return this.pathTemplates.releasePathTemplate.match(releaseName).release; + } + + /** + * Return a fully-qualified rollout resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} delivery_pipeline + * @param {string} release + * @param {string} rollout + * @returns {string} Resource name string. + */ + rolloutPath( + project: string, + location: string, + deliveryPipeline: string, + release: string, + rollout: string + ) { + return this.pathTemplates.rolloutPathTemplate.render({ + project: project, + location: location, + delivery_pipeline: deliveryPipeline, + release: release, + rollout: rollout, + }); + } + + /** + * Parse the project from Rollout resource. + * + * @param {string} rolloutName + * A fully-qualified path representing Rollout resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRolloutName(rolloutName: string) { + return this.pathTemplates.rolloutPathTemplate.match(rolloutName).project; + } + + /** + * Parse the location from Rollout resource. + * + * @param {string} rolloutName + * A fully-qualified path representing Rollout resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRolloutName(rolloutName: string) { + return this.pathTemplates.rolloutPathTemplate.match(rolloutName).location; + } + + /** + * Parse the delivery_pipeline from Rollout resource. + * + * @param {string} rolloutName + * A fully-qualified path representing Rollout resource. + * @returns {string} A string representing the delivery_pipeline. + */ + matchDeliveryPipelineFromRolloutName(rolloutName: string) { + return this.pathTemplates.rolloutPathTemplate.match(rolloutName) + .delivery_pipeline; + } + + /** + * Parse the release from Rollout resource. + * + * @param {string} rolloutName + * A fully-qualified path representing Rollout resource. + * @returns {string} A string representing the release. + */ + matchReleaseFromRolloutName(rolloutName: string) { + return this.pathTemplates.rolloutPathTemplate.match(rolloutName).release; + } + + /** + * Parse the rollout from Rollout resource. + * + * @param {string} rolloutName + * A fully-qualified path representing Rollout resource. + * @returns {string} A string representing the rollout. + */ + matchRolloutFromRolloutName(rolloutName: string) { + return this.pathTemplates.rolloutPathTemplate.match(rolloutName).rollout; + } + + /** + * Return a fully-qualified target resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} target + * @returns {string} Resource name string. + */ + targetPath(project: string, location: string, target: string) { + return this.pathTemplates.targetPathTemplate.render({ + project: project, + location: location, + target: target, + }); + } + + /** + * Parse the project from Target resource. + * + * @param {string} targetName + * A fully-qualified path representing Target resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTargetName(targetName: string) { + return this.pathTemplates.targetPathTemplate.match(targetName).project; + } + + /** + * Parse the location from Target resource. + * + * @param {string} targetName + * A fully-qualified path representing Target resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTargetName(targetName: string) { + return this.pathTemplates.targetPathTemplate.match(targetName).location; + } + + /** + * Parse the target from Target resource. + * + * @param {string} targetName + * A fully-qualified path representing Target resource. + * @returns {string} A string representing the target. + */ + matchTargetFromTargetName(targetName: string) { + return this.pathTemplates.targetPathTemplate.match(targetName).target; + } + + /** + * Return a fully-qualified workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project: string, location: string, workerPool: string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .worker_pool; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.cloudDeployStub && !this._terminated) { + return this.cloudDeployStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-deploy/src/v1/cloud_deploy_client_config.json b/packages/google-cloud-deploy/src/v1/cloud_deploy_client_config.json new file mode 100644 index 00000000000..b859d23be00 --- /dev/null +++ b/packages/google-cloud-deploy/src/v1/cloud_deploy_client_config.json @@ -0,0 +1,148 @@ +{ + "interfaces": { + "google.cloud.deploy.v1.CloudDeploy": { + "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": { + "ListDeliveryPipelines": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTargets": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetTarget": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateTarget": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTarget": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTarget": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListReleases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetRelease": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateRelease": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AbandonRelease": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApproveRollout": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRollouts": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetRollout": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateRollout": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RetryJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobRuns": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetJobRun": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/packages/google-cloud-deploy/src/v1/cloud_deploy_proto_list.json b/packages/google-cloud-deploy/src/v1/cloud_deploy_proto_list.json new file mode 100644 index 00000000000..fcfe1749c31 --- /dev/null +++ b/packages/google-cloud-deploy/src/v1/cloud_deploy_proto_list.json @@ -0,0 +1,10 @@ +[ + "../../protos/google/cloud/deploy/v1/cloud_deploy.proto", + "../../protos/google/cloud/deploy/v1/deliverypipeline_notification_payload.proto", + "../../protos/google/cloud/deploy/v1/jobrun_notification_payload.proto", + "../../protos/google/cloud/deploy/v1/log_enums.proto", + "../../protos/google/cloud/deploy/v1/release_notification_payload.proto", + "../../protos/google/cloud/deploy/v1/release_render_payload.proto", + "../../protos/google/cloud/deploy/v1/rollout_notification_payload.proto", + "../../protos/google/cloud/deploy/v1/target_notification_payload.proto" +] diff --git a/packages/google-cloud-deploy/src/v1/gapic_metadata.json b/packages/google-cloud-deploy/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..6dceb363634 --- /dev/null +++ b/packages/google-cloud-deploy/src/v1/gapic_metadata.json @@ -0,0 +1,263 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.deploy.v1", + "libraryPackage": "@google-cloud/deploy", + "services": { + "CloudDeploy": { + "clients": { + "grpc": { + "libraryClient": "CloudDeployClient", + "rpcs": { + "GetDeliveryPipeline": { + "methods": [ + "getDeliveryPipeline" + ] + }, + "GetTarget": { + "methods": [ + "getTarget" + ] + }, + "GetRelease": { + "methods": [ + "getRelease" + ] + }, + "AbandonRelease": { + "methods": [ + "abandonRelease" + ] + }, + "ApproveRollout": { + "methods": [ + "approveRollout" + ] + }, + "GetRollout": { + "methods": [ + "getRollout" + ] + }, + "RetryJob": { + "methods": [ + "retryJob" + ] + }, + "GetJobRun": { + "methods": [ + "getJobRun" + ] + }, + "GetConfig": { + "methods": [ + "getConfig" + ] + }, + "CreateDeliveryPipeline": { + "methods": [ + "createDeliveryPipeline" + ] + }, + "UpdateDeliveryPipeline": { + "methods": [ + "updateDeliveryPipeline" + ] + }, + "DeleteDeliveryPipeline": { + "methods": [ + "deleteDeliveryPipeline" + ] + }, + "CreateTarget": { + "methods": [ + "createTarget" + ] + }, + "UpdateTarget": { + "methods": [ + "updateTarget" + ] + }, + "DeleteTarget": { + "methods": [ + "deleteTarget" + ] + }, + "CreateRelease": { + "methods": [ + "createRelease" + ] + }, + "CreateRollout": { + "methods": [ + "createRollout" + ] + }, + "ListDeliveryPipelines": { + "methods": [ + "listDeliveryPipelines", + "listDeliveryPipelinesStream", + "listDeliveryPipelinesAsync" + ] + }, + "ListTargets": { + "methods": [ + "listTargets", + "listTargetsStream", + "listTargetsAsync" + ] + }, + "ListReleases": { + "methods": [ + "listReleases", + "listReleasesStream", + "listReleasesAsync" + ] + }, + "ListRollouts": { + "methods": [ + "listRollouts", + "listRolloutsStream", + "listRolloutsAsync" + ] + }, + "ListJobRuns": { + "methods": [ + "listJobRuns", + "listJobRunsStream", + "listJobRunsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudDeployClient", + "rpcs": { + "GetDeliveryPipeline": { + "methods": [ + "getDeliveryPipeline" + ] + }, + "GetTarget": { + "methods": [ + "getTarget" + ] + }, + "GetRelease": { + "methods": [ + "getRelease" + ] + }, + "AbandonRelease": { + "methods": [ + "abandonRelease" + ] + }, + "ApproveRollout": { + "methods": [ + "approveRollout" + ] + }, + "GetRollout": { + "methods": [ + "getRollout" + ] + }, + "RetryJob": { + "methods": [ + "retryJob" + ] + }, + "GetJobRun": { + "methods": [ + "getJobRun" + ] + }, + "GetConfig": { + "methods": [ + "getConfig" + ] + }, + "CreateDeliveryPipeline": { + "methods": [ + "createDeliveryPipeline" + ] + }, + "UpdateDeliveryPipeline": { + "methods": [ + "updateDeliveryPipeline" + ] + }, + "DeleteDeliveryPipeline": { + "methods": [ + "deleteDeliveryPipeline" + ] + }, + "CreateTarget": { + "methods": [ + "createTarget" + ] + }, + "UpdateTarget": { + "methods": [ + "updateTarget" + ] + }, + "DeleteTarget": { + "methods": [ + "deleteTarget" + ] + }, + "CreateRelease": { + "methods": [ + "createRelease" + ] + }, + "CreateRollout": { + "methods": [ + "createRollout" + ] + }, + "ListDeliveryPipelines": { + "methods": [ + "listDeliveryPipelines", + "listDeliveryPipelinesStream", + "listDeliveryPipelinesAsync" + ] + }, + "ListTargets": { + "methods": [ + "listTargets", + "listTargetsStream", + "listTargetsAsync" + ] + }, + "ListReleases": { + "methods": [ + "listReleases", + "listReleasesStream", + "listReleasesAsync" + ] + }, + "ListRollouts": { + "methods": [ + "listRollouts", + "listRolloutsStream", + "listRolloutsAsync" + ] + }, + "ListJobRuns": { + "methods": [ + "listJobRuns", + "listJobRunsStream", + "listJobRunsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-deploy/src/v1/index.ts b/packages/google-cloud-deploy/src/v1/index.ts new file mode 100644 index 00000000000..7f00861da8f --- /dev/null +++ b/packages/google-cloud-deploy/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 {CloudDeployClient} from './cloud_deploy_client'; diff --git a/packages/google-cloud-deploy/system-test/fixtures/sample/src/index.js b/packages/google-cloud-deploy/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..e49888e8641 --- /dev/null +++ b/packages/google-cloud-deploy/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 deploy = require('@google-cloud/deploy'); + +function main() { + const cloudDeployClient = new deploy.CloudDeployClient(); +} + +main(); diff --git a/packages/google-cloud-deploy/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-deploy/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..b1c846e6dc1 --- /dev/null +++ b/packages/google-cloud-deploy/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 {CloudDeployClient} from '@google-cloud/deploy'; + +// check that the client class type name can be used +function doStuffWithCloudDeployClient(client: CloudDeployClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const cloudDeployClient = new CloudDeployClient(); + doStuffWithCloudDeployClient(cloudDeployClient); +} + +main(); diff --git a/packages/google-cloud-deploy/system-test/install.ts b/packages/google-cloud-deploy/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-deploy/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-deploy/test/gapic_cloud_deploy_v1.ts b/packages/google-cloud-deploy/test/gapic_cloud_deploy_v1.ts new file mode 100644 index 00000000000..a383c7a807c --- /dev/null +++ b/packages/google-cloud-deploy/test/gapic_cloud_deploy_v1.ts @@ -0,0 +1,6139 @@ +// 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 clouddeployModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.CloudDeployClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = clouddeployModule.v1.CloudDeployClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = clouddeployModule.v1.CloudDeployClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = clouddeployModule.v1.CloudDeployClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new clouddeployModule.v1.CloudDeployClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudDeployStub, undefined); + await client.initialize(); + assert(client.cloudDeployStub); + }); + + it('has close method for the initialized client', done => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.cloudDeployStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudDeployStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clouddeployModule.v1.CloudDeployClient({ + 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 clouddeployModule.v1.CloudDeployClient({ + 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('getDeliveryPipeline', () => { + it('invokes getDeliveryPipeline without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ); + client.innerApiCalls.getDeliveryPipeline = + stubSimpleCall(expectedResponse); + const [response] = await client.getDeliveryPipeline(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeliveryPipeline without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ); + client.innerApiCalls.getDeliveryPipeline = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeliveryPipeline( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IDeliveryPipeline | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeliveryPipeline with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeliveryPipeline = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDeliveryPipeline(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeliveryPipeline with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDeliveryPipeline(request), expectedError); + }); + }); + + describe('getTarget', () => { + it('invokes getTarget without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Target() + ); + client.innerApiCalls.getTarget = stubSimpleCall(expectedResponse); + const [response] = await client.getTarget(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTarget without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Target() + ); + client.innerApiCalls.getTarget = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTarget( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.ITarget | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTarget with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTarget = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTarget(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTarget with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTarget(request), expectedError); + }); + }); + + describe('getRelease', () => { + it('invokes getRelease without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Release() + ); + client.innerApiCalls.getRelease = stubSimpleCall(expectedResponse); + const [response] = await client.getRelease(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRelease without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Release() + ); + client.innerApiCalls.getRelease = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRelease( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IRelease | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRelease with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRelease = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRelease(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRelease with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRelease(request), expectedError); + }); + }); + + describe('abandonRelease', () => { + it('invokes abandonRelease without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.AbandonReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseResponse() + ); + client.innerApiCalls.abandonRelease = stubSimpleCall(expectedResponse); + const [response] = await client.abandonRelease(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes abandonRelease without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.AbandonReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseResponse() + ); + client.innerApiCalls.abandonRelease = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.abandonRelease( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IAbandonReleaseResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes abandonRelease with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.AbandonReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.abandonRelease = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.abandonRelease(request), expectedError); + const actualRequest = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes abandonRelease with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.AbandonReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.abandonRelease(request), expectedError); + }); + }); + + describe('approveRollout', () => { + it('invokes approveRollout without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ApproveRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutResponse() + ); + client.innerApiCalls.approveRollout = stubSimpleCall(expectedResponse); + const [response] = await client.approveRollout(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes approveRollout without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ApproveRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutResponse() + ); + client.innerApiCalls.approveRollout = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.approveRollout( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IApproveRolloutResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes approveRollout with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ApproveRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.approveRollout = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.approveRollout(request), expectedError); + const actualRequest = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes approveRollout with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ApproveRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.approveRollout(request), expectedError); + }); + }); + + describe('getRollout', () => { + it('invokes getRollout without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Rollout() + ); + client.innerApiCalls.getRollout = stubSimpleCall(expectedResponse); + const [response] = await client.getRollout(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRollout without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Rollout() + ); + client.innerApiCalls.getRollout = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRollout( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IRollout | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRollout with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRollout = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRollout(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRollout with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRollout(request), expectedError); + }); + }); + + describe('retryJob', () => { + it('invokes retryJob without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.RetryJobRequest', + ['rollout'] + ); + request.rollout = defaultValue1; + const expectedHeaderRequestParams = `rollout=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobResponse() + ); + client.innerApiCalls.retryJob = stubSimpleCall(expectedResponse); + const [response] = await client.retryJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retryJob without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.RetryJobRequest', + ['rollout'] + ); + request.rollout = defaultValue1; + const expectedHeaderRequestParams = `rollout=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobResponse() + ); + client.innerApiCalls.retryJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retryJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IRetryJobResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retryJob with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.RetryJobRequest', + ['rollout'] + ); + request.rollout = defaultValue1; + const expectedHeaderRequestParams = `rollout=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.retryJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.retryJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retryJob with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.RetryJobRequest', + ['rollout'] + ); + request.rollout = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.retryJob(request), expectedError); + }); + }); + + describe('getJobRun', () => { + it('invokes getJobRun without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetJobRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetJobRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.JobRun() + ); + client.innerApiCalls.getJobRun = stubSimpleCall(expectedResponse); + const [response] = await client.getJobRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobRun without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetJobRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetJobRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.JobRun() + ); + client.innerApiCalls.getJobRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJobRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IJobRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobRun with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetJobRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetJobRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJobRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJobRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobRun with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetJobRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetJobRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJobRun(request), expectedError); + }); + }); + + describe('getConfig', () => { + it('invokes getConfig without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Config() + ); + client.innerApiCalls.getConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Config() + ); + client.innerApiCalls.getConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConfig(request), expectedError); + }); + }); + + describe('createDeliveryPipeline', () => { + it('invokes createDeliveryPipeline without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateDeliveryPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDeliveryPipeline = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createDeliveryPipeline(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeliveryPipeline without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateDeliveryPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDeliveryPipeline = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDeliveryPipeline( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeliveryPipeline with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateDeliveryPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeliveryPipeline = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createDeliveryPipeline(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeliveryPipeline with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateDeliveryPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeliveryPipeline = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createDeliveryPipeline(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateDeliveryPipelineProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkCreateDeliveryPipelineProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDeliveryPipelineProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkCreateDeliveryPipelineProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateDeliveryPipeline', () => { + it('invokes updateDeliveryPipeline without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest() + ); + request.deliveryPipeline ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest', + ['deliveryPipeline', 'name'] + ); + request.deliveryPipeline.name = defaultValue1; + const expectedHeaderRequestParams = `delivery_pipeline.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDeliveryPipeline = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDeliveryPipeline(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeliveryPipeline without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest() + ); + request.deliveryPipeline ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest', + ['deliveryPipeline', 'name'] + ); + request.deliveryPipeline.name = defaultValue1; + const expectedHeaderRequestParams = `delivery_pipeline.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDeliveryPipeline = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDeliveryPipeline( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeliveryPipeline with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest() + ); + request.deliveryPipeline ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest', + ['deliveryPipeline', 'name'] + ); + request.deliveryPipeline.name = defaultValue1; + const expectedHeaderRequestParams = `delivery_pipeline.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeliveryPipeline = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateDeliveryPipeline(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeliveryPipeline with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest() + ); + request.deliveryPipeline ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest', + ['deliveryPipeline', 'name'] + ); + request.deliveryPipeline.name = defaultValue1; + const expectedHeaderRequestParams = `delivery_pipeline.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeliveryPipeline = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateDeliveryPipeline(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDeliveryPipelineProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkUpdateDeliveryPipelineProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDeliveryPipelineProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkUpdateDeliveryPipelineProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteDeliveryPipeline', () => { + it('invokes deleteDeliveryPipeline without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDeliveryPipeline = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDeliveryPipeline(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeliveryPipeline without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDeliveryPipeline = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDeliveryPipeline( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeliveryPipeline with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeliveryPipeline = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteDeliveryPipeline(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeliveryPipeline with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeliveryPipeline = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteDeliveryPipeline(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteDeliveryPipelineProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkDeleteDeliveryPipelineProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDeliveryPipelineProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkDeleteDeliveryPipelineProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createTarget', () => { + it('invokes createTarget without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateTargetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTarget = stubLongRunningCall(expectedResponse); + const [operation] = await client.createTarget(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTarget without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateTargetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTarget = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTarget( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTarget with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateTargetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTarget = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createTarget(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTarget with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateTargetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTarget = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createTarget(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateTargetProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkCreateTargetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTargetProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkCreateTargetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateTarget', () => { + it('invokes updateTarget without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateTargetRequest() + ); + request.target ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateTargetRequest', + ['target', 'name'] + ); + request.target.name = defaultValue1; + const expectedHeaderRequestParams = `target.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTarget = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTarget(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTarget without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateTargetRequest() + ); + request.target ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateTargetRequest', + ['target', 'name'] + ); + request.target.name = defaultValue1; + const expectedHeaderRequestParams = `target.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTarget = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTarget( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTarget with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateTargetRequest() + ); + request.target ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateTargetRequest', + ['target', 'name'] + ); + request.target.name = defaultValue1; + const expectedHeaderRequestParams = `target.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTarget = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTarget(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTarget with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateTargetRequest() + ); + request.target ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateTargetRequest', + ['target', 'name'] + ); + request.target.name = defaultValue1; + const expectedHeaderRequestParams = `target.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTarget = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateTarget(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateTargetProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkUpdateTargetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTargetProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkUpdateTargetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteTarget', () => { + it('invokes deleteTarget without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTarget = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTarget(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTarget without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTarget = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTarget( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTarget with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTarget = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTarget(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTarget with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTarget = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteTarget(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteTargetProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkDeleteTargetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTargetProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkDeleteTargetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createRelease', () => { + it('invokes createRelease without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateReleaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRelease = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createRelease(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRelease without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateReleaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRelease = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRelease( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRelease with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateReleaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRelease = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createRelease(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRelease with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateReleaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRelease = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createRelease(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateReleaseProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkCreateReleaseProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateReleaseProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkCreateReleaseProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createRollout', () => { + it('invokes createRollout without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRollout = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createRollout(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRollout without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRollout = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRollout( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRollout with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRollout = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createRollout(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRollout with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRollout = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createRollout(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateRolloutProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkCreateRolloutProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateRolloutProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + 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.checkCreateRolloutProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDeliveryPipelines', () => { + it('invokes listDeliveryPipelines without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.innerApiCalls.listDeliveryPipelines = + stubSimpleCall(expectedResponse); + const [response] = await client.listDeliveryPipelines(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeliveryPipelines without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.innerApiCalls.listDeliveryPipelines = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeliveryPipelines( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IDeliveryPipeline[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeliveryPipelines with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeliveryPipelines = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listDeliveryPipelines(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeliveryPipelinesStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.descriptors.page.listDeliveryPipelines.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDeliveryPipelinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.DeliveryPipeline[] = []; + stream.on( + 'data', + (response: protos.google.cloud.deploy.v1.DeliveryPipeline) => { + 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.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listDeliveryPipelines, request) + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDeliveryPipelinesStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeliveryPipelines.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeliveryPipelinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.DeliveryPipeline[] = []; + stream.on( + 'data', + (response: protos.google.cloud.deploy.v1.DeliveryPipeline) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listDeliveryPipelines, request) + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeliveryPipelines without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.descriptors.page.listDeliveryPipelines.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.deploy.v1.IDeliveryPipeline[] = []; + const iterable = client.listDeliveryPipelinesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeliveryPipelines with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeliveryPipelines.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeliveryPipelinesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.deploy.v1.IDeliveryPipeline[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTargets', () => { + it('invokes listTargets without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + ]; + client.innerApiCalls.listTargets = stubSimpleCall(expectedResponse); + const [response] = await client.listTargets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargets without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + ]; + client.innerApiCalls.listTargets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTargets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.ITarget[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargets with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTargets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTargets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargetsStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + ]; + client.descriptors.page.listTargets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTargetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Target[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Target) => { + 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.listTargets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTargets, request) + ); + assert( + (client.descriptors.page.listTargets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTargetsStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTargets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listTargetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Target[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Target) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTargets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTargets, request) + ); + assert( + (client.descriptors.page.listTargets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTargets without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + ]; + client.descriptors.page.listTargets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.deploy.v1.ITarget[] = []; + const iterable = client.listTargetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTargets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listTargets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTargets with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTargets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listTargetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.deploy.v1.ITarget[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTargets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listTargets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listReleases', () => { + it('invokes listReleases without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + ]; + client.innerApiCalls.listReleases = stubSimpleCall(expectedResponse); + const [response] = await client.listReleases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReleases without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + ]; + client.innerApiCalls.listReleases = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listReleases( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IRelease[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReleases with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listReleases = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listReleases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReleasesStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + ]; + client.descriptors.page.listReleases.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listReleasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Release[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Release) => { + 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.listReleases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReleases, request) + ); + assert( + (client.descriptors.page.listReleases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listReleasesStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReleases.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listReleasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Release[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Release) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listReleases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReleases, request) + ); + assert( + (client.descriptors.page.listReleases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReleases without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + ]; + client.descriptors.page.listReleases.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.deploy.v1.IRelease[] = []; + const iterable = client.listReleasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listReleases.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listReleases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReleases with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReleases.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listReleasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.deploy.v1.IRelease[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listReleases.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listReleases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listRollouts', () => { + it('invokes listRollouts without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + ]; + client.innerApiCalls.listRollouts = stubSimpleCall(expectedResponse); + const [response] = await client.listRollouts(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRollouts without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + ]; + client.innerApiCalls.listRollouts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRollouts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IRollout[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRollouts with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRollouts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listRollouts(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRolloutsStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + ]; + client.descriptors.page.listRollouts.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRolloutsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Rollout[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Rollout) => { + 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.listRollouts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRollouts, request) + ); + assert( + (client.descriptors.page.listRollouts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRolloutsStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRollouts.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listRolloutsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Rollout[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Rollout) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listRollouts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRollouts, request) + ); + assert( + (client.descriptors.page.listRollouts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRollouts without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + ]; + client.descriptors.page.listRollouts.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.deploy.v1.IRollout[] = []; + const iterable = client.listRolloutsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRollouts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRollouts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRollouts with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRollouts.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRolloutsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.deploy.v1.IRollout[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRollouts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRollouts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listJobRuns', () => { + it('invokes listJobRuns without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + ]; + client.innerApiCalls.listJobRuns = stubSimpleCall(expectedResponse); + const [response] = await client.listJobRuns(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobRuns without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + ]; + client.innerApiCalls.listJobRuns = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobRuns( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IJobRun[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobRuns with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobRuns = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listJobRuns(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobRunsStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + ]; + client.descriptors.page.listJobRuns.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listJobRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.JobRun[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.JobRun) => { + 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.listJobRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobRuns, request) + ); + assert( + (client.descriptors.page.listJobRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobRunsStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobRuns.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listJobRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.JobRun[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.JobRun) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listJobRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobRuns, request) + ); + assert( + (client.descriptors.page.listJobRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobRuns without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + ]; + client.descriptors.page.listJobRuns.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.deploy.v1.IJobRun[] = []; + const iterable = client.listJobRunsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobRuns.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listJobRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobRuns with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobRuns.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listJobRunsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.deploy.v1.IJobRun[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobRuns.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listJobRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('build', () => { + const fakePath = '/rendered/path/build'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + build: 'buildValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.buildPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.buildPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('buildPath', () => { + const result = client.buildPath( + 'projectValue', + 'locationValue', + 'buildValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.buildPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBuildName', () => { + const result = client.matchProjectFromBuildName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.buildPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBuildName', () => { + const result = client.matchLocationFromBuildName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.buildPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBuildFromBuildName', () => { + const result = client.matchBuildFromBuildName(fakePath); + assert.strictEqual(result, 'buildValue'); + assert( + (client.pathTemplates.buildPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('cluster', () => { + const fakePath = '/rendered/path/cluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.clusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath( + 'projectValue', + 'locationValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('config', () => { + const fakePath = '/rendered/path/config'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.configPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.configPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('configPath', () => { + const result = client.configPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.configPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConfigName', () => { + const result = client.matchProjectFromConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.configPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConfigName', () => { + const result = client.matchLocationFromConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.configPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deliveryPipeline', () => { + const fakePath = '/rendered/path/deliveryPipeline'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + delivery_pipeline: 'deliveryPipelineValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deliveryPipelinePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deliveryPipelinePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deliveryPipelinePath', () => { + const result = client.deliveryPipelinePath( + 'projectValue', + 'locationValue', + 'deliveryPipelineValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.deliveryPipelinePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeliveryPipelineName', () => { + const result = client.matchProjectFromDeliveryPipelineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deliveryPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeliveryPipelineName', () => { + const result = client.matchLocationFromDeliveryPipelineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deliveryPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeliveryPipelineFromDeliveryPipelineName', () => { + const result = + client.matchDeliveryPipelineFromDeliveryPipelineName(fakePath); + assert.strictEqual(result, 'deliveryPipelineValue'); + assert( + (client.pathTemplates.deliveryPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('jobRun', () => { + const fakePath = '/rendered/path/jobRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + delivery_pipeline: 'deliveryPipelineValue', + release: 'releaseValue', + rollout: 'rolloutValue', + job_run: 'jobRunValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobRunPath', () => { + const result = client.jobRunPath( + 'projectValue', + 'locationValue', + 'deliveryPipelineValue', + 'releaseValue', + 'rolloutValue', + 'jobRunValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobRunName', () => { + const result = client.matchProjectFromJobRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromJobRunName', () => { + const result = client.matchLocationFromJobRunName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeliveryPipelineFromJobRunName', () => { + const result = client.matchDeliveryPipelineFromJobRunName(fakePath); + assert.strictEqual(result, 'deliveryPipelineValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReleaseFromJobRunName', () => { + const result = client.matchReleaseFromJobRunName(fakePath); + assert.strictEqual(result, 'releaseValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRolloutFromJobRunName', () => { + const result = client.matchRolloutFromJobRunName(fakePath); + assert.strictEqual(result, 'rolloutValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobRunFromJobRunName', () => { + const result = client.matchJobRunFromJobRunName(fakePath); + assert.strictEqual(result, 'jobRunValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + 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('membership', () => { + const fakePath = '/rendered/path/membership'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + membership: 'membershipValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.membershipPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.membershipPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('membershipPath', () => { + const result = client.membershipPath( + 'projectValue', + 'locationValue', + 'membershipValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.membershipPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMembershipName', () => { + const result = client.matchProjectFromMembershipName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.membershipPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMembershipName', () => { + const result = client.matchLocationFromMembershipName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.membershipPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMembershipFromMembershipName', () => { + const result = client.matchMembershipFromMembershipName(fakePath); + assert.strictEqual(result, 'membershipValue'); + assert( + (client.pathTemplates.membershipPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('release', () => { + const fakePath = '/rendered/path/release'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + delivery_pipeline: 'deliveryPipelineValue', + release: 'releaseValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.releasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.releasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('releasePath', () => { + const result = client.releasePath( + 'projectValue', + 'locationValue', + 'deliveryPipelineValue', + 'releaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.releasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReleaseName', () => { + const result = client.matchProjectFromReleaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.releasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReleaseName', () => { + const result = client.matchLocationFromReleaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.releasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeliveryPipelineFromReleaseName', () => { + const result = client.matchDeliveryPipelineFromReleaseName(fakePath); + assert.strictEqual(result, 'deliveryPipelineValue'); + assert( + (client.pathTemplates.releasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReleaseFromReleaseName', () => { + const result = client.matchReleaseFromReleaseName(fakePath); + assert.strictEqual(result, 'releaseValue'); + assert( + (client.pathTemplates.releasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('rollout', () => { + const fakePath = '/rendered/path/rollout'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + delivery_pipeline: 'deliveryPipelineValue', + release: 'releaseValue', + rollout: 'rolloutValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.rolloutPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.rolloutPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('rolloutPath', () => { + const result = client.rolloutPath( + 'projectValue', + 'locationValue', + 'deliveryPipelineValue', + 'releaseValue', + 'rolloutValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.rolloutPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRolloutName', () => { + const result = client.matchProjectFromRolloutName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.rolloutPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRolloutName', () => { + const result = client.matchLocationFromRolloutName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.rolloutPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeliveryPipelineFromRolloutName', () => { + const result = client.matchDeliveryPipelineFromRolloutName(fakePath); + assert.strictEqual(result, 'deliveryPipelineValue'); + assert( + (client.pathTemplates.rolloutPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReleaseFromRolloutName', () => { + const result = client.matchReleaseFromRolloutName(fakePath); + assert.strictEqual(result, 'releaseValue'); + assert( + (client.pathTemplates.rolloutPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRolloutFromRolloutName', () => { + const result = client.matchRolloutFromRolloutName(fakePath); + assert.strictEqual(result, 'rolloutValue'); + assert( + (client.pathTemplates.rolloutPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('target', () => { + const fakePath = '/rendered/path/target'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + target: 'targetValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.targetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.targetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('targetPath', () => { + const result = client.targetPath( + 'projectValue', + 'locationValue', + 'targetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.targetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTargetName', () => { + const result = client.matchProjectFromTargetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.targetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTargetName', () => { + const result = client.matchLocationFromTargetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.targetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTargetFromTargetName', () => { + const result = client.matchTargetFromTargetName(fakePath); + assert.strictEqual(result, 'targetValue'); + assert( + (client.pathTemplates.targetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('workerPool', () => { + const fakePath = '/rendered/path/workerPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + worker_pool: 'workerPoolValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath( + 'projectValue', + 'locationValue', + 'workerPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'workerPoolValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-deploy/tsconfig.json b/packages/google-cloud-deploy/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-deploy/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-deploy/webpack.config.js b/packages/google-cloud-deploy/webpack.config.js new file mode 100644 index 00000000000..68d3b06f32d --- /dev/null +++ b/packages/google-cloud-deploy/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: 'CloudDeploy', + filename: './cloud-deploy.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-config.json b/release-please-config.json index 58ae8e2b22f..ebce04f41ba 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -11,6 +11,7 @@ "packages/google-cloud-bigquery-dataexchange": {}, "packages/google-cloud-bigquery-datapolicies": {}, "packages/google-cloud-bigquery-datatransfer": {}, + "packages/google-cloud-deploy": {}, "packages/google-cloud-dataplex": {}, "packages/google-cloud-certificatemanager": {}, "packages/google-cloud-gkemulticloud": {},