diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 52fe048df5e..94c516f770a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,6 +1,7 @@ { "packages/gapic-node-templating": "0.0.0", "packages/google-api-apikeys": "0.1.3", + "packages/google-appengine": "2.1.2", "packages/google-cloud-accessapproval": "2.1.2", "packages/google-cloud-apigeeconnect": "2.1.3", "packages/google-cloud-asset": "4.5.0", diff --git a/packages/google-appengine/.OwlBot.yaml b/packages/google-appengine/.OwlBot.yaml new file mode 100644 index 00000000000..a40fc503c53 --- /dev/null +++ b/packages/google-appengine/.OwlBot.yaml @@ -0,0 +1,24 @@ +# 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/appengine/(v.*)/.*-nodejs + dest: /owl-bot-staging/google-appengine/$1 + +begin-after-commit-hash: 40278112d2922ec917140dcb5cc6d5ef2923aeb2 + diff --git a/packages/google-appengine/.eslintignore b/packages/google-appengine/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-appengine/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-appengine/.eslintrc.json b/packages/google-appengine/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-appengine/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-appengine/.gitattributes b/packages/google-appengine/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-appengine/.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-appengine/.gitignore b/packages/google-appengine/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-appengine/.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-appengine/.jsdoc.js b/packages/google-appengine/.jsdoc.js new file mode 100644 index 00000000000..49d25217f6b --- /dev/null +++ b/packages/google-appengine/.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/appengine-admin', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-appengine/.mocharc.js b/packages/google-appengine/.mocharc.js new file mode 100644 index 00000000000..cdb7b752160 --- /dev/null +++ b/packages/google-appengine/.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-appengine/.nycrc b/packages/google-appengine/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-appengine/.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-appengine/.prettierignore b/packages/google-appengine/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-appengine/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-appengine/.prettierrc.js b/packages/google-appengine/.prettierrc.js new file mode 100644 index 00000000000..d546a4ad546 --- /dev/null +++ b/packages/google-appengine/.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-appengine/.repo-metadata.json b/packages/google-appengine/.repo-metadata.json new file mode 100644 index 00000000000..46417b6001e --- /dev/null +++ b/packages/google-appengine/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/appengine-admin/latest", + "product_documentation": "https://cloud.google.com/appengine/docs/admin-api/", + "name": "appengine-admin", + "requires_billing": true, + "release_level": "stable", + "language": "nodejs", + "api_id": "appengine.googleapis.com", + "distribution_name": "@google-cloud/appengine-admin", + "repo": "googleapis/google-cloud-node", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "name_pretty": "App Engine Admin API", + "default_version": "v1", + "api_shortname": "appengine", + "library_type": "GAPIC_AUTO", + "codeowner_team": "@googleapis/aap-dpes" +} diff --git a/packages/google-appengine/CHANGELOG.md b/packages/google-appengine/CHANGELOG.md new file mode 100644 index 00000000000..c86800ee37b --- /dev/null +++ b/packages/google-appengine/CHANGELOG.md @@ -0,0 +1,135 @@ +# Changelog + +## [2.1.2](https://github.com/googleapis/nodejs-appengine-admin/compare/v2.1.1...v2.1.2) (2022-11-11) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#156](https://github.com/googleapis/nodejs-appengine-admin/issues/156)) ([b203e7e](https://github.com/googleapis/nodejs-appengine-admin/commit/b203e7eb65d947e00be58f80fc6cf3f94ad8de8b)) +* **deps:** Use google-gax v3.5.2 ([#164](https://github.com/googleapis/nodejs-appengine-admin/issues/164)) ([8525dac](https://github.com/googleapis/nodejs-appengine-admin/commit/8525dac6e50bd9c9cf8bd7b6ff6c431b6900d5ad)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-appengine-admin/issues/1553)) ([#155](https://github.com/googleapis/nodejs-appengine-admin/issues/155)) ([eaff462](https://github.com/googleapis/nodejs-appengine-admin/commit/eaff462965a3440556f7b959ea881f9e317817a8)) +* Preserve default values in x-goog-request-params header ([#158](https://github.com/googleapis/nodejs-appengine-admin/issues/158)) ([3636c4a](https://github.com/googleapis/nodejs-appengine-admin/commit/3636c4a967718909c397de4bca372e351ce56a83)) +* Regenerated protos JS and TS definitions ([#167](https://github.com/googleapis/nodejs-appengine-admin/issues/167)) ([f629b53](https://github.com/googleapis/nodejs-appengine-admin/commit/f629b536ee41a787594d1168eb0715903a0975b1)) +* use google-gax v3.3.0 ([eaff462](https://github.com/googleapis/nodejs-appengine-admin/commit/eaff462965a3440556f7b959ea881f9e317817a8)) + +## [2.1.1](https://github.com/googleapis/nodejs-appengine-admin/compare/v2.1.0...v2.1.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#150](https://github.com/googleapis/nodejs-appengine-admin/issues/150)) ([ec76f66](https://github.com/googleapis/nodejs-appengine-admin/commit/ec76f6685ad06a47e3b0d3facdf4c1a0020244e0)) +* change import long to require ([#152](https://github.com/googleapis/nodejs-appengine-admin/issues/152)) ([62e67ec](https://github.com/googleapis/nodejs-appengine-admin/commit/62e67ec394573b41b24aebef89a12dbf3a3f42e2)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-appengine-admin/issues/1546)) ([#154](https://github.com/googleapis/nodejs-appengine-admin/issues/154)) ([f31d99b](https://github.com/googleapis/nodejs-appengine-admin/commit/f31d99bb423a295bea56e2a8aee0ada9823fbb7f)) + +## [2.1.0](https://github.com/googleapis/nodejs-appengine-admin/compare/v2.0.0...v2.1.0) (2022-06-29) + + +### Features + +* support regapic LRO ([#140](https://github.com/googleapis/nodejs-appengine-admin/issues/140)) ([0185670](https://github.com/googleapis/nodejs-appengine-admin/commit/01856700f02bd5ec178aac4ab0378feebee0fda9)) + +## [2.0.0](https://github.com/googleapis/nodejs-appengine-admin/compare/v1.2.0...v2.0.0) (2022-06-10) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#134) + +### Features + +* add Application.service_account ([#130](https://github.com/googleapis/nodejs-appengine-admin/issues/130)) ([698f05e](https://github.com/googleapis/nodejs-appengine-admin/commit/698f05e03e81b24602a6f6a681186540722698e8)) + + +### Build System + +* update library to use Node 12 ([#134](https://github.com/googleapis/nodejs-appengine-admin/issues/134)) ([df3424a](https://github.com/googleapis/nodejs-appengine-admin/commit/df3424ac8a77e8549f42300e4182a721e8ef4755)) + +## [1.2.0](https://github.com/googleapis/nodejs-appengine-admin/compare/v1.1.0...v1.2.0) (2022-03-23) + + +### Features + +* promote to stable ([#119](https://github.com/googleapis/nodejs-appengine-admin/issues/119)) ([4d84360](https://github.com/googleapis/nodejs-appengine-admin/commit/4d84360f97c4417ae0ba4690b2c8511794640d94)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-appengine-admin/compare/v1.0.6...v1.1.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#78](https://www.github.com/googleapis/nodejs-appengine-admin/issues/78)) ([df643dd](https://www.github.com/googleapis/nodejs-appengine-admin/commit/df643dd9f37d966a09490c6f4edfb5fa9d0a0d9f)) + +### [1.0.6](https://www.github.com/googleapis/nodejs-appengine-admin/compare/v1.0.5...v1.0.6) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#76](https://www.github.com/googleapis/nodejs-appengine-admin/issues/76)) ([471b3e9](https://www.github.com/googleapis/nodejs-appengine-admin/commit/471b3e9e4d493f32bc30d1927a47f02018ffb845)) + +### [1.0.5](https://www.github.com/googleapis/nodejs-appengine-admin/compare/v1.0.4...v1.0.5) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#67](https://www.github.com/googleapis/nodejs-appengine-admin/issues/67)) ([e4c206c](https://www.github.com/googleapis/nodejs-appengine-admin/commit/e4c206c55eef567387bdf8f9c7a342986b85c146)) + +### [1.0.4](https://www.github.com/googleapis/nodejs-appengine-admin/compare/v1.0.3...v1.0.4) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#65](https://www.github.com/googleapis/nodejs-appengine-admin/issues/65)) ([dd73dd5](https://www.github.com/googleapis/nodejs-appengine-admin/commit/dd73dd52d0fbc1ac08c9b03292f286a20a2f4db3)) + +### [1.0.3](https://www.github.com/googleapis/nodejs-appengine-admin/compare/v1.0.2...v1.0.3) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#62](https://www.github.com/googleapis/nodejs-appengine-admin/issues/62)) ([ae1c209](https://www.github.com/googleapis/nodejs-appengine-admin/commit/ae1c209bea986cedb9a814f0695138d578fa33d6)) + +### [1.0.2](https://www.github.com/googleapis/nodejs-appengine-admin/compare/v1.0.1...v1.0.2) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#56](https://www.github.com/googleapis/nodejs-appengine-admin/issues/56)) ([1262e7e](https://www.github.com/googleapis/nodejs-appengine-admin/commit/1262e7e449888f56d8fb28801059783c077f6a17)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-appengine-admin/compare/v1.0.0...v1.0.1) (2021-06-07) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#49](https://www.github.com/googleapis/nodejs-appengine-admin/issues/49)) ([13a7d7e](https://www.github.com/googleapis/nodejs-appengine-admin/commit/13a7d7e975e583191ede000ee650be9fff7a87fa)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-appengine-admin/compare/v0.2.1...v1.0.0) (2021-05-20) + + +### Features + +* promote the library to 1.0 ([#46](https://www.github.com/googleapis/nodejs-appengine-admin/issues/46)) ([8c1e9b7](https://www.github.com/googleapis/nodejs-appengine-admin/commit/8c1e9b793364e51cc7d140ab6df531016ad197c2)) + +### [0.2.1](https://www.github.com/googleapis/nodejs-appengine-admin/compare/v0.2.0...v0.2.1) (2021-05-19) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#39](https://www.github.com/googleapis/nodejs-appengine-admin/issues/39)) ([f6c8735](https://www.github.com/googleapis/nodejs-appengine-admin/commit/f6c873571770a56d5d46449b63c0adfc1375ced5)) +* use require() to load JSON protos ([#42](https://www.github.com/googleapis/nodejs-appengine-admin/issues/42)) ([d406ced](https://www.github.com/googleapis/nodejs-appengine-admin/commit/d406ced6996c5b0128a69fde745b86f0e67107cb)) + +## 0.2.0 (2021-03-30) + + +### ⚠ BREAKING CHANGES + +* initial stub of library + +### Features + +* add initial samples and tests ([#2](https://www.github.com/googleapis/nodejs-appengine-admin/issues/2)) ([b3bbb90](https://www.github.com/googleapis/nodejs-appengine-admin/commit/b3bbb90f2495d5dcd4155c151901be77fe755af6)) +* add samples ([3a94c12](https://www.github.com/googleapis/nodejs-appengine-admin/commit/3a94c12ab8b48e21adda12c44f14e4b66e91a1cd)) +* initial stub of library ([713ee9c](https://www.github.com/googleapis/nodejs-appengine-admin/commit/713ee9c67c67c88e284e5ae99a3b0db0dff0fe88)) + + +### Bug Fixes + +* **build:** release first version of library as v0.2.0 ([#9](https://www.github.com/googleapis/nodejs-appengine-admin/issues/9)) ([ac79b04](https://www.github.com/googleapis/nodejs-appengine-admin/commit/ac79b04160eb048d8918aae0f85cf350779ef78f)) +* start at Node 12 ([ed04ab3](https://www.github.com/googleapis/nodejs-appengine-admin/commit/ed04ab3721329aed75b5a9b092f20080c632f8e0)) diff --git a/packages/google-appengine/CODE_OF_CONDUCT.md b/packages/google-appengine/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-appengine/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-appengine/CONTRIBUTING.md b/packages/google-appengine/CONTRIBUTING.md new file mode 100644 index 00000000000..81a34361773 --- /dev/null +++ b/packages/google-appengine/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 App Engine Admin API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=appengine.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-appengine/LICENSE b/packages/google-appengine/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-appengine/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-appengine/README.md b/packages/google-appengine/README.md new file mode 100644 index 00000000000..92cb001dd92 --- /dev/null +++ b/packages/google-appengine/README.md @@ -0,0 +1,193 @@ +[//]: # "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 + +# [App Engine Admin API: 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/appengine-admin.svg)](https://www.npmjs.org/package/@google-cloud/appengine-admin) + + + + +Appengine 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/tree/main/packages/google-appengine/CHANGELOG.md). + +* [App Engine Admin API Node.js Client API Reference][client-docs] +* [App Engine Admin API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-appengine](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-appengine) + +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 App Engine Admin API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/appengine-admin +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library + +const {ServicesClient} = require('@google-cloud/appengine-admin'); + +// TODO(developer): replace with your prefered project ID. +// const projectId = 'my-project' + +// Creates a client +const client = new ServicesClient(); + +async function listVersions() { + const [versions] = await client.listServices({ + parent: `apps/${projectId}`, + }); + console.info(versions); +} +listVersions(); + +``` + + + +## 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 | +| --------------------------- | --------------------------------- | ------ | +| Applications.create_application | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/applications.create_application.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-appengine/samples/generated/v1/applications.create_application.js,samples/README.md) | +| Applications.get_application | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/applications.get_application.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-appengine/samples/generated/v1/applications.get_application.js,samples/README.md) | +| Applications.repair_application | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/applications.repair_application.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-appengine/samples/generated/v1/applications.repair_application.js,samples/README.md) | +| Applications.update_application | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/applications.update_application.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-appengine/samples/generated/v1/applications.update_application.js,samples/README.md) | +| Authorized_certificates.create_authorized_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.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-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.js,samples/README.md) | +| Authorized_certificates.delete_authorized_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.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-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.js,samples/README.md) | +| Authorized_certificates.get_authorized_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.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-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.js,samples/README.md) | +| Authorized_certificates.list_authorized_certificates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.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-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.js,samples/README.md) | +| Authorized_certificates.update_authorized_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.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-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.js,samples/README.md) | +| Authorized_domains.list_authorized_domains | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.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-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.js,samples/README.md) | +| Domain_mappings.create_domain_mapping | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.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-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.js,samples/README.md) | +| Domain_mappings.delete_domain_mapping | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.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-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.js,samples/README.md) | +| Domain_mappings.get_domain_mapping | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.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-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.js,samples/README.md) | +| Domain_mappings.list_domain_mappings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.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-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.js,samples/README.md) | +| Domain_mappings.update_domain_mapping | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.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-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.js,samples/README.md) | +| Firewall.batch_update_ingress_rules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.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-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.js,samples/README.md) | +| Firewall.create_ingress_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.create_ingress_rule.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-appengine/samples/generated/v1/firewall.create_ingress_rule.js,samples/README.md) | +| Firewall.delete_ingress_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.delete_ingress_rule.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-appengine/samples/generated/v1/firewall.delete_ingress_rule.js,samples/README.md) | +| Firewall.get_ingress_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.get_ingress_rule.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-appengine/samples/generated/v1/firewall.get_ingress_rule.js,samples/README.md) | +| Firewall.list_ingress_rules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.list_ingress_rules.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-appengine/samples/generated/v1/firewall.list_ingress_rules.js,samples/README.md) | +| Firewall.update_ingress_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.update_ingress_rule.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-appengine/samples/generated/v1/firewall.update_ingress_rule.js,samples/README.md) | +| Instances.debug_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/instances.debug_instance.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-appengine/samples/generated/v1/instances.debug_instance.js,samples/README.md) | +| Instances.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/instances.delete_instance.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-appengine/samples/generated/v1/instances.delete_instance.js,samples/README.md) | +| Instances.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/instances.get_instance.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-appengine/samples/generated/v1/instances.get_instance.js,samples/README.md) | +| Instances.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/instances.list_instances.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-appengine/samples/generated/v1/instances.list_instances.js,samples/README.md) | +| Services.delete_service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/services.delete_service.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-appengine/samples/generated/v1/services.delete_service.js,samples/README.md) | +| Services.get_service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/services.get_service.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-appengine/samples/generated/v1/services.get_service.js,samples/README.md) | +| Services.list_services | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/services.list_services.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-appengine/samples/generated/v1/services.list_services.js,samples/README.md) | +| Services.update_service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/services.update_service.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-appengine/samples/generated/v1/services.update_service.js,samples/README.md) | +| Versions.create_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/versions.create_version.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-appengine/samples/generated/v1/versions.create_version.js,samples/README.md) | +| Versions.delete_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/versions.delete_version.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-appengine/samples/generated/v1/versions.delete_version.js,samples/README.md) | +| Versions.get_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/versions.get_version.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-appengine/samples/generated/v1/versions.get_version.js,samples/README.md) | +| Versions.list_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/versions.list_versions.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-appengine/samples/generated/v1/versions.list_versions.js,samples/README.md) | +| Versions.update_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/versions.update_version.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-appengine/samples/generated/v1/versions.update_version.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/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-appengine/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/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-appengine/samples/test/quickstart.js,samples/README.md) | + + + +The [App Engine Admin API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/appengine-admin@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/appengine-admin/latest +[product-docs]: https://cloud.google.com/appengine/docs/admin-api/ +[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=appengine.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-appengine/linkinator.config.json b/packages/google-appengine/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-appengine/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-appengine/owlbot.py b/packages/google-appengine/owlbot.py new file mode 100644 index 00000000000..25b25a0f1d5 --- /dev/null +++ b/packages/google-appengine/owlbot.py @@ -0,0 +1,18 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""This script is used to synthesize generated parts of this library.""" + +import synthtool.languages.node_mono_repo as node + +node.owlbot_main(relative_dir="packages/google-appengine",staging_excludes=["package.json"]) diff --git a/packages/google-appengine/package.json b/packages/google-appengine/package.json new file mode 100644 index 00000000000..3f751523028 --- /dev/null +++ b/packages/google-appengine/package.json @@ -0,0 +1,78 @@ +{ + "name": "@google-cloud/appengine-admin", + "version": "2.1.2", + "description": "Appengine client for Node.js", + "repository": { + "type": "git", + "directory": "packages/google-appengine", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "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 appengine", + "appengine", + "applications", + "authorized certificates", + "authorized domains", + "domain mappings", + "firewall", + "instances", + "services", + "versions" + ], + "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.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.6.0", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "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.0.0", + "typescript": "^4.6.4", + "webpack": "^5.24.4", + "webpack-cli": "^4.5.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-appengine" +} diff --git a/packages/google-appengine/protos/google/appengine/v1/app_yaml.proto b/packages/google-appengine/protos/google/appengine/v1/app_yaml.proto new file mode 100644 index 00000000000..8821853351b --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/app_yaml.proto @@ -0,0 +1,348 @@ +// 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.appengine.v1; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "AppYamlProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/) +// configuration for API handlers. +message ApiConfigHandler { + // Action to take when users access resources that require + // authentication. Defaults to `redirect`. + AuthFailAction auth_fail_action = 1; + + // Level of login required to access this resource. Defaults to + // `optional`. + LoginRequirement login = 2; + + // Path to the script from the application root directory. + string script = 3; + + // Security (HTTPS) enforcement for this URL. + SecurityLevel security_level = 4; + + // URL to serve the endpoint at. + string url = 5; +} + +// Custom static error page to be served when an error occurs. +message ErrorHandler { + // Error codes. + enum ErrorCode { + option allow_alias = true; + + // Not specified. ERROR_CODE_DEFAULT is assumed. + ERROR_CODE_UNSPECIFIED = 0; + + // All other error types. + ERROR_CODE_DEFAULT = 0; + + // Application has exceeded a resource quota. + ERROR_CODE_OVER_QUOTA = 1; + + // Client blocked by the application's Denial of Service protection + // configuration. + ERROR_CODE_DOS_API_DENIAL = 2; + + // Deadline reached before the application responds. + ERROR_CODE_TIMEOUT = 3; + } + + // Error condition this handler applies to. + ErrorCode error_code = 1; + + // Static file content to be served for this error. + string static_file = 2; + + // MIME type of file. Defaults to `text/html`. + string mime_type = 3; +} + +// URL pattern and description of how the URL should be handled. App Engine can +// handle URLs by executing application code or by serving static files +// uploaded with the version, such as images, CSS, or JavaScript. +message UrlMap { + // Redirect codes. + enum RedirectHttpResponseCode { + // Not specified. `302` is assumed. + REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED = 0; + + // `301 Moved Permanently` code. + REDIRECT_HTTP_RESPONSE_CODE_301 = 1; + + // `302 Moved Temporarily` code. + REDIRECT_HTTP_RESPONSE_CODE_302 = 2; + + // `303 See Other` code. + REDIRECT_HTTP_RESPONSE_CODE_303 = 3; + + // `307 Temporary Redirect` code. + REDIRECT_HTTP_RESPONSE_CODE_307 = 4; + } + + // URL prefix. Uses regular expression syntax, which means regexp + // special characters must be escaped, but should not contain groupings. + // All URLs that begin with this prefix are handled by this handler, using the + // portion of the URL after the prefix as part of the file path. + string url_regex = 1; + + // Type of handler for this URL pattern. + oneof handler_type { + // Returns the contents of a file, such as an image, as the response. + StaticFilesHandler static_files = 2; + + // Executes a script to handle the requests that match this URL + // pattern. Only the `auto` value is supported for Node.js in the + // App Engine standard environment, for example `"script": "auto"`. + ScriptHandler script = 3; + + // Uses API Endpoints to handle requests. + ApiEndpointHandler api_endpoint = 4; + } + + // Security (HTTPS) enforcement for this URL. + SecurityLevel security_level = 5; + + // Level of login required to access this resource. Not supported for Node.js + // in the App Engine standard environment. + LoginRequirement login = 6; + + // Action to take when users access resources that require + // authentication. Defaults to `redirect`. + AuthFailAction auth_fail_action = 7; + + // `30x` code to use when performing redirects for the `secure` field. + // Defaults to `302`. + RedirectHttpResponseCode redirect_http_response_code = 8; +} + +// Files served directly to the user for a given URL, such as images, CSS +// stylesheets, or JavaScript source files. Static file handlers describe which +// files in the application directory are static files, and which URLs serve +// them. +message StaticFilesHandler { + // Path to the static files matched by the URL pattern, from the + // application root directory. The path can refer to text matched in groupings + // in the URL pattern. + string path = 1; + + // Regular expression that matches the file paths for all files that should be + // referenced by this handler. + string upload_path_regex = 2; + + // HTTP headers to use for all responses from these URLs. + map http_headers = 3; + + // MIME type used to serve all files served by this handler. + // + // Defaults to file-specific MIME types, which are derived from each file's + // filename extension. + string mime_type = 4; + + // Time a static file served by this handler should be cached + // by web proxies and browsers. + google.protobuf.Duration expiration = 5; + + // Whether this handler should match the request if the file + // referenced by the handler does not exist. + bool require_matching_file = 6; + + // Whether files should also be uploaded as code data. By default, files + // declared in static file handlers are uploaded as static + // data and are only served to end users; they cannot be read by the + // application. If enabled, uploads are charged against both your code and + // static data storage resource quotas. + bool application_readable = 7; +} + +// Executes a script to handle the request that matches the URL pattern. +message ScriptHandler { + // Path to the script from the application root directory. + string script_path = 1; +} + +// Uses Google Cloud Endpoints to handle requests. +message ApiEndpointHandler { + // Path to the script from the application root directory. + string script_path = 1; +} + +// Health checking configuration for VM instances. Unhealthy instances +// are killed and replaced with new instances. Only applicable for +// instances in App Engine flexible environment. +message HealthCheck { + // Whether to explicitly disable health checks for this instance. + bool disable_health_check = 1; + + // Host header to send when performing an HTTP health check. + // Example: "myapp.appspot.com" + string host = 2; + + // Number of consecutive successful health checks required before receiving + // traffic. + uint32 healthy_threshold = 3; + + // Number of consecutive failed health checks required before removing + // traffic. + uint32 unhealthy_threshold = 4; + + // Number of consecutive failed health checks required before an instance is + // restarted. + uint32 restart_threshold = 5; + + // Interval between health checks. + google.protobuf.Duration check_interval = 6; + + // Time before the health check is considered failed. + google.protobuf.Duration timeout = 7; +} + +// Readiness checking configuration for VM instances. Unhealthy instances +// are removed from traffic rotation. +message ReadinessCheck { + // The request path. + string path = 1; + + // Host header to send when performing a HTTP Readiness check. + // Example: "myapp.appspot.com" + string host = 2; + + // Number of consecutive failed checks required before removing + // traffic. + uint32 failure_threshold = 3; + + // Number of consecutive successful checks required before receiving + // traffic. + uint32 success_threshold = 4; + + // Interval between health checks. + google.protobuf.Duration check_interval = 5; + + // Time before the check is considered failed. + google.protobuf.Duration timeout = 6; + + // A maximum time limit on application initialization, measured from moment + // the application successfully replies to a healthcheck until it is ready to + // serve traffic. + google.protobuf.Duration app_start_timeout = 7; +} + +// Health checking configuration for VM instances. Unhealthy instances +// are killed and replaced with new instances. +message LivenessCheck { + // The request path. + string path = 1; + + // Host header to send when performing a HTTP Liveness check. + // Example: "myapp.appspot.com" + string host = 2; + + // Number of consecutive failed checks required before considering the + // VM unhealthy. + uint32 failure_threshold = 3; + + // Number of consecutive successful checks required before considering + // the VM healthy. + uint32 success_threshold = 4; + + // Interval between health checks. + google.protobuf.Duration check_interval = 5; + + // Time before the check is considered failed. + google.protobuf.Duration timeout = 6; + + // The initial delay before starting to execute the checks. + google.protobuf.Duration initial_delay = 7; +} + +// Third-party Python runtime library that is required by the application. +message Library { + // Name of the library. Example: "django". + string name = 1; + + // Version of the library to select, or "latest". + string version = 2; +} + +// Actions to take when the user is not logged in. +enum AuthFailAction { + // Not specified. `AUTH_FAIL_ACTION_REDIRECT` is assumed. + AUTH_FAIL_ACTION_UNSPECIFIED = 0; + + // Redirects user to "accounts.google.com". The user is redirected back to the + // application URL after signing in or creating an account. + AUTH_FAIL_ACTION_REDIRECT = 1; + + // Rejects request with a `401` HTTP status code and an error + // message. + AUTH_FAIL_ACTION_UNAUTHORIZED = 2; +} + +// Methods to restrict access to a URL based on login status. +enum LoginRequirement { + // Not specified. `LOGIN_OPTIONAL` is assumed. + LOGIN_UNSPECIFIED = 0; + + // Does not require that the user is signed in. + LOGIN_OPTIONAL = 1; + + // If the user is not signed in, the `auth_fail_action` is taken. + // In addition, if the user is not an administrator for the + // application, they are given an error message regardless of + // `auth_fail_action`. If the user is an administrator, the handler + // proceeds. + LOGIN_ADMIN = 2; + + // If the user has signed in, the handler proceeds normally. Otherwise, the + // auth_fail_action is taken. + LOGIN_REQUIRED = 3; +} + +// Methods to enforce security (HTTPS) on a URL. +enum SecurityLevel { + option allow_alias = true; + + // Not specified. + SECURE_UNSPECIFIED = 0; + + // Both HTTP and HTTPS requests with URLs that match the handler succeed + // without redirects. The application can examine the request to determine + // which protocol was used, and respond accordingly. + SECURE_DEFAULT = 0; + + // Requests for a URL that match this handler that use HTTPS are automatically + // redirected to the HTTP equivalent URL. + SECURE_NEVER = 1; + + // Both HTTP and HTTPS requests with URLs that match the handler succeed + // without redirects. The application can examine the request to determine + // which protocol was used and respond accordingly. + SECURE_OPTIONAL = 2; + + // Requests for a URL that match this handler that do not use HTTPS are + // automatically redirected to the HTTPS URL with the same path. Query + // parameters are reserved for the redirect. + SECURE_ALWAYS = 3; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/appengine.proto b/packages/google-appengine/protos/google/appengine/v1/appengine.proto new file mode 100644 index 00000000000..76eb230fade --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/appengine.proto @@ -0,0 +1,1008 @@ +// 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.appengine.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/appengine/v1/application.proto"; +import "google/appengine/v1/certificate.proto"; +import "google/appengine/v1/domain.proto"; +import "google/appengine/v1/domain_mapping.proto"; +import "google/appengine/v1/firewall.proto"; +import "google/appengine/v1/instance.proto"; +import "google/appengine/v1/service.proto"; +import "google/appengine/v1/version.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "AppengineProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// Manages App Engine applications. +service Applications { + option (google.api.default_host) = "appengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/appengine.admin," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Gets information about an application. + rpc GetApplication(GetApplicationRequest) returns (Application) { + option (google.api.http) = { + get: "/v1/{name=apps/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an App Engine application for a Google Cloud Platform project. + // Required fields: + // + // * `id` - The ID of the target Cloud Platform project. + // * *location* - The [region](https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located. + // + // For more information about App Engine applications, see [Managing Projects, Applications, and Billing](https://cloud.google.com/appengine/docs/standard/python/console/). + rpc CreateApplication(CreateApplicationRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/apps" + body: "application" + }; + option (google.longrunning.operation_info) = { + response_type: "Application" + metadata_type: "OperationMetadataV1" + }; + } + + // Updates the specified Application resource. + // You can update the following fields: + // + // * `auth_domain` - Google authentication domain for controlling user access to the application. + // * `default_cookie_expiration` - Cookie expiration policy for the application. + // * `iap` - Identity-Aware Proxy properties for the application. + rpc UpdateApplication(UpdateApplicationRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=apps/*}" + body: "application" + }; + option (google.longrunning.operation_info) = { + response_type: "Application" + metadata_type: "OperationMetadataV1" + }; + } + + // Recreates the required App Engine features for the specified App Engine + // application, for example a Cloud Storage bucket or App Engine service + // account. + // Use this method if you receive an error message about a missing feature, + // for example, *Error retrieving the App Engine service account*. + // If you have deleted your App Engine service account, this will + // not be able to recreate it. Instead, you should attempt to use the + // IAM undelete API if possible at https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B"name"%3A"projects%2F-%2FserviceAccounts%2Funique_id"%2C"resource"%3A%7B%7D%7D . + // If the deletion was recent, the numeric ID can be found in the Cloud + // Console Activity Log. + rpc RepairApplication(RepairApplicationRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=apps/*}:repair" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Application" + metadata_type: "OperationMetadataV1" + }; + } +} + +// Request message for `Applications.GetApplication`. +message GetApplicationRequest { + // Name of the Application resource to get. Example: `apps/myapp`. + string name = 1; +} + +// Request message for `Applications.CreateApplication`. +message CreateApplicationRequest { + // Application configuration. + Application application = 2; +} + +// Request message for `Applications.UpdateApplication`. +message UpdateApplicationRequest { + // Name of the Application resource to update. Example: `apps/myapp`. + string name = 1; + + // An Application containing the updated resource. + Application application = 2; + + // Required. Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for 'Applications.RepairApplication'. +message RepairApplicationRequest { + // Name of the application to repair. Example: `apps/myapp` + string name = 1; +} + +// Manages services of an application. +service Services { + option (google.api.default_host) = "appengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/appengine.admin," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists all the services in the application. + rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { + option (google.api.http) = { + get: "/v1/{parent=apps/*}/services" + }; + } + + // Gets the current configuration of the specified service. + rpc GetService(GetServiceRequest) returns (Service) { + option (google.api.http) = { + get: "/v1/{name=apps/*/services/*}" + }; + } + + // Updates the configuration of the specified service. + rpc UpdateService(UpdateServiceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=apps/*/services/*}" + body: "service" + }; + option (google.longrunning.operation_info) = { + response_type: "Service" + metadata_type: "OperationMetadataV1" + }; + } + + // Deletes the specified service and all enclosed versions. + rpc DeleteService(DeleteServiceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=apps/*/services/*}" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadataV1" + }; + } +} + +// Request message for `Services.ListServices`. +message ListServicesRequest { + // Name of the parent Application resource. Example: `apps/myapp`. + string parent = 1; + + // Maximum results to return per page. + int32 page_size = 2; + + // Continuation token for fetching the next page of results. + string page_token = 3; +} + +// Response message for `Services.ListServices`. +message ListServicesResponse { + // The services belonging to the requested application. + repeated Service services = 1; + + // Continuation token for fetching the next page of results. + string next_page_token = 2; +} + +// Request message for `Services.GetService`. +message GetServiceRequest { + // Name of the resource requested. Example: `apps/myapp/services/default`. + string name = 1; +} + +// Request message for `Services.UpdateService`. +message UpdateServiceRequest { + // Name of the resource to update. Example: `apps/myapp/services/default`. + string name = 1; + + // A Service resource containing the updated service. Only fields set in the + // field mask will be updated. + Service service = 2; + + // Required. Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 3; + + // Set to `true` to gradually shift traffic to one or more versions that you + // specify. By default, traffic is shifted immediately. + // For gradual traffic migration, the target versions + // must be located within instances that are configured for both + // [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType) + // and + // [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling). + // You must specify the + // [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy) + // field in the Service resource. Gradual traffic migration is not + // supported in the App Engine flexible environment. For examples, see + // [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + bool migrate_traffic = 4; +} + +// Request message for `Services.DeleteService`. +message DeleteServiceRequest { + // Name of the resource requested. Example: `apps/myapp/services/default`. + string name = 1; +} + +// Manages versions of a service. +service Versions { + option (google.api.default_host) = "appengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/appengine.admin," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists the versions of a service. + rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=apps/*/services/*}/versions" + }; + } + + // Gets the specified Version resource. + // By default, only a `BASIC_VIEW` will be returned. + // Specify the `FULL_VIEW` parameter to get the full resource. + rpc GetVersion(GetVersionRequest) returns (Version) { + option (google.api.http) = { + get: "/v1/{name=apps/*/services/*/versions/*}" + }; + } + + // Deploys code and resource files to a new version. + rpc CreateVersion(CreateVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=apps/*/services/*}/versions" + body: "version" + }; + option (google.longrunning.operation_info) = { + response_type: "Version" + metadata_type: "CreateVersionMetadataV1" + }; + } + + // Updates the specified Version resource. + // You can specify the following fields depending on the App Engine + // environment and type of scaling that the version resource uses: + // + // **Standard environment** + // + // * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class) + // + // *automatic scaling* in the standard environment: + // + // * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + // * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + // * [`automaticScaling.standard_scheduler_settings.max_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) + // * [`automaticScaling.standard_scheduler_settings.min_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) + // * [`automaticScaling.standard_scheduler_settings.target_cpu_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) + // * [`automaticScaling.standard_scheduler_settings.target_throughput_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) + // + // *basic scaling* or *manual scaling* in the standard environment: + // + // * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status) + // * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling) + // + // **Flexible environment** + // + // * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status) + // + // *automatic scaling* in the flexible environment: + // + // * [`automatic_scaling.min_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + // * [`automatic_scaling.max_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + // * [`automatic_scaling.cool_down_period_sec`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + // * [`automatic_scaling.cpu_utilization.target_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + // + // *manual scaling* in the flexible environment: + // + // * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling) + rpc UpdateVersion(UpdateVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=apps/*/services/*/versions/*}" + body: "version" + }; + option (google.longrunning.operation_info) = { + response_type: "Version" + metadata_type: "OperationMetadataV1" + }; + } + + // Deletes an existing Version resource. + rpc DeleteVersion(DeleteVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=apps/*/services/*/versions/*}" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadataV1" + }; + } +} + +// Request message for `Versions.ListVersions`. +message ListVersionsRequest { + // Name of the parent Service resource. Example: + // `apps/myapp/services/default`. + string parent = 1; + + // Controls the set of fields returned in the `List` response. + VersionView view = 2; + + // Maximum results to return per page. + int32 page_size = 3; + + // Continuation token for fetching the next page of results. + string page_token = 4; +} + +// Response message for `Versions.ListVersions`. +message ListVersionsResponse { + // The versions belonging to the requested service. + repeated Version versions = 1; + + // Continuation token for fetching the next page of results. + string next_page_token = 2; +} + +// Fields that should be returned when [Version][google.appengine.v1.Version] resources +// are retrieved. +enum VersionView { + // Basic version information including scaling and inbound services, + // but not detailed deployment information. + BASIC = 0; + + // The information from `BASIC`, plus detailed information about the + // deployment. This format is required when creating resources, but + // is not returned in `Get` or `List` by default. + FULL = 1; +} + +// Request message for `Versions.GetVersion`. +message GetVersionRequest { + // Name of the resource requested. Example: + // `apps/myapp/services/default/versions/v1`. + string name = 1; + + // Controls the set of fields returned in the `Get` response. + VersionView view = 2; +} + +// Request message for `Versions.CreateVersion`. +message CreateVersionRequest { + // Name of the parent resource to create this version under. Example: + // `apps/myapp/services/default`. + string parent = 1; + + // Application deployment configuration. + Version version = 2; +} + +// Request message for `Versions.UpdateVersion`. +message UpdateVersionRequest { + // Name of the resource to update. Example: + // `apps/myapp/services/default/versions/1`. + string name = 1; + + // A Version containing the updated resource. Only fields set in the field + // mask will be updated. + Version version = 2; + + // Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for `Versions.DeleteVersion`. +message DeleteVersionRequest { + // Name of the resource requested. Example: + // `apps/myapp/services/default/versions/v1`. + string name = 1; +} + +// Manages instances of a version. +service Instances { + option (google.api.default_host) = "appengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/appengine.admin," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists the instances of a version. + // + // Tip: To aggregate details about instances over time, see the + // [Stackdriver Monitoring API](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=apps/*/services/*/versions/*}/instances" + }; + } + + // Gets instance information. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=apps/*/services/*/versions/*/instances/*}" + }; + } + + // Stops a running instance. + // + // The instance might be automatically recreated based on the scaling settings + // of the version. For more information, see "How Instances are Managed" + // ([standard environment](https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed) | + // [flexible environment](https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed)). + // + // To ensure that instances are not re-created and avoid getting billed, you + // can stop all instances within the target version by changing the serving + // status of the version to `STOPPED` with the + // [`apps.services.versions.patch`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch) + // method. + rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=apps/*/services/*/versions/*/instances/*}" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadataV1" + }; + } + + // Enables debugging on a VM instance. This allows you to use the SSH + // command to connect to the virtual machine where the instance lives. + // While in "debug mode", the instance continues to serve live traffic. + // You should delete the instance when you are done debugging and then + // allow the system to take over and determine if another instance + // should be started. + // + // Only applicable for instances in App Engine flexible environment. + rpc DebugInstance(DebugInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=apps/*/services/*/versions/*/instances/*}:debug" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadataV1" + }; + } +} + +// Request message for `Instances.ListInstances`. +message ListInstancesRequest { + // Name of the parent Version resource. Example: + // `apps/myapp/services/default/versions/v1`. + string parent = 1; + + // Maximum results to return per page. + int32 page_size = 2; + + // Continuation token for fetching the next page of results. + string page_token = 3; +} + +// Response message for `Instances.ListInstances`. +message ListInstancesResponse { + // The instances belonging to the requested version. + repeated Instance instances = 1; + + // Continuation token for fetching the next page of results. + string next_page_token = 2; +} + +// Request message for `Instances.GetInstance`. +message GetInstanceRequest { + // Name of the resource requested. Example: + // `apps/myapp/services/default/versions/v1/instances/instance-1`. + string name = 1; +} + +// Request message for `Instances.DeleteInstance`. +message DeleteInstanceRequest { + // Name of the resource requested. Example: + // `apps/myapp/services/default/versions/v1/instances/instance-1`. + string name = 1; +} + +// Request message for `Instances.DebugInstance`. +message DebugInstanceRequest { + // Name of the resource requested. Example: + // `apps/myapp/services/default/versions/v1/instances/instance-1`. + string name = 1; + + // Public SSH key to add to the instance. Examples: + // + // * `[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]` + // * `[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}` + // + // For more information, see + // [Adding and Removing SSH Keys](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). + string ssh_key = 2; +} + +// Firewall resources are used to define a collection of access control rules +// for an Application. Each rule is defined with a position which specifies +// the rule's order in the sequence of rules, an IP range to be matched against +// requests, and an action to take upon matching requests. +// +// Every request is evaluated against the Firewall rules in priority order. +// Processesing stops at the first rule which matches the request's IP address. +// A final rule always specifies an action that applies to all remaining +// IP addresses. The default final rule for a newly-created application will be +// set to "allow" if not otherwise specified by the user. +service Firewall { + option (google.api.default_host) = "appengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/appengine.admin," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists the firewall rules of an application. + rpc ListIngressRules(ListIngressRulesRequest) returns (ListIngressRulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=apps/*}/firewall/ingressRules" + }; + } + + // Replaces the entire firewall ruleset in one bulk operation. This overrides + // and replaces the rules of an existing firewall with the new rules. + // + // If the final rule does not match traffic with the '*' wildcard IP range, + // then an "allow all" rule is explicitly added to the end of the list. + rpc BatchUpdateIngressRules(BatchUpdateIngressRulesRequest) returns (BatchUpdateIngressRulesResponse) { + option (google.api.http) = { + post: "/v1/{name=apps/*/firewall/ingressRules}:batchUpdate" + body: "*" + }; + } + + // Creates a firewall rule for the application. + rpc CreateIngressRule(CreateIngressRuleRequest) returns (google.appengine.v1.FirewallRule) { + option (google.api.http) = { + post: "/v1/{parent=apps/*}/firewall/ingressRules" + body: "rule" + }; + } + + // Gets the specified firewall rule. + rpc GetIngressRule(GetIngressRuleRequest) returns (google.appengine.v1.FirewallRule) { + option (google.api.http) = { + get: "/v1/{name=apps/*/firewall/ingressRules/*}" + }; + } + + // Updates the specified firewall rule. + rpc UpdateIngressRule(UpdateIngressRuleRequest) returns (google.appengine.v1.FirewallRule) { + option (google.api.http) = { + patch: "/v1/{name=apps/*/firewall/ingressRules/*}" + body: "rule" + }; + } + + // Deletes the specified firewall rule. + rpc DeleteIngressRule(DeleteIngressRuleRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=apps/*/firewall/ingressRules/*}" + }; + } +} + +// Request message for `Firewall.ListIngressRules`. +message ListIngressRulesRequest { + // Name of the Firewall collection to retrieve. + // Example: `apps/myapp/firewall/ingressRules`. + string parent = 1; + + // Maximum results to return per page. + int32 page_size = 2; + + // Continuation token for fetching the next page of results. + string page_token = 3; + + // A valid IP Address. If set, only rules matching this address will be + // returned. The first returned rule will be the rule that fires on requests + // from this IP. + string matching_address = 4; +} + +// Response message for `Firewall.ListIngressRules`. +message ListIngressRulesResponse { + // The ingress FirewallRules for this application. + repeated google.appengine.v1.FirewallRule ingress_rules = 1; + + // Continuation token for fetching the next page of results. + string next_page_token = 2; +} + +// Request message for `Firewall.BatchUpdateIngressRules`. +message BatchUpdateIngressRulesRequest { + // Name of the Firewall collection to set. + // Example: `apps/myapp/firewall/ingressRules`. + string name = 1; + + // A list of FirewallRules to replace the existing set. + repeated google.appengine.v1.FirewallRule ingress_rules = 2; +} + +// Response message for `Firewall.UpdateAllIngressRules`. +message BatchUpdateIngressRulesResponse { + // The full list of ingress FirewallRules for this application. + repeated google.appengine.v1.FirewallRule ingress_rules = 1; +} + +// Request message for `Firewall.CreateIngressRule`. +message CreateIngressRuleRequest { + // Name of the parent Firewall collection in which to create a new rule. + // Example: `apps/myapp/firewall/ingressRules`. + string parent = 1; + + // A FirewallRule containing the new resource. + // + // The user may optionally provide a position at which the new rule will be + // placed. The positions define a sequential list starting at 1. If a rule + // already exists at the given position, rules greater than the provided + // position will be moved forward by one. + // + // If no position is provided, the server will place the rule as the second to + // last rule in the sequence before the required default allow-all or deny-all + // rule. + google.appengine.v1.FirewallRule rule = 2; +} + +// Request message for `Firewall.GetIngressRule`. +message GetIngressRuleRequest { + // Name of the Firewall resource to retrieve. + // Example: `apps/myapp/firewall/ingressRules/100`. + string name = 1; +} + +// Request message for `Firewall.UpdateIngressRule`. +message UpdateIngressRuleRequest { + // Name of the Firewall resource to update. + // Example: `apps/myapp/firewall/ingressRules/100`. + string name = 1; + + // A FirewallRule containing the updated resource + google.appengine.v1.FirewallRule rule = 2; + + // Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for `Firewall.DeleteIngressRule`. +message DeleteIngressRuleRequest { + // Name of the Firewall resource to delete. + // Example: `apps/myapp/firewall/ingressRules/100`. + string name = 1; +} + +// Manages domains a user is authorized to administer. To authorize use of a +// domain, verify ownership via +// [Webmaster Central](https://www.google.com/webmasters/verification/home). +service AuthorizedDomains { + option (google.api.default_host) = "appengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/appengine.admin," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists all domains the user is authorized to administer. + rpc ListAuthorizedDomains(ListAuthorizedDomainsRequest) returns (ListAuthorizedDomainsResponse) { + option (google.api.http) = { + get: "/v1/{parent=apps/*}/authorizedDomains" + }; + } +} + +// Request message for `AuthorizedDomains.ListAuthorizedDomains`. +message ListAuthorizedDomainsRequest { + // Name of the parent Application resource. Example: `apps/myapp`. + string parent = 1; + + // Maximum results to return per page. + int32 page_size = 2; + + // Continuation token for fetching the next page of results. + string page_token = 3; +} + +// Response message for `AuthorizedDomains.ListAuthorizedDomains`. +message ListAuthorizedDomainsResponse { + // The authorized domains belonging to the user. + repeated google.appengine.v1.AuthorizedDomain domains = 1; + + // Continuation token for fetching the next page of results. + string next_page_token = 2; +} + +// Manages SSL certificates a user is authorized to administer. A user can +// administer any SSL certificates applicable to their authorized domains. +service AuthorizedCertificates { + option (google.api.default_host) = "appengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/appengine.admin," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists all SSL certificates the user is authorized to administer. + rpc ListAuthorizedCertificates(ListAuthorizedCertificatesRequest) returns (ListAuthorizedCertificatesResponse) { + option (google.api.http) = { + get: "/v1/{parent=apps/*}/authorizedCertificates" + }; + } + + // Gets the specified SSL certificate. + rpc GetAuthorizedCertificate(GetAuthorizedCertificateRequest) returns (google.appengine.v1.AuthorizedCertificate) { + option (google.api.http) = { + get: "/v1/{name=apps/*/authorizedCertificates/*}" + }; + } + + // Uploads the specified SSL certificate. + rpc CreateAuthorizedCertificate(CreateAuthorizedCertificateRequest) returns (google.appengine.v1.AuthorizedCertificate) { + option (google.api.http) = { + post: "/v1/{parent=apps/*}/authorizedCertificates" + body: "certificate" + }; + } + + // Updates the specified SSL certificate. To renew a certificate and maintain + // its existing domain mappings, update `certificate_data` with a new + // certificate. The new certificate must be applicable to the same domains as + // the original certificate. The certificate `display_name` may also be + // updated. + rpc UpdateAuthorizedCertificate(UpdateAuthorizedCertificateRequest) returns (google.appengine.v1.AuthorizedCertificate) { + option (google.api.http) = { + patch: "/v1/{name=apps/*/authorizedCertificates/*}" + body: "certificate" + }; + } + + // Deletes the specified SSL certificate. + rpc DeleteAuthorizedCertificate(DeleteAuthorizedCertificateRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=apps/*/authorizedCertificates/*}" + }; + } +} + +// Request message for `AuthorizedCertificates.ListAuthorizedCertificates`. +message ListAuthorizedCertificatesRequest { + // Name of the parent `Application` resource. Example: `apps/myapp`. + string parent = 1; + + // Controls the set of fields returned in the `LIST` response. + AuthorizedCertificateView view = 4; + + // Maximum results to return per page. + int32 page_size = 2; + + // Continuation token for fetching the next page of results. + string page_token = 3; +} + +// Response message for `AuthorizedCertificates.ListAuthorizedCertificates`. +message ListAuthorizedCertificatesResponse { + // The SSL certificates the user is authorized to administer. + repeated google.appengine.v1.AuthorizedCertificate certificates = 1; + + // Continuation token for fetching the next page of results. + string next_page_token = 2; +} + +// Request message for `AuthorizedCertificates.GetAuthorizedCertificate`. +message GetAuthorizedCertificateRequest { + // Name of the resource requested. Example: + // `apps/myapp/authorizedCertificates/12345`. + string name = 1; + + // Controls the set of fields returned in the `GET` response. + AuthorizedCertificateView view = 2; +} + +// Fields that should be returned when an AuthorizedCertificate resource is +// retrieved. +enum AuthorizedCertificateView { + // Basic certificate information, including applicable domains and expiration + // date. + BASIC_CERTIFICATE = 0; + + // The information from `BASIC_CERTIFICATE`, plus detailed information on the + // domain mappings that have this certificate mapped. + FULL_CERTIFICATE = 1; +} + +// Request message for `AuthorizedCertificates.CreateAuthorizedCertificate`. +message CreateAuthorizedCertificateRequest { + // Name of the parent `Application` resource. Example: `apps/myapp`. + string parent = 1; + + // SSL certificate data. + google.appengine.v1.AuthorizedCertificate certificate = 2; +} + +// Request message for `AuthorizedCertificates.UpdateAuthorizedCertificate`. +message UpdateAuthorizedCertificateRequest { + // Name of the resource to update. Example: + // `apps/myapp/authorizedCertificates/12345`. + string name = 1; + + // An `AuthorizedCertificate` containing the updated resource. Only fields set + // in the field mask will be updated. + google.appengine.v1.AuthorizedCertificate certificate = 2; + + // Standard field mask for the set of fields to be updated. Updates are only + // supported on the `certificate_raw_data` and `display_name` fields. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for `AuthorizedCertificates.DeleteAuthorizedCertificate`. +message DeleteAuthorizedCertificateRequest { + // Name of the resource to delete. Example: + // `apps/myapp/authorizedCertificates/12345`. + string name = 1; +} + +// Manages domains serving an application. +service DomainMappings { + option (google.api.default_host) = "appengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/appengine.admin," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists the domain mappings on an application. + rpc ListDomainMappings(ListDomainMappingsRequest) returns (ListDomainMappingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=apps/*}/domainMappings" + }; + } + + // Gets the specified domain mapping. + rpc GetDomainMapping(GetDomainMappingRequest) returns (google.appengine.v1.DomainMapping) { + option (google.api.http) = { + get: "/v1/{name=apps/*/domainMappings/*}" + }; + } + + // Maps a domain to an application. A user must be authorized to administer a + // domain in order to map it to an application. For a list of available + // authorized domains, see [`AuthorizedDomains.ListAuthorizedDomains`](). + rpc CreateDomainMapping(CreateDomainMappingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=apps/*}/domainMappings" + body: "domain_mapping" + }; + option (google.longrunning.operation_info) = { + response_type: "DomainMapping" + metadata_type: "OperationMetadataV1" + }; + } + + // Updates the specified domain mapping. To map an SSL certificate to a + // domain mapping, update `certificate_id` to point to an `AuthorizedCertificate` + // resource. A user must be authorized to administer the associated domain + // in order to update a `DomainMapping` resource. + rpc UpdateDomainMapping(UpdateDomainMappingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=apps/*/domainMappings/*}" + body: "domain_mapping" + }; + option (google.longrunning.operation_info) = { + response_type: "DomainMapping" + metadata_type: "OperationMetadataV1" + }; + } + + // Deletes the specified domain mapping. A user must be authorized to + // administer the associated domain in order to delete a `DomainMapping` + // resource. + rpc DeleteDomainMapping(DeleteDomainMappingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=apps/*/domainMappings/*}" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadataV1" + }; + } +} + +// Request message for `DomainMappings.ListDomainMappings`. +message ListDomainMappingsRequest { + // Name of the parent Application resource. Example: `apps/myapp`. + string parent = 1; + + // Maximum results to return per page. + int32 page_size = 2; + + // Continuation token for fetching the next page of results. + string page_token = 3; +} + +// Response message for `DomainMappings.ListDomainMappings`. +message ListDomainMappingsResponse { + // The domain mappings for the application. + repeated google.appengine.v1.DomainMapping domain_mappings = 1; + + // Continuation token for fetching the next page of results. + string next_page_token = 2; +} + +// Request message for `DomainMappings.GetDomainMapping`. +message GetDomainMappingRequest { + // Name of the resource requested. Example: + // `apps/myapp/domainMappings/example.com`. + string name = 1; +} + +// Override strategy for mutating an existing mapping. +enum DomainOverrideStrategy { + // Strategy unspecified. Defaults to `STRICT`. + UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY = 0; + + // Overrides not allowed. If a mapping already exists for the + // specified domain, the request will return an ALREADY_EXISTS (409). + STRICT = 1; + + // Overrides allowed. If a mapping already exists for the specified domain, + // the request will overwrite it. Note that this might stop another + // Google product from serving. For example, if the domain is + // mapped to another App Engine application, that app will no + // longer serve from that domain. + OVERRIDE = 2; +} + +// Request message for `DomainMappings.CreateDomainMapping`. +message CreateDomainMappingRequest { + // Name of the parent Application resource. Example: `apps/myapp`. + string parent = 1; + + // Domain mapping configuration. + google.appengine.v1.DomainMapping domain_mapping = 2; + + // Whether the domain creation should override any existing mappings for this + // domain. By default, overrides are rejected. + DomainOverrideStrategy override_strategy = 4; +} + +// Request message for `DomainMappings.UpdateDomainMapping`. +message UpdateDomainMappingRequest { + // Name of the resource to update. Example: + // `apps/myapp/domainMappings/example.com`. + string name = 1; + + // A domain mapping containing the updated resource. Only fields set + // in the field mask will be updated. + google.appengine.v1.DomainMapping domain_mapping = 2; + + // Required. Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for `DomainMappings.DeleteDomainMapping`. +message DeleteDomainMappingRequest { + // Name of the resource to delete. Example: + // `apps/myapp/domainMappings/example.com`. + string name = 1; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/application.proto b/packages/google-appengine/protos/google/appengine/v1/application.proto new file mode 100644 index 00000000000..bc9c3f5dcd3 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/application.proto @@ -0,0 +1,198 @@ +// 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.appengine.v1; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "ApplicationProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// An Application resource contains the top-level configuration of an App +// Engine application. +message Application { + enum ServingStatus { + // Serving status is unspecified. + UNSPECIFIED = 0; + + // Application is serving. + SERVING = 1; + + // Application has been disabled by the user. + USER_DISABLED = 2; + + // Application has been disabled by the system. + SYSTEM_DISABLED = 3; + } + + // Identity-Aware Proxy + message IdentityAwareProxy { + // Whether the serving infrastructure will authenticate and + // authorize all incoming requests. + // + // If true, the `oauth2_client_id` and `oauth2_client_secret` + // fields must be non-empty. + bool enabled = 1; + + // OAuth2 client ID to use for the authentication flow. + string oauth2_client_id = 2; + + // OAuth2 client secret to use for the authentication flow. + // + // For security reasons, this value cannot be retrieved via the API. + // Instead, the SHA-256 hash of the value is returned in the + // `oauth2_client_secret_sha256` field. + // + // @InputOnly + string oauth2_client_secret = 3; + + // Hex-encoded SHA-256 hash of the client secret. + // + // @OutputOnly + string oauth2_client_secret_sha256 = 4; + } + + enum DatabaseType { + // Database type is unspecified. + DATABASE_TYPE_UNSPECIFIED = 0; + + // Cloud Datastore + CLOUD_DATASTORE = 1; + + // Cloud Firestore Native + CLOUD_FIRESTORE = 2; + + // Cloud Firestore in Datastore Mode + CLOUD_DATASTORE_COMPATIBILITY = 3; + } + + // The feature specific settings to be used in the application. These define + // behaviors that are user configurable. + message FeatureSettings { + // Boolean value indicating if split health checks should be used instead + // of the legacy health checks. At an app.yaml level, this means defaulting + // to 'readiness_check' and 'liveness_check' values instead of + // 'health_check' ones. Once the legacy 'health_check' behavior is + // deprecated, and this value is always true, this setting can + // be removed. + bool split_health_checks = 1; + + // If true, use [Container-Optimized OS](https://cloud.google.com/container-optimized-os/) + // base image for VMs, rather than a base Debian image. + bool use_container_optimized_os = 2; + } + + // Full path to the Application resource in the API. + // Example: `apps/myapp`. + // + // @OutputOnly + string name = 1; + + // Identifier of the Application resource. This identifier is equivalent + // to the project ID of the Google Cloud Platform project where you want to + // deploy your application. + // Example: `myapp`. + string id = 2; + + // HTTP path dispatch rules for requests to the application that do not + // explicitly target a service or version. Rules are order-dependent. + // Up to 20 dispatch rules can be supported. + repeated UrlDispatchRule dispatch_rules = 3; + + // Google Apps authentication domain that controls which users can access + // this application. + // + // Defaults to open access for any Google Account. + string auth_domain = 6; + + // Location from which this application runs. Application instances + // run out of the data centers in the specified location, which is also where + // all of the application's end user content is stored. + // + // Defaults to `us-central`. + // + // View the list of + // [supported locations](https://cloud.google.com/appengine/docs/locations). + string location_id = 7; + + // Google Cloud Storage bucket that can be used for storing files + // associated with this application. This bucket is associated with the + // application and can be used by the gcloud deployment commands. + // + // @OutputOnly + string code_bucket = 8; + + // Cookie expiration policy for this application. + google.protobuf.Duration default_cookie_expiration = 9; + + // Serving status of this application. + ServingStatus serving_status = 10; + + // Hostname used to reach this application, as resolved by App Engine. + // + // @OutputOnly + string default_hostname = 11; + + // Google Cloud Storage bucket that can be used by this application to store + // content. + // + // @OutputOnly + string default_bucket = 12; + + // The service account associated with the application. + // This is the app-level default identity. If no identity provided during + // create version, Admin API will fallback to this one. + string service_account = 13; + + IdentityAwareProxy iap = 14; + + // The Google Container Registry domain used for storing managed build docker + // images for this application. + string gcr_domain = 16; + + // The type of the Cloud Firestore or Cloud Datastore database associated with + // this application. + DatabaseType database_type = 17; + + // The feature specific settings to be used in the application. + FeatureSettings feature_settings = 18; +} + +// Rules to match an HTTP request and dispatch that request to a service. +message UrlDispatchRule { + // Domain name to match against. The wildcard "`*`" is supported if + // specified before a period: "`*.`". + // + // Defaults to matching all domains: "`*`". + string domain = 1; + + // Pathname within the host. Must start with a "`/`". A + // single "`*`" can be included at the end of the path. + // + // The sum of the lengths of the domain and path may not + // exceed 100 characters. + string path = 2; + + // Resource ID of a service in this application that should + // serve the matched request. The service must already + // exist. Example: `default`. + string service = 3; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/audit_data.proto b/packages/google-appengine/protos/google/appengine/v1/audit_data.proto new file mode 100644 index 00000000000..d839280dfd9 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/audit_data.proto @@ -0,0 +1,54 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.appengine.v1; + +import "google/appengine/v1/appengine.proto"; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "AuditDataProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// App Engine admin service audit log. +message AuditData { + // Detailed information about methods that require it. Does not include + // simple Get, List or Delete methods because all significant information + // (resource name, number of returned elements for List operations) is already + // included in parent audit log message. + oneof method { + // Detailed information about UpdateService call. + UpdateServiceMethod update_service = 1; + + // Detailed information about CreateVersion call. + CreateVersionMethod create_version = 2; + } +} + +// Detailed information about UpdateService call. +message UpdateServiceMethod { + // Update service request. + UpdateServiceRequest request = 1; +} + +// Detailed information about CreateVersion call. +message CreateVersionMethod { + // Create version request. + CreateVersionRequest request = 1; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/certificate.proto b/packages/google-appengine/protos/google/appengine/v1/certificate.proto new file mode 100644 index 00000000000..037465be782 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/certificate.proto @@ -0,0 +1,172 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.appengine.v1; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "CertificateProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// An SSL certificate that a user has been authorized to administer. A user +// is authorized to administer any certificate that applies to one of their +// authorized domains. +message AuthorizedCertificate { + // Full path to the `AuthorizedCertificate` resource in the API. Example: + // `apps/myapp/authorizedCertificates/12345`. + // + // @OutputOnly + string name = 1; + + // Relative name of the certificate. This is a unique value autogenerated + // on `AuthorizedCertificate` resource creation. Example: `12345`. + // + // @OutputOnly + string id = 2; + + // The user-specified display name of the certificate. This is not + // guaranteed to be unique. Example: `My Certificate`. + string display_name = 3; + + // Topmost applicable domains of this certificate. This certificate + // applies to these domains and their subdomains. Example: `example.com`. + // + // @OutputOnly + repeated string domain_names = 4; + + // The time when this certificate expires. To update the renewal time on this + // certificate, upload an SSL certificate with a different expiration time + // using [`AuthorizedCertificates.UpdateAuthorizedCertificate`](). + // + // @OutputOnly + google.protobuf.Timestamp expire_time = 5; + + // The SSL certificate serving the `AuthorizedCertificate` resource. This + // must be obtained independently from a certificate authority. + CertificateRawData certificate_raw_data = 6; + + // Only applicable if this certificate is managed by App Engine. Managed + // certificates are tied to the lifecycle of a `DomainMapping` and cannot be + // updated or deleted via the `AuthorizedCertificates` API. If this + // certificate is manually administered by the user, this field will be empty. + // + // @OutputOnly + ManagedCertificate managed_certificate = 7; + + // The full paths to user visible Domain Mapping resources that have this + // certificate mapped. Example: `apps/myapp/domainMappings/example.com`. + // + // This may not represent the full list of mapped domain mappings if the user + // does not have `VIEWER` permissions on all of the applications that have + // this certificate mapped. See `domain_mappings_count` for a complete count. + // + // Only returned by `GET` or `LIST` requests when specifically requested by + // the `view=FULL_CERTIFICATE` option. + // + // @OutputOnly + repeated string visible_domain_mappings = 8; + + // Aggregate count of the domain mappings with this certificate mapped. This + // count includes domain mappings on applications for which the user does not + // have `VIEWER` permissions. + // + // Only returned by `GET` or `LIST` requests when specifically requested by + // the `view=FULL_CERTIFICATE` option. + // + // @OutputOnly + int32 domain_mappings_count = 9; +} + +// An SSL certificate obtained from a certificate authority. +message CertificateRawData { + // PEM encoded x.509 public key certificate. This field is set once on + // certificate creation. Must include the header and footer. Example: + //
+  // -----BEGIN CERTIFICATE-----
+  // 
+  // -----END CERTIFICATE-----
+  // 
+ string public_certificate = 1; + + // Unencrypted PEM encoded RSA private key. This field is set once on + // certificate creation and then encrypted. The key size must be 2048 + // bits or fewer. Must include the header and footer. Example: + //
+  // -----BEGIN RSA PRIVATE KEY-----
+  // 
+  // -----END RSA PRIVATE KEY-----
+  // 
+ // @InputOnly + string private_key = 2; +} + +// State of certificate management. Refers to the most recent certificate +// acquisition or renewal attempt. +enum ManagementStatus { + MANAGEMENT_STATUS_UNSPECIFIED = 0; + + // Certificate was successfully obtained and inserted into the serving + // system. + OK = 1; + + // Certificate is under active attempts to acquire or renew. + PENDING = 2; + + // Most recent renewal failed due to an invalid DNS setup and will be + // retried. Renewal attempts will continue to fail until the certificate + // domain's DNS configuration is fixed. The last successfully provisioned + // certificate may still be serving. + FAILED_RETRYING_NOT_VISIBLE = 4; + + // All renewal attempts have been exhausted, likely due to an invalid DNS + // setup. + FAILED_PERMANENT = 6; + + // Most recent renewal failed due to an explicit CAA record that does not + // include one of the in-use CAs (Google CA and Let's Encrypt). Renewals will + // continue to fail until the CAA is reconfigured. The last successfully + // provisioned certificate may still be serving. + FAILED_RETRYING_CAA_FORBIDDEN = 7; + + // Most recent renewal failed due to a CAA retrieval failure. This means that + // the domain's DNS provider does not properly handle CAA records, failing + // requests for CAA records when no CAA records are defined. Renewals will + // continue to fail until the DNS provider is changed or a CAA record is + // added for the given domain. The last successfully provisioned certificate + // may still be serving. + FAILED_RETRYING_CAA_CHECKING = 8; +} + +// A certificate managed by App Engine. +message ManagedCertificate { + // Time at which the certificate was last renewed. The renewal process is + // fully managed. Certificate renewal will automatically occur before the + // certificate expires. Renewal errors can be tracked via `ManagementStatus`. + // + // @OutputOnly + google.protobuf.Timestamp last_renewal_time = 1; + + // Status of certificate management. Refers to the most recent certificate + // acquisition or renewal attempt. + // + // @OutputOnly + ManagementStatus status = 2; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/deploy.proto b/packages/google-appengine/protos/google/appengine/v1/deploy.proto new file mode 100644 index 00000000000..8796ec1f595 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/deploy.proto @@ -0,0 +1,107 @@ +// 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.appengine.v1; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "DeployProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// Code and application artifacts used to deploy a version to App Engine. +message Deployment { + // Manifest of the files stored in Google Cloud Storage that are included + // as part of this version. All files must be readable using the + // credentials supplied with this call. + map files = 1; + + // The Docker image for the container that runs the version. + // Only applicable for instances running in the App Engine flexible environment. + ContainerInfo container = 2; + + // The zip file for this deployment, if this is a zip deployment. + ZipInfo zip = 3; + + // Options for any Google Cloud Build builds created as a part of this + // deployment. + // + // These options will only be used if a new build is created, such as when + // deploying to the App Engine flexible environment using files or zip. + CloudBuildOptions cloud_build_options = 6; +} + +// Single source file that is part of the version to be deployed. Each source +// file that is deployed must be specified separately. +message FileInfo { + // URL source to use to fetch this file. Must be a URL to a resource in + // Google Cloud Storage in the form + // 'http(s)://storage.googleapis.com/\/\'. + string source_url = 1; + + // The SHA1 hash of the file, in hex. + string sha1_sum = 2; + + // The MIME type of the file. + // + // Defaults to the value from Google Cloud Storage. + string mime_type = 3; +} + +// Docker image that is used to create a container and start a VM instance for +// the version that you deploy. Only applicable for instances running in the App +// Engine flexible environment. +message ContainerInfo { + // URI to the hosted container image in Google Container Registry. The URI + // must be fully qualified and include a tag or digest. + // Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" + string image = 1; +} + +// Options for the build operations performed as a part of the version +// deployment. Only applicable for App Engine flexible environment when creating +// a version using source code directly. +message CloudBuildOptions { + // Path to the yaml file used in deployment, used to determine runtime + // configuration details. + // + // Required for flexible environment builds. + // + // See https://cloud.google.com/appengine/docs/standard/python/config/appref + // for more details. + string app_yaml_path = 1; + + // The Cloud Build timeout used as part of any dependent builds performed by + // version creation. Defaults to 10 minutes. + google.protobuf.Duration cloud_build_timeout = 2; +} + +// The zip file information for a zip deployment. +message ZipInfo { + // URL of the zip file to deploy from. Must be a URL to a resource in + // Google Cloud Storage in the form + // 'http(s)://storage.googleapis.com/\/\'. + string source_url = 3; + + // An estimate of the number of files in a zip for a zip deployment. + // If set, must be greater than or equal to the actual number of files. + // Used for optimizing performance; if not provided, deployment may be slow. + int32 files_count = 4; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/deployed_files.proto b/packages/google-appengine/protos/google/appengine/v1/deployed_files.proto new file mode 100644 index 00000000000..67e9b703b77 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/deployed_files.proto @@ -0,0 +1,25 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.appengine.v1; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "DeployedFilesProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; diff --git a/packages/google-appengine/protos/google/appengine/v1/domain.proto b/packages/google-appengine/protos/google/appengine/v1/domain.proto new file mode 100644 index 00000000000..cd39adfbe09 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/domain.proto @@ -0,0 +1,40 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.appengine.v1; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "DomainProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// A domain that a user has been authorized to administer. To authorize use +// of a domain, verify ownership via +// [Webmaster Central](https://www.google.com/webmasters/verification/home). +message AuthorizedDomain { + // Full path to the `AuthorizedDomain` resource in the API. Example: + // `apps/myapp/authorizedDomains/example.com`. + // + // @OutputOnly + string name = 1; + + // Fully qualified domain name of the domain authorized for use. Example: + // `example.com`. + string id = 2; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/domain_mapping.proto b/packages/google-appengine/protos/google/appengine/v1/domain_mapping.proto new file mode 100644 index 00000000000..f307217a348 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/domain_mapping.proto @@ -0,0 +1,123 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.appengine.v1; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "DomainMappingProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// A domain serving an App Engine application. +message DomainMapping { + // Full path to the `DomainMapping` resource in the API. Example: + // `apps/myapp/domainMapping/example.com`. + // + // @OutputOnly + string name = 1; + + // Relative name of the domain serving the application. Example: + // `example.com`. + string id = 2; + + // SSL configuration for this domain. If unconfigured, this domain will not + // serve with SSL. + SslSettings ssl_settings = 3; + + // The resource records required to configure this domain mapping. These + // records must be added to the domain's DNS configuration in order to + // serve the application via this domain mapping. + // + // @OutputOnly + repeated ResourceRecord resource_records = 4; +} + +// SSL configuration for a `DomainMapping` resource. +message SslSettings { + // The SSL management type for this domain. + enum SslManagementType { + // Defaults to `AUTOMATIC`. + SSL_MANAGEMENT_TYPE_UNSPECIFIED = 0; + + // SSL support for this domain is configured automatically. The mapped SSL + // certificate will be automatically renewed. + AUTOMATIC = 1; + + // SSL support for this domain is configured manually by the user. Either + // the domain has no SSL support or a user-obtained SSL certificate has been + // explictly mapped to this domain. + MANUAL = 2; + } + + // ID of the `AuthorizedCertificate` resource configuring SSL for the + // application. Clearing this field will remove SSL support. + // + // By default, a managed certificate is automatically created for every + // domain mapping. To omit SSL support or to configure SSL manually, specify + // `SslManagementType.MANUAL` on a `CREATE` or `UPDATE` request. You must + // be authorized to administer the `AuthorizedCertificate` resource to + // manually map it to a `DomainMapping` resource. + // Example: `12345`. + string certificate_id = 1; + + // SSL management type for this domain. If `AUTOMATIC`, a managed certificate + // is automatically provisioned. If `MANUAL`, `certificate_id` must be + // manually specified in order to configure SSL for this domain. + SslManagementType ssl_management_type = 3; + + // ID of the managed `AuthorizedCertificate` resource currently being + // provisioned, if applicable. Until the new managed certificate has been + // successfully provisioned, the previous SSL state will be preserved. Once + // the provisioning process completes, the `certificate_id` field will reflect + // the new managed certificate and this field will be left empty. To remove + // SSL support while there is still a pending managed certificate, clear the + // `certificate_id` field with an `UpdateDomainMappingRequest`. + // + // @OutputOnly + string pending_managed_certificate_id = 4; +} + +// A DNS resource record. +message ResourceRecord { + // A resource record type. + enum RecordType { + // An unknown resource record. + RECORD_TYPE_UNSPECIFIED = 0; + + // An A resource record. Data is an IPv4 address. + A = 1; + + // An AAAA resource record. Data is an IPv6 address. + AAAA = 2; + + // A CNAME resource record. Data is a domain name to be aliased. + CNAME = 3; + } + + // Relative name of the object affected by this record. Only applicable for + // `CNAME` records. Example: 'www'. + string name = 1; + + // Data for this record. Values vary by record type, as defined in RFC 1035 + // (section 5) and RFC 1034 (section 3.6.1). + string rrdata = 2; + + // Resource record type. Example: `AAAA`. + RecordType type = 3; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/firewall.proto b/packages/google-appengine/protos/google/appengine/v1/firewall.proto new file mode 100644 index 00000000000..d7172f7eecc --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/firewall.proto @@ -0,0 +1,68 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.appengine.v1; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "FirewallProto"; +option java_package = "com.google.appengine.v1.firewall"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// A single firewall rule that is evaluated against incoming traffic +// and provides an action to take on matched requests. +message FirewallRule { + // Available actions to take on matching requests. + enum Action { + UNSPECIFIED_ACTION = 0; + + // Matching requests are allowed. + ALLOW = 1; + + // Matching requests are denied. + DENY = 2; + } + + // A positive integer between [1, Int32.MaxValue-1] that defines the order of + // rule evaluation. Rules with the lowest priority are evaluated first. + // + // A default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic + // when no previous rule matches. Only the action of this rule can be modified + // by the user. + int32 priority = 1; + + // The action to take on matched requests. + Action action = 2; + + // IP address or range, defined using CIDR notation, of requests that this + // rule applies to. You can use the wildcard character "*" to match all IPs + // equivalent to "0/0" and "::/0" together. + // Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` + // or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. + // + // + //

Truncation will be silently performed on addresses which are not + // properly truncated. For example, `1.2.3.4/24` is accepted as the same + // address as `1.2.3.0/24`. Similarly, for IPv6, `2001:db8::1/32` is accepted + // as the same address as `2001:db8::/32`. + string source_range = 3; + + // An optional string description of this rule. + // This field has a maximum length of 100 characters. + string description = 4; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/instance.proto b/packages/google-appengine/protos/google/appengine/v1/instance.proto new file mode 100644 index 00000000000..59b2e5c92e0 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/instance.proto @@ -0,0 +1,143 @@ +// 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.appengine.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "InstanceProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// An Instance resource is the computing unit that App Engine uses to +// automatically scale an application. +message Instance { + option (google.api.resource) = { + type: "appengine.googleapis.com/Instance" + pattern: "apps/{app}/services/{service}/versions/{version}/instances/{instance}" + }; + + // Availability of the instance. + enum Availability { + UNSPECIFIED = 0; + + RESIDENT = 1; + + DYNAMIC = 2; + } + + // Wrapper for LivenessState enum. + message Liveness { + // Liveness health check status for Flex instances. + enum LivenessState { + // There is no liveness health check for the instance. Only applicable for + // instances in App Engine standard environment. + LIVENESS_STATE_UNSPECIFIED = 0; + + // The health checking system is aware of the instance but its health is + // not known at the moment. + UNKNOWN = 1; + + // The instance is reachable i.e. a connection to the application health + // checking endpoint can be established, and conforms to the requirements + // defined by the health check. + HEALTHY = 2; + + // The instance is reachable, but does not conform to the requirements + // defined by the health check. + UNHEALTHY = 3; + + // The instance is being drained. The existing connections to the instance + // have time to complete, but the new ones are being refused. + DRAINING = 4; + + // The instance is unreachable i.e. a connection to the application health + // checking endpoint cannot be established, or the server does not respond + // within the specified timeout. + TIMEOUT = 5; + } + + + } + + // Output only. Full path to the Instance resource in the API. + // Example: `apps/myapp/services/default/versions/v1/instances/instance-1`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Relative name of the instance within the version. + // Example: `instance-1`. + string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. App Engine release this instance is running on. + string app_engine_release = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Availability of the instance. + Availability availability = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the virtual machine where this instance lives. Only applicable + // for instances in App Engine flexible environment. + string vm_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Zone where the virtual machine is located. Only applicable for instances + // in App Engine flexible environment. + string vm_zone_name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Virtual machine ID of this instance. Only applicable for instances in + // App Engine flexible environment. + string vm_id = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time that this instance was started. + // + // @OutputOnly + google.protobuf.Timestamp start_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of requests since this instance was started. + int32 requests = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of errors since this instance was started. + int32 errors = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Average queries per second (QPS) over the last minute. + float qps = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Average latency (ms) over the last minute. + int32 average_latency = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Total memory in use (bytes). + int64 memory_usage = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Status of the virtual machine where this instance lives. Only applicable + // for instances in App Engine flexible environment. + string vm_status = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether this instance is in debug mode. Only applicable for instances in + // App Engine flexible environment. + bool vm_debug_enabled = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The IP address of this instance. Only applicable for instances in App + // Engine flexible environment. + string vm_ip = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The liveness health check of this instance. Only applicable for instances + // in App Engine flexible environment. + Liveness.LivenessState vm_liveness = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/location.proto b/packages/google-appengine/protos/google/appengine/v1/location.proto new file mode 100644 index 00000000000..995a5ff6520 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/location.proto @@ -0,0 +1,44 @@ +// 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.appengine.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "LocationProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// Metadata for the given [google.cloud.location.Location][google.cloud.location.Location]. +message LocationMetadata { + // App Engine standard environment is available in the given location. + // + // @OutputOnly + bool standard_environment_available = 2; + + // App Engine flexible environment is available in the given location. + // + // @OutputOnly + bool flexible_environment_available = 4; + + // Output only. [Search API](https://cloud.google.com/appengine/docs/standard/python/search) + // is available in the given location. + bool search_api_available = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/network_settings.proto b/packages/google-appengine/protos/google/appengine/v1/network_settings.proto new file mode 100644 index 00000000000..2645e8c8d82 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/network_settings.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.appengine.v1; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "NetworkSettingsProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// A NetworkSettings resource is a container for ingress settings for a version +// or service. +message NetworkSettings { + // If unspecified, INGRESS_TRAFFIC_ALLOWED_ALL will be used. + enum IngressTrafficAllowed { + // Unspecified + INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED = 0; + + // Allow HTTP traffic from public and private sources. + INGRESS_TRAFFIC_ALLOWED_ALL = 1; + + // Allow HTTP traffic from only private VPC sources. + INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY = 2; + + // Allow HTTP traffic from private VPC sources and through load balancers. + INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB = 3; + } + + // The ingress settings for version or service. + IngressTrafficAllowed ingress_traffic_allowed = 1; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/operation.proto b/packages/google-appengine/protos/google/appengine/v1/operation.proto new file mode 100644 index 00000000000..a2636cb7c81 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/operation.proto @@ -0,0 +1,79 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.appengine.v1; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "OperationProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation]. +message OperationMetadataV1 { + // API method that initiated this operation. Example: + // `google.appengine.v1.Versions.CreateVersion`. + // + // @OutputOnly + string method = 1; + + // Time that this operation was created. + // + // @OutputOnly + google.protobuf.Timestamp insert_time = 2; + + // Time that this operation completed. + // + // @OutputOnly + google.protobuf.Timestamp end_time = 3; + + // User who requested this operation. + // + // @OutputOnly + string user = 4; + + // Name of the resource that this operation is acting on. Example: + // `apps/myapp/services/default`. + // + // @OutputOnly + string target = 5; + + // Ephemeral message that may change every time the operation is polled. + // @OutputOnly + string ephemeral_message = 6; + + // Durable messages that persist on every operation poll. + // @OutputOnly + repeated string warning = 7; + + // Metadata specific to the type of operation in progress. + // @OutputOnly + oneof method_metadata { + CreateVersionMetadataV1 create_version_metadata = 8; + } +} + +// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation] during a +// [google.appengine.v1.CreateVersionRequest][google.appengine.v1.CreateVersionRequest]. +message CreateVersionMetadataV1 { + // The Cloud Build ID if one was created as part of the version create. + // @OutputOnly + string cloud_build_id = 1; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/service.proto b/packages/google-appengine/protos/google/appengine/v1/service.proto new file mode 100644 index 00000000000..b3ed6def1e5 --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/service.proto @@ -0,0 +1,106 @@ +// 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.appengine.v1; + +import "google/appengine/v1/network_settings.proto"; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// A Service resource is a logical component of an application that can share +// state and communicate in a secure fashion with other services. +// For example, an application that handles customer requests might +// include separate services to handle tasks such as backend data +// analysis or API requests from mobile devices. Each service has a +// collection of versions that define a specific set of code used to +// implement the functionality of that service. +message Service { + // Full path to the Service resource in the API. + // Example: `apps/myapp/services/default`. + // + // @OutputOnly + string name = 1; + + // Relative name of the service within the application. + // Example: `default`. + // + // @OutputOnly + string id = 2; + + // Mapping that defines fractional HTTP traffic diversion to + // different versions within the service. + TrafficSplit split = 3; + + // A set of labels to apply to this service. Labels are key/value pairs that + // describe the service and all resources that belong to it (e.g., + // versions). The labels can be used to search and group resources, and are + // propagated to the usage and billing reports, enabling fine-grain analysis + // of costs. An example of using labels is to tag resources belonging to + // different environments (e.g., "env=prod", "env=qa"). + // + //

Label keys and values can be no longer than 63 characters and can only + // contain lowercase letters, numeric characters, underscores, dashes, and + // international characters. Label keys must start with a lowercase letter + // or an international character. Each service can have at most 32 labels. + map labels = 4; + + // Ingress settings for this service. Will apply to all versions. + NetworkSettings network_settings = 6; +} + +// Traffic routing configuration for versions within a single service. Traffic +// splits define how traffic directed to the service is assigned to versions. +message TrafficSplit { + // Available sharding mechanisms. + enum ShardBy { + // Diversion method unspecified. + UNSPECIFIED = 0; + + // Diversion based on a specially named cookie, "GOOGAPPUID." The cookie + // must be set by the application itself or no diversion will occur. + COOKIE = 1; + + // Diversion based on applying the modulus operation to a fingerprint + // of the IP address. + IP = 2; + + // Diversion based on weighted random assignment. An incoming request is + // randomly routed to a version in the traffic split, with probability + // proportional to the version's traffic share. + RANDOM = 3; + } + + // Mechanism used to determine which version a request is sent to. + // The traffic selection algorithm will + // be stable for either type until allocations are changed. + ShardBy shard_by = 1; + + // Mapping from version IDs within the service to fractional + // (0.000, 1] allocations of traffic for that version. Each version can + // be specified only once, but some versions in the service may not + // have any traffic allocation. Services that have traffic allocated + // cannot be deleted until either the service is deleted or + // their traffic allocation is removed. Allocations must sum to 1. + // Up to two decimal place precision is supported for IP-based splits and + // up to three decimal places is supported for cookie-based splits. + map allocations = 2; +} diff --git a/packages/google-appengine/protos/google/appengine/v1/version.proto b/packages/google-appengine/protos/google/appengine/v1/version.proto new file mode 100644 index 00000000000..2caab513c2a --- /dev/null +++ b/packages/google-appengine/protos/google/appengine/v1/version.proto @@ -0,0 +1,594 @@ +// 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.appengine.v1; + +import "google/appengine/v1/app_yaml.proto"; +import "google/appengine/v1/deploy.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AppEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine"; +option java_multiple_files = true; +option java_outer_classname = "VersionProto"; +option java_package = "com.google.appengine.v1"; +option php_namespace = "Google\\Cloud\\AppEngine\\V1"; +option ruby_package = "Google::Cloud::AppEngine::V1"; + +// A Version resource is a specific set of source code and configuration files +// that are deployed into a service. +message Version { + // Full path to the Version resource in the API. Example: + // `apps/myapp/services/default/versions/v1`. + // + // @OutputOnly + string name = 1; + + // Relative name of the version within the service. Example: `v1`. + // Version names can contain only lowercase letters, numbers, or hyphens. + // Reserved names: "default", "latest", and any name with the prefix "ah-". + string id = 2; + + // Controls how instances are created, scaled, and reaped. + // + // Defaults to `AutomaticScaling`. + oneof scaling { + // Automatic scaling is based on request rate, response latencies, and other + // application metrics. Instances are dynamically created and destroyed as + // needed in order to handle traffic. + AutomaticScaling automatic_scaling = 3; + + // A service with basic scaling will create an instance when the application + // receives a request. The instance will be turned down when the app becomes + // idle. Basic scaling is ideal for work that is intermittent or driven by + // user activity. + BasicScaling basic_scaling = 4; + + // A service with manual scaling runs continuously, allowing you to perform + // complex initialization and rely on the state of its memory over time. + // Manually scaled versions are sometimes referred to as "backends". + ManualScaling manual_scaling = 5; + } + + // Before an application can receive email or XMPP messages, the application + // must be configured to enable the service. + repeated InboundServiceType inbound_services = 6; + + // Instance class that is used to run this version. Valid values are: + // + // * AutomaticScaling: `F1`, `F2`, `F4`, `F4_1G` + // * ManualScaling or BasicScaling: `B1`, `B2`, `B4`, `B8`, `B4_1G` + // + // Defaults to `F1` for AutomaticScaling and `B1` for ManualScaling or + // BasicScaling. + string instance_class = 7; + + // Extra network settings. + // Only applicable in the App Engine flexible environment. + Network network = 8; + + // The Google Compute Engine zones that are supported by this version in the + // App Engine flexible environment. Deprecated. + repeated string zones = 118; + + // Machine resources for this version. + // Only applicable in the App Engine flexible environment. + Resources resources = 9; + + // Desired runtime. Example: `python27`. + string runtime = 10; + + // The channel of the runtime to use. Only available for some + // runtimes. Defaults to the `default` channel. + string runtime_channel = 117; + + // Whether multiple requests can be dispatched to this version at once. + bool threadsafe = 11; + + // Whether to deploy this version in a container on a virtual machine. + bool vm = 12; + + // Allows App Engine second generation runtimes to access the legacy bundled + // services. + bool app_engine_apis = 128; + + // Metadata settings that are supplied to this version to enable + // beta runtime features. + map beta_settings = 13; + + // App Engine execution environment for this version. + // + // Defaults to `standard`. + string env = 14; + + // Current serving status of this version. Only the versions with a + // `SERVING` status create instances and can be billed. + // + // `SERVING_STATUS_UNSPECIFIED` is an invalid value. Defaults to `SERVING`. + ServingStatus serving_status = 15; + + // Email address of the user who created this version. + // + // @OutputOnly + string created_by = 16; + + // Time that this version was created. + // + // @OutputOnly + google.protobuf.Timestamp create_time = 17; + + // Total size in bytes of all the files that are included in this version + // and currently hosted on the App Engine disk. + // + // @OutputOnly + int64 disk_usage_bytes = 18; + + // The version of the API in the given runtime environment. Please see the + // app.yaml reference for valid values at + // https://cloud.google.com/appengine/docs/standard//config/appref + string runtime_api_version = 21; + + // The path or name of the app's main executable. + string runtime_main_executable_path = 22; + + // The identity that the deployed version will run as. + // Admin API will use the App Engine Appspot service account as default if + // this field is neither provided in app.yaml file nor through CLI flag. + string service_account = 127; + + // An ordered list of URL-matching patterns that should be applied to incoming + // requests. The first matching URL handles the request and other request + // handlers are not attempted. + // + // Only returned in `GET` requests if `view=FULL` is set. + repeated UrlMap handlers = 100; + + // Custom static error pages. Limited to 10KB per page. + // + // Only returned in `GET` requests if `view=FULL` is set. + repeated ErrorHandler error_handlers = 101; + + // Configuration for third-party Python runtime libraries that are required + // by the application. + // + // Only returned in `GET` requests if `view=FULL` is set. + repeated Library libraries = 102; + + // Serving configuration for + // [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/). + // + // Only returned in `GET` requests if `view=FULL` is set. + ApiConfigHandler api_config = 103; + + // Environment variables available to the application. + // + // Only returned in `GET` requests if `view=FULL` is set. + map env_variables = 104; + + // Environment variables available to the build environment. + // + // Only returned in `GET` requests if `view=FULL` is set. + map build_env_variables = 125; + + // Duration that static files should be cached by web proxies and browsers. + // Only applicable if the corresponding + // [StaticFilesHandler](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StaticFilesHandler) + // does not specify its own expiration time. + // + // Only returned in `GET` requests if `view=FULL` is set. + google.protobuf.Duration default_expiration = 105; + + // Configures health checking for instances. Unhealthy instances are + // stopped and replaced with new instances. + // Only applicable in the App Engine flexible environment. + // + // Only returned in `GET` requests if `view=FULL` is set. + HealthCheck health_check = 106; + + // Configures readiness health checking for instances. + // Unhealthy instances are not put into the backend traffic rotation. + // + // Only returned in `GET` requests if `view=FULL` is set. + ReadinessCheck readiness_check = 112; + + // Configures liveness health checking for instances. + // Unhealthy instances are stopped and replaced with new instances + // + // Only returned in `GET` requests if `view=FULL` is set. + LivenessCheck liveness_check = 113; + + // Files that match this pattern will not be built into this version. + // Only applicable for Go runtimes. + // + // Only returned in `GET` requests if `view=FULL` is set. + string nobuild_files_regex = 107; + + // Code and application artifacts that make up this version. + // + // Only returned in `GET` requests if `view=FULL` is set. + Deployment deployment = 108; + + // Serving URL for this version. Example: + // "https://myversion-dot-myservice-dot-myapp.appspot.com" + // + // @OutputOnly + string version_url = 109; + + // Cloud Endpoints configuration. + // + // If endpoints_api_service is set, the Cloud Endpoints Extensible Service + // Proxy will be provided to serve the API implemented by the app. + EndpointsApiService endpoints_api_service = 110; + + // The entrypoint for the application. + Entrypoint entrypoint = 122; + + // Enables VPC connectivity for standard apps. + VpcAccessConnector vpc_access_connector = 121; +} + +// [Cloud Endpoints](https://cloud.google.com/endpoints) configuration. +// The Endpoints API Service provides tooling for serving Open API and gRPC +// endpoints via an NGINX proxy. Only valid for App Engine Flexible environment +// deployments. +// +// The fields here refer to the name and configuration ID of a "service" +// resource in the [Service Management API](https://cloud.google.com/service-management/overview). +message EndpointsApiService { + // Available rollout strategies. + enum RolloutStrategy { + // Not specified. Defaults to `FIXED`. + UNSPECIFIED_ROLLOUT_STRATEGY = 0; + + // Endpoints service configuration ID will be fixed to the configuration ID + // specified by `config_id`. + FIXED = 1; + + // Endpoints service configuration ID will be updated with each rollout. + MANAGED = 2; + } + + // Endpoints service name which is the name of the "service" resource in the + // Service Management API. For example "myapi.endpoints.myproject.cloud.goog" + string name = 1; + + // Endpoints service configuration ID as specified by the Service Management + // API. For example "2016-09-19r1". + // + // By default, the rollout strategy for Endpoints is `RolloutStrategy.FIXED`. + // This means that Endpoints starts up with a particular configuration ID. + // When a new configuration is rolled out, Endpoints must be given the new + // configuration ID. The `config_id` field is used to give the configuration + // ID and is required in this case. + // + // Endpoints also has a rollout strategy called `RolloutStrategy.MANAGED`. + // When using this, Endpoints fetches the latest configuration and does not + // need the configuration ID. In this case, `config_id` must be omitted. + string config_id = 2; + + // Endpoints rollout strategy. If `FIXED`, `config_id` must be specified. If + // `MANAGED`, `config_id` must be omitted. + RolloutStrategy rollout_strategy = 3; + + // Enable or disable trace sampling. By default, this is set to false for + // enabled. + bool disable_trace_sampling = 4; +} + +// Automatic scaling is based on request rate, response latencies, and other +// application metrics. +message AutomaticScaling { + // The time period that the + // [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/) + // should wait before it starts collecting information from a new instance. + // This prevents the autoscaler from collecting information when the instance + // is initializing, during which the collected usage would not be reliable. + // Only applicable in the App Engine flexible environment. + google.protobuf.Duration cool_down_period = 1; + + // Target scaling by CPU usage. + CpuUtilization cpu_utilization = 2; + + // Number of concurrent requests an automatic scaling instance can accept + // before the scheduler spawns a new instance. + // + // Defaults to a runtime-specific value. + int32 max_concurrent_requests = 3; + + // Maximum number of idle instances that should be maintained for this + // version. + int32 max_idle_instances = 4; + + // Maximum number of instances that should be started to handle requests for + // this version. + int32 max_total_instances = 5; + + // Maximum amount of time that a request should wait in the pending queue + // before starting a new instance to handle it. + google.protobuf.Duration max_pending_latency = 6; + + // Minimum number of idle instances that should be maintained for + // this version. Only applicable for the default version of a service. + int32 min_idle_instances = 7; + + // Minimum number of running instances that should be maintained for this + // version. + int32 min_total_instances = 8; + + // Minimum amount of time a request should wait in the pending queue before + // starting a new instance to handle it. + google.protobuf.Duration min_pending_latency = 9; + + // Target scaling by request utilization. + RequestUtilization request_utilization = 10; + + // Target scaling by disk usage. + DiskUtilization disk_utilization = 11; + + // Target scaling by network usage. + NetworkUtilization network_utilization = 12; + + // Scheduler settings for standard environment. + StandardSchedulerSettings standard_scheduler_settings = 20; +} + +// A service with basic scaling will create an instance when the application +// receives a request. The instance will be turned down when the app becomes +// idle. Basic scaling is ideal for work that is intermittent or driven by +// user activity. +message BasicScaling { + // Duration of time after the last request that an instance must wait before + // the instance is shut down. + google.protobuf.Duration idle_timeout = 1; + + // Maximum number of instances to create for this version. + int32 max_instances = 2; +} + +// A service with manual scaling runs continuously, allowing you to perform +// complex initialization and rely on the state of its memory over time. +message ManualScaling { + // Number of instances to assign to the service at the start. This number + // can later be altered by using the + // [Modules API](https://cloud.google.com/appengine/docs/python/modules/functions) + // `set_num_instances()` function. + int32 instances = 1; +} + +// Target scaling by CPU usage. +message CpuUtilization { + // Period of time over which CPU utilization is calculated. + google.protobuf.Duration aggregation_window_length = 1; + + // Target CPU utilization ratio to maintain when scaling. Must be between 0 + // and 1. + double target_utilization = 2; +} + +// Target scaling by request utilization. +// Only applicable in the App Engine flexible environment. +message RequestUtilization { + // Target requests per second. + int32 target_request_count_per_second = 1; + + // Target number of concurrent requests. + int32 target_concurrent_requests = 2; +} + +// Target scaling by disk usage. +// Only applicable in the App Engine flexible environment. +message DiskUtilization { + // Target bytes written per second. + int32 target_write_bytes_per_second = 14; + + // Target ops written per second. + int32 target_write_ops_per_second = 15; + + // Target bytes read per second. + int32 target_read_bytes_per_second = 16; + + // Target ops read per seconds. + int32 target_read_ops_per_second = 17; +} + +// Target scaling by network usage. +// Only applicable in the App Engine flexible environment. +message NetworkUtilization { + // Target bytes sent per second. + int32 target_sent_bytes_per_second = 1; + + // Target packets sent per second. + int32 target_sent_packets_per_second = 11; + + // Target bytes received per second. + int32 target_received_bytes_per_second = 12; + + // Target packets received per second. + int32 target_received_packets_per_second = 13; +} + +// Scheduler settings for standard environment. +message StandardSchedulerSettings { + // Target CPU utilization ratio to maintain when scaling. + double target_cpu_utilization = 1; + + // Target throughput utilization ratio to maintain when scaling + double target_throughput_utilization = 2; + + // Minimum number of instances to run for this version. Set to zero to disable + // `min_instances` configuration. + int32 min_instances = 3; + + // Maximum number of instances to run for this version. Set to zero to disable + // `max_instances` configuration. + int32 max_instances = 4; +} + +// Extra network settings. +// Only applicable in the App Engine flexible environment. +message Network { + // List of ports, or port pairs, to forward from the virtual machine to the + // application container. + // Only applicable in the App Engine flexible environment. + repeated string forwarded_ports = 1; + + // Tag to apply to the instance during creation. + // Only applicable in the App Engine flexible environment. + string instance_tag = 2; + + // Google Compute Engine network where the virtual machines are created. + // Specify the short name, not the resource path. + // + // Defaults to `default`. + string name = 3; + + // Google Cloud Platform sub-network where the virtual machines are created. + // Specify the short name, not the resource path. + // + // If a subnetwork name is specified, a network name will also be required + // unless it is for the default network. + // + // * If the network that the instance is being created in is a Legacy network, + // then the IP address is allocated from the IPv4Range. + // * If the network that the instance is being created in is an auto Subnet + // Mode Network, then only network name should be specified (not the + // subnetwork_name) and the IP address is created from the IPCidrRange of the + // subnetwork that exists in that zone for that network. + // * If the network that the instance is being created in is a custom Subnet + // Mode Network, then the subnetwork_name must be specified and the + // IP address is created from the IPCidrRange of the subnetwork. + // + // If specified, the subnetwork must exist in the same region as the + // App Engine flexible environment application. + string subnetwork_name = 4; + + // Enable session affinity. + // Only applicable in the App Engine flexible environment. + bool session_affinity = 5; +} + +// Volumes mounted within the app container. +// Only applicable in the App Engine flexible environment. +message Volume { + // Unique name for the volume. + string name = 1; + + // Underlying volume type, e.g. 'tmpfs'. + string volume_type = 2; + + // Volume size in gigabytes. + double size_gb = 3; +} + +// Machine resources for a version. +message Resources { + // Number of CPU cores needed. + double cpu = 1; + + // Disk size (GB) needed. + double disk_gb = 2; + + // Memory (GB) needed. + double memory_gb = 3; + + // User specified volumes. + repeated Volume volumes = 4; + + // The name of the encryption key that is stored in Google Cloud KMS. + // Only should be used by Cloud Composer to encrypt the vm disk + string kms_key_reference = 5; +} + +// Available inbound services. +enum InboundServiceType { + // Not specified. + INBOUND_SERVICE_UNSPECIFIED = 0; + + // Allows an application to receive mail. + INBOUND_SERVICE_MAIL = 1; + + // Allows an application to receive email-bound notifications. + INBOUND_SERVICE_MAIL_BOUNCE = 2; + + // Allows an application to receive error stanzas. + INBOUND_SERVICE_XMPP_ERROR = 3; + + // Allows an application to receive instant messages. + INBOUND_SERVICE_XMPP_MESSAGE = 4; + + // Allows an application to receive user subscription POSTs. + INBOUND_SERVICE_XMPP_SUBSCRIBE = 5; + + // Allows an application to receive a user's chat presence. + INBOUND_SERVICE_XMPP_PRESENCE = 6; + + // Registers an application for notifications when a client connects or + // disconnects from a channel. + INBOUND_SERVICE_CHANNEL_PRESENCE = 7; + + // Enables warmup requests. + INBOUND_SERVICE_WARMUP = 9; +} + +// Run states of a version. +enum ServingStatus { + // Not specified. + SERVING_STATUS_UNSPECIFIED = 0; + + // Currently serving. Instances are created according to the + // scaling settings of the version. + SERVING = 1; + + // Disabled. No instances will be created and the scaling + // settings are ignored until the state of the version changes + // to `SERVING`. + STOPPED = 2; +} + +// VPC access connector specification. +message VpcAccessConnector { + // Available egress settings. + // + // This controls what traffic is diverted through the VPC Access Connector + // resource. By default PRIVATE_IP_RANGES will be used. + enum EgressSetting { + EGRESS_SETTING_UNSPECIFIED = 0; + + // Force the use of VPC Access for all egress traffic from the function. + ALL_TRAFFIC = 1; + + // Use the VPC Access Connector for private IP space from RFC1918. + PRIVATE_IP_RANGES = 2; + } + + // Full Serverless VPC Access Connector name e.g. + // /projects/my-project/locations/us-central1/connectors/c1. + string name = 1; + + // The egress setting for the connector, controlling what traffic is diverted + // through it. + EgressSetting egress_setting = 2; +} + +// The entrypoint for the application. +message Entrypoint { + // The command to run. + oneof command { + // The format should be a shell command that can be fed to `bash -c`. + string shell = 1; + } +} diff --git a/packages/google-appengine/protos/protos.d.ts b/packages/google-appengine/protos/protos.d.ts new file mode 100644 index 00000000000..cc0f9eda641 --- /dev/null +++ b/packages/google-appengine/protos/protos.d.ts @@ -0,0 +1,17370 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace appengine. */ + namespace appengine { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an ApiConfigHandler. */ + interface IApiConfigHandler { + + /** ApiConfigHandler authFailAction */ + authFailAction?: (google.appengine.v1.AuthFailAction|keyof typeof google.appengine.v1.AuthFailAction|null); + + /** ApiConfigHandler login */ + login?: (google.appengine.v1.LoginRequirement|keyof typeof google.appengine.v1.LoginRequirement|null); + + /** ApiConfigHandler script */ + script?: (string|null); + + /** ApiConfigHandler securityLevel */ + securityLevel?: (google.appengine.v1.SecurityLevel|keyof typeof google.appengine.v1.SecurityLevel|null); + + /** ApiConfigHandler url */ + url?: (string|null); + } + + /** Represents an ApiConfigHandler. */ + class ApiConfigHandler implements IApiConfigHandler { + + /** + * Constructs a new ApiConfigHandler. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IApiConfigHandler); + + /** ApiConfigHandler authFailAction. */ + public authFailAction: (google.appengine.v1.AuthFailAction|keyof typeof google.appengine.v1.AuthFailAction); + + /** ApiConfigHandler login. */ + public login: (google.appengine.v1.LoginRequirement|keyof typeof google.appengine.v1.LoginRequirement); + + /** ApiConfigHandler script. */ + public script: string; + + /** ApiConfigHandler securityLevel. */ + public securityLevel: (google.appengine.v1.SecurityLevel|keyof typeof google.appengine.v1.SecurityLevel); + + /** ApiConfigHandler url. */ + public url: string; + + /** + * Creates a new ApiConfigHandler instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiConfigHandler instance + */ + public static create(properties?: google.appengine.v1.IApiConfigHandler): google.appengine.v1.ApiConfigHandler; + + /** + * Encodes the specified ApiConfigHandler message. Does not implicitly {@link google.appengine.v1.ApiConfigHandler.verify|verify} messages. + * @param message ApiConfigHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IApiConfigHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiConfigHandler message, length delimited. Does not implicitly {@link google.appengine.v1.ApiConfigHandler.verify|verify} messages. + * @param message ApiConfigHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IApiConfigHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiConfigHandler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiConfigHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ApiConfigHandler; + + /** + * Decodes an ApiConfigHandler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiConfigHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ApiConfigHandler; + + /** + * Verifies an ApiConfigHandler message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApiConfigHandler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiConfigHandler + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ApiConfigHandler; + + /** + * Creates a plain object from an ApiConfigHandler message. Also converts values to other types if specified. + * @param message ApiConfigHandler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ApiConfigHandler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiConfigHandler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiConfigHandler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ErrorHandler. */ + interface IErrorHandler { + + /** ErrorHandler errorCode */ + errorCode?: (google.appengine.v1.ErrorHandler.ErrorCode|keyof typeof google.appengine.v1.ErrorHandler.ErrorCode|null); + + /** ErrorHandler staticFile */ + staticFile?: (string|null); + + /** ErrorHandler mimeType */ + mimeType?: (string|null); + } + + /** Represents an ErrorHandler. */ + class ErrorHandler implements IErrorHandler { + + /** + * Constructs a new ErrorHandler. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IErrorHandler); + + /** ErrorHandler errorCode. */ + public errorCode: (google.appengine.v1.ErrorHandler.ErrorCode|keyof typeof google.appengine.v1.ErrorHandler.ErrorCode); + + /** ErrorHandler staticFile. */ + public staticFile: string; + + /** ErrorHandler mimeType. */ + public mimeType: string; + + /** + * Creates a new ErrorHandler instance using the specified properties. + * @param [properties] Properties to set + * @returns ErrorHandler instance + */ + public static create(properties?: google.appengine.v1.IErrorHandler): google.appengine.v1.ErrorHandler; + + /** + * Encodes the specified ErrorHandler message. Does not implicitly {@link google.appengine.v1.ErrorHandler.verify|verify} messages. + * @param message ErrorHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IErrorHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ErrorHandler message, length delimited. Does not implicitly {@link google.appengine.v1.ErrorHandler.verify|verify} messages. + * @param message ErrorHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IErrorHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ErrorHandler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ErrorHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ErrorHandler; + + /** + * Decodes an ErrorHandler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ErrorHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ErrorHandler; + + /** + * Verifies an ErrorHandler message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ErrorHandler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ErrorHandler + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ErrorHandler; + + /** + * Creates a plain object from an ErrorHandler message. Also converts values to other types if specified. + * @param message ErrorHandler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ErrorHandler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ErrorHandler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ErrorHandler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ErrorHandler { + + /** ErrorCode enum. */ + enum ErrorCode { + ERROR_CODE_UNSPECIFIED = 0, + ERROR_CODE_DEFAULT = 0, + ERROR_CODE_OVER_QUOTA = 1, + ERROR_CODE_DOS_API_DENIAL = 2, + ERROR_CODE_TIMEOUT = 3 + } + } + + /** Properties of an UrlMap. */ + interface IUrlMap { + + /** UrlMap urlRegex */ + urlRegex?: (string|null); + + /** UrlMap staticFiles */ + staticFiles?: (google.appengine.v1.IStaticFilesHandler|null); + + /** UrlMap script */ + script?: (google.appengine.v1.IScriptHandler|null); + + /** UrlMap apiEndpoint */ + apiEndpoint?: (google.appengine.v1.IApiEndpointHandler|null); + + /** UrlMap securityLevel */ + securityLevel?: (google.appengine.v1.SecurityLevel|keyof typeof google.appengine.v1.SecurityLevel|null); + + /** UrlMap login */ + login?: (google.appengine.v1.LoginRequirement|keyof typeof google.appengine.v1.LoginRequirement|null); + + /** UrlMap authFailAction */ + authFailAction?: (google.appengine.v1.AuthFailAction|keyof typeof google.appengine.v1.AuthFailAction|null); + + /** UrlMap redirectHttpResponseCode */ + redirectHttpResponseCode?: (google.appengine.v1.UrlMap.RedirectHttpResponseCode|keyof typeof google.appengine.v1.UrlMap.RedirectHttpResponseCode|null); + } + + /** Represents an UrlMap. */ + class UrlMap implements IUrlMap { + + /** + * Constructs a new UrlMap. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IUrlMap); + + /** UrlMap urlRegex. */ + public urlRegex: string; + + /** UrlMap staticFiles. */ + public staticFiles?: (google.appengine.v1.IStaticFilesHandler|null); + + /** UrlMap script. */ + public script?: (google.appengine.v1.IScriptHandler|null); + + /** UrlMap apiEndpoint. */ + public apiEndpoint?: (google.appengine.v1.IApiEndpointHandler|null); + + /** UrlMap securityLevel. */ + public securityLevel: (google.appengine.v1.SecurityLevel|keyof typeof google.appengine.v1.SecurityLevel); + + /** UrlMap login. */ + public login: (google.appengine.v1.LoginRequirement|keyof typeof google.appengine.v1.LoginRequirement); + + /** UrlMap authFailAction. */ + public authFailAction: (google.appengine.v1.AuthFailAction|keyof typeof google.appengine.v1.AuthFailAction); + + /** UrlMap redirectHttpResponseCode. */ + public redirectHttpResponseCode: (google.appengine.v1.UrlMap.RedirectHttpResponseCode|keyof typeof google.appengine.v1.UrlMap.RedirectHttpResponseCode); + + /** UrlMap handlerType. */ + public handlerType?: ("staticFiles"|"script"|"apiEndpoint"); + + /** + * Creates a new UrlMap instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMap instance + */ + public static create(properties?: google.appengine.v1.IUrlMap): google.appengine.v1.UrlMap; + + /** + * Encodes the specified UrlMap message. Does not implicitly {@link google.appengine.v1.UrlMap.verify|verify} messages. + * @param message UrlMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IUrlMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMap message, length delimited. Does not implicitly {@link google.appengine.v1.UrlMap.verify|verify} messages. + * @param message UrlMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IUrlMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMap message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.UrlMap; + + /** + * Decodes an UrlMap message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.UrlMap; + + /** + * Verifies an UrlMap message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMap message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMap + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.UrlMap; + + /** + * Creates a plain object from an UrlMap message. Also converts values to other types if specified. + * @param message UrlMap + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.UrlMap, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMap to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UrlMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UrlMap { + + /** RedirectHttpResponseCode enum. */ + enum RedirectHttpResponseCode { + REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED = 0, + REDIRECT_HTTP_RESPONSE_CODE_301 = 1, + REDIRECT_HTTP_RESPONSE_CODE_302 = 2, + REDIRECT_HTTP_RESPONSE_CODE_303 = 3, + REDIRECT_HTTP_RESPONSE_CODE_307 = 4 + } + } + + /** Properties of a StaticFilesHandler. */ + interface IStaticFilesHandler { + + /** StaticFilesHandler path */ + path?: (string|null); + + /** StaticFilesHandler uploadPathRegex */ + uploadPathRegex?: (string|null); + + /** StaticFilesHandler httpHeaders */ + httpHeaders?: ({ [k: string]: string }|null); + + /** StaticFilesHandler mimeType */ + mimeType?: (string|null); + + /** StaticFilesHandler expiration */ + expiration?: (google.protobuf.IDuration|null); + + /** StaticFilesHandler requireMatchingFile */ + requireMatchingFile?: (boolean|null); + + /** StaticFilesHandler applicationReadable */ + applicationReadable?: (boolean|null); + } + + /** Represents a StaticFilesHandler. */ + class StaticFilesHandler implements IStaticFilesHandler { + + /** + * Constructs a new StaticFilesHandler. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IStaticFilesHandler); + + /** StaticFilesHandler path. */ + public path: string; + + /** StaticFilesHandler uploadPathRegex. */ + public uploadPathRegex: string; + + /** StaticFilesHandler httpHeaders. */ + public httpHeaders: { [k: string]: string }; + + /** StaticFilesHandler mimeType. */ + public mimeType: string; + + /** StaticFilesHandler expiration. */ + public expiration?: (google.protobuf.IDuration|null); + + /** StaticFilesHandler requireMatchingFile. */ + public requireMatchingFile: boolean; + + /** StaticFilesHandler applicationReadable. */ + public applicationReadable: boolean; + + /** + * Creates a new StaticFilesHandler instance using the specified properties. + * @param [properties] Properties to set + * @returns StaticFilesHandler instance + */ + public static create(properties?: google.appengine.v1.IStaticFilesHandler): google.appengine.v1.StaticFilesHandler; + + /** + * Encodes the specified StaticFilesHandler message. Does not implicitly {@link google.appengine.v1.StaticFilesHandler.verify|verify} messages. + * @param message StaticFilesHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IStaticFilesHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StaticFilesHandler message, length delimited. Does not implicitly {@link google.appengine.v1.StaticFilesHandler.verify|verify} messages. + * @param message StaticFilesHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IStaticFilesHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StaticFilesHandler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StaticFilesHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.StaticFilesHandler; + + /** + * Decodes a StaticFilesHandler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StaticFilesHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.StaticFilesHandler; + + /** + * Verifies a StaticFilesHandler message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StaticFilesHandler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StaticFilesHandler + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.StaticFilesHandler; + + /** + * Creates a plain object from a StaticFilesHandler message. Also converts values to other types if specified. + * @param message StaticFilesHandler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.StaticFilesHandler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StaticFilesHandler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StaticFilesHandler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScriptHandler. */ + interface IScriptHandler { + + /** ScriptHandler scriptPath */ + scriptPath?: (string|null); + } + + /** Represents a ScriptHandler. */ + class ScriptHandler implements IScriptHandler { + + /** + * Constructs a new ScriptHandler. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IScriptHandler); + + /** ScriptHandler scriptPath. */ + public scriptPath: string; + + /** + * Creates a new ScriptHandler instance using the specified properties. + * @param [properties] Properties to set + * @returns ScriptHandler instance + */ + public static create(properties?: google.appengine.v1.IScriptHandler): google.appengine.v1.ScriptHandler; + + /** + * Encodes the specified ScriptHandler message. Does not implicitly {@link google.appengine.v1.ScriptHandler.verify|verify} messages. + * @param message ScriptHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IScriptHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScriptHandler message, length delimited. Does not implicitly {@link google.appengine.v1.ScriptHandler.verify|verify} messages. + * @param message ScriptHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IScriptHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScriptHandler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScriptHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ScriptHandler; + + /** + * Decodes a ScriptHandler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScriptHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ScriptHandler; + + /** + * Verifies a ScriptHandler message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScriptHandler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScriptHandler + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ScriptHandler; + + /** + * Creates a plain object from a ScriptHandler message. Also converts values to other types if specified. + * @param message ScriptHandler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ScriptHandler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScriptHandler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScriptHandler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiEndpointHandler. */ + interface IApiEndpointHandler { + + /** ApiEndpointHandler scriptPath */ + scriptPath?: (string|null); + } + + /** Represents an ApiEndpointHandler. */ + class ApiEndpointHandler implements IApiEndpointHandler { + + /** + * Constructs a new ApiEndpointHandler. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IApiEndpointHandler); + + /** ApiEndpointHandler scriptPath. */ + public scriptPath: string; + + /** + * Creates a new ApiEndpointHandler instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiEndpointHandler instance + */ + public static create(properties?: google.appengine.v1.IApiEndpointHandler): google.appengine.v1.ApiEndpointHandler; + + /** + * Encodes the specified ApiEndpointHandler message. Does not implicitly {@link google.appengine.v1.ApiEndpointHandler.verify|verify} messages. + * @param message ApiEndpointHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IApiEndpointHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiEndpointHandler message, length delimited. Does not implicitly {@link google.appengine.v1.ApiEndpointHandler.verify|verify} messages. + * @param message ApiEndpointHandler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IApiEndpointHandler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiEndpointHandler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiEndpointHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ApiEndpointHandler; + + /** + * Decodes an ApiEndpointHandler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiEndpointHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ApiEndpointHandler; + + /** + * Verifies an ApiEndpointHandler message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApiEndpointHandler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiEndpointHandler + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ApiEndpointHandler; + + /** + * Creates a plain object from an ApiEndpointHandler message. Also converts values to other types if specified. + * @param message ApiEndpointHandler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ApiEndpointHandler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiEndpointHandler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiEndpointHandler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HealthCheck. */ + interface IHealthCheck { + + /** HealthCheck disableHealthCheck */ + disableHealthCheck?: (boolean|null); + + /** HealthCheck host */ + host?: (string|null); + + /** HealthCheck healthyThreshold */ + healthyThreshold?: (number|null); + + /** HealthCheck unhealthyThreshold */ + unhealthyThreshold?: (number|null); + + /** HealthCheck restartThreshold */ + restartThreshold?: (number|null); + + /** HealthCheck checkInterval */ + checkInterval?: (google.protobuf.IDuration|null); + + /** HealthCheck timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a HealthCheck. */ + class HealthCheck implements IHealthCheck { + + /** + * Constructs a new HealthCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IHealthCheck); + + /** HealthCheck disableHealthCheck. */ + public disableHealthCheck: boolean; + + /** HealthCheck host. */ + public host: string; + + /** HealthCheck healthyThreshold. */ + public healthyThreshold: number; + + /** HealthCheck unhealthyThreshold. */ + public unhealthyThreshold: number; + + /** HealthCheck restartThreshold. */ + public restartThreshold: number; + + /** HealthCheck checkInterval. */ + public checkInterval?: (google.protobuf.IDuration|null); + + /** HealthCheck timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new HealthCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthCheck instance + */ + public static create(properties?: google.appengine.v1.IHealthCheck): google.appengine.v1.HealthCheck; + + /** + * Encodes the specified HealthCheck message. Does not implicitly {@link google.appengine.v1.HealthCheck.verify|verify} messages. + * @param message HealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthCheck message, length delimited. Does not implicitly {@link google.appengine.v1.HealthCheck.verify|verify} messages. + * @param message HealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.HealthCheck; + + /** + * Decodes a HealthCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.HealthCheck; + + /** + * Verifies a HealthCheck message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthCheck + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.HealthCheck; + + /** + * Creates a plain object from a HealthCheck message. Also converts values to other types if specified. + * @param message HealthCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.HealthCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HealthCheck + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadinessCheck. */ + interface IReadinessCheck { + + /** ReadinessCheck path */ + path?: (string|null); + + /** ReadinessCheck host */ + host?: (string|null); + + /** ReadinessCheck failureThreshold */ + failureThreshold?: (number|null); + + /** ReadinessCheck successThreshold */ + successThreshold?: (number|null); + + /** ReadinessCheck checkInterval */ + checkInterval?: (google.protobuf.IDuration|null); + + /** ReadinessCheck timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** ReadinessCheck appStartTimeout */ + appStartTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a ReadinessCheck. */ + class ReadinessCheck implements IReadinessCheck { + + /** + * Constructs a new ReadinessCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IReadinessCheck); + + /** ReadinessCheck path. */ + public path: string; + + /** ReadinessCheck host. */ + public host: string; + + /** ReadinessCheck failureThreshold. */ + public failureThreshold: number; + + /** ReadinessCheck successThreshold. */ + public successThreshold: number; + + /** ReadinessCheck checkInterval. */ + public checkInterval?: (google.protobuf.IDuration|null); + + /** ReadinessCheck timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** ReadinessCheck appStartTimeout. */ + public appStartTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new ReadinessCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadinessCheck instance + */ + public static create(properties?: google.appengine.v1.IReadinessCheck): google.appengine.v1.ReadinessCheck; + + /** + * Encodes the specified ReadinessCheck message. Does not implicitly {@link google.appengine.v1.ReadinessCheck.verify|verify} messages. + * @param message ReadinessCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IReadinessCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadinessCheck message, length delimited. Does not implicitly {@link google.appengine.v1.ReadinessCheck.verify|verify} messages. + * @param message ReadinessCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IReadinessCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadinessCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadinessCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ReadinessCheck; + + /** + * Decodes a ReadinessCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadinessCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ReadinessCheck; + + /** + * Verifies a ReadinessCheck message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadinessCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadinessCheck + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ReadinessCheck; + + /** + * Creates a plain object from a ReadinessCheck message. Also converts values to other types if specified. + * @param message ReadinessCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ReadinessCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadinessCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadinessCheck + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LivenessCheck. */ + interface ILivenessCheck { + + /** LivenessCheck path */ + path?: (string|null); + + /** LivenessCheck host */ + host?: (string|null); + + /** LivenessCheck failureThreshold */ + failureThreshold?: (number|null); + + /** LivenessCheck successThreshold */ + successThreshold?: (number|null); + + /** LivenessCheck checkInterval */ + checkInterval?: (google.protobuf.IDuration|null); + + /** LivenessCheck timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** LivenessCheck initialDelay */ + initialDelay?: (google.protobuf.IDuration|null); + } + + /** Represents a LivenessCheck. */ + class LivenessCheck implements ILivenessCheck { + + /** + * Constructs a new LivenessCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ILivenessCheck); + + /** LivenessCheck path. */ + public path: string; + + /** LivenessCheck host. */ + public host: string; + + /** LivenessCheck failureThreshold. */ + public failureThreshold: number; + + /** LivenessCheck successThreshold. */ + public successThreshold: number; + + /** LivenessCheck checkInterval. */ + public checkInterval?: (google.protobuf.IDuration|null); + + /** LivenessCheck timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** LivenessCheck initialDelay. */ + public initialDelay?: (google.protobuf.IDuration|null); + + /** + * Creates a new LivenessCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns LivenessCheck instance + */ + public static create(properties?: google.appengine.v1.ILivenessCheck): google.appengine.v1.LivenessCheck; + + /** + * Encodes the specified LivenessCheck message. Does not implicitly {@link google.appengine.v1.LivenessCheck.verify|verify} messages. + * @param message LivenessCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ILivenessCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LivenessCheck message, length delimited. Does not implicitly {@link google.appengine.v1.LivenessCheck.verify|verify} messages. + * @param message LivenessCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ILivenessCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LivenessCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LivenessCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.LivenessCheck; + + /** + * Decodes a LivenessCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LivenessCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.LivenessCheck; + + /** + * Verifies a LivenessCheck message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LivenessCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LivenessCheck + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.LivenessCheck; + + /** + * Creates a plain object from a LivenessCheck message. Also converts values to other types if specified. + * @param message LivenessCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.LivenessCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LivenessCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LivenessCheck + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Library. */ + interface ILibrary { + + /** Library name */ + name?: (string|null); + + /** Library version */ + version?: (string|null); + } + + /** Represents a Library. */ + class Library implements ILibrary { + + /** + * Constructs a new Library. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ILibrary); + + /** Library name. */ + public name: string; + + /** Library version. */ + public version: string; + + /** + * Creates a new Library instance using the specified properties. + * @param [properties] Properties to set + * @returns Library instance + */ + public static create(properties?: google.appengine.v1.ILibrary): google.appengine.v1.Library; + + /** + * Encodes the specified Library message. Does not implicitly {@link google.appengine.v1.Library.verify|verify} messages. + * @param message Library message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ILibrary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Library message, length delimited. Does not implicitly {@link google.appengine.v1.Library.verify|verify} messages. + * @param message Library message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ILibrary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Library message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Library + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Library; + + /** + * Decodes a Library message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Library + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Library; + + /** + * Verifies a Library message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Library message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Library + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Library; + + /** + * Creates a plain object from a Library message. Also converts values to other types if specified. + * @param message Library + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Library, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Library to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Library + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** AuthFailAction enum. */ + enum AuthFailAction { + AUTH_FAIL_ACTION_UNSPECIFIED = 0, + AUTH_FAIL_ACTION_REDIRECT = 1, + AUTH_FAIL_ACTION_UNAUTHORIZED = 2 + } + + /** LoginRequirement enum. */ + enum LoginRequirement { + LOGIN_UNSPECIFIED = 0, + LOGIN_OPTIONAL = 1, + LOGIN_ADMIN = 2, + LOGIN_REQUIRED = 3 + } + + /** SecurityLevel enum. */ + enum SecurityLevel { + SECURE_UNSPECIFIED = 0, + SECURE_DEFAULT = 0, + SECURE_NEVER = 1, + SECURE_OPTIONAL = 2, + SECURE_ALWAYS = 3 + } + + /** Represents an Applications */ + class Applications extends $protobuf.rpc.Service { + + /** + * Constructs a new Applications 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 Applications 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): Applications; + + /** + * Calls GetApplication. + * @param request GetApplicationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Application + */ + public getApplication(request: google.appengine.v1.IGetApplicationRequest, callback: google.appengine.v1.Applications.GetApplicationCallback): void; + + /** + * Calls GetApplication. + * @param request GetApplicationRequest message or plain object + * @returns Promise + */ + public getApplication(request: google.appengine.v1.IGetApplicationRequest): Promise; + + /** + * Calls CreateApplication. + * @param request CreateApplicationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createApplication(request: google.appengine.v1.ICreateApplicationRequest, callback: google.appengine.v1.Applications.CreateApplicationCallback): void; + + /** + * Calls CreateApplication. + * @param request CreateApplicationRequest message or plain object + * @returns Promise + */ + public createApplication(request: google.appengine.v1.ICreateApplicationRequest): Promise; + + /** + * Calls UpdateApplication. + * @param request UpdateApplicationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateApplication(request: google.appengine.v1.IUpdateApplicationRequest, callback: google.appengine.v1.Applications.UpdateApplicationCallback): void; + + /** + * Calls UpdateApplication. + * @param request UpdateApplicationRequest message or plain object + * @returns Promise + */ + public updateApplication(request: google.appengine.v1.IUpdateApplicationRequest): Promise; + + /** + * Calls RepairApplication. + * @param request RepairApplicationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public repairApplication(request: google.appengine.v1.IRepairApplicationRequest, callback: google.appengine.v1.Applications.RepairApplicationCallback): void; + + /** + * Calls RepairApplication. + * @param request RepairApplicationRequest message or plain object + * @returns Promise + */ + public repairApplication(request: google.appengine.v1.IRepairApplicationRequest): Promise; + } + + namespace Applications { + + /** + * Callback as used by {@link google.appengine.v1.Applications|getApplication}. + * @param error Error, if any + * @param [response] Application + */ + type GetApplicationCallback = (error: (Error|null), response?: google.appengine.v1.Application) => void; + + /** + * Callback as used by {@link google.appengine.v1.Applications|createApplication}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateApplicationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.appengine.v1.Applications|updateApplication}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateApplicationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.appengine.v1.Applications|repairApplication}. + * @param error Error, if any + * @param [response] Operation + */ + type RepairApplicationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a GetApplicationRequest. */ + interface IGetApplicationRequest { + + /** GetApplicationRequest name */ + name?: (string|null); + } + + /** Represents a GetApplicationRequest. */ + class GetApplicationRequest implements IGetApplicationRequest { + + /** + * Constructs a new GetApplicationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IGetApplicationRequest); + + /** GetApplicationRequest name. */ + public name: string; + + /** + * Creates a new GetApplicationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApplicationRequest instance + */ + public static create(properties?: google.appengine.v1.IGetApplicationRequest): google.appengine.v1.GetApplicationRequest; + + /** + * Encodes the specified GetApplicationRequest message. Does not implicitly {@link google.appengine.v1.GetApplicationRequest.verify|verify} messages. + * @param message GetApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IGetApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApplicationRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetApplicationRequest.verify|verify} messages. + * @param message GetApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IGetApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApplicationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.GetApplicationRequest; + + /** + * Decodes a GetApplicationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.GetApplicationRequest; + + /** + * Verifies a GetApplicationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApplicationRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.GetApplicationRequest; + + /** + * Creates a plain object from a GetApplicationRequest message. Also converts values to other types if specified. + * @param message GetApplicationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.GetApplicationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApplicationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApplicationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateApplicationRequest. */ + interface ICreateApplicationRequest { + + /** CreateApplicationRequest application */ + application?: (google.appengine.v1.IApplication|null); + } + + /** Represents a CreateApplicationRequest. */ + class CreateApplicationRequest implements ICreateApplicationRequest { + + /** + * Constructs a new CreateApplicationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ICreateApplicationRequest); + + /** CreateApplicationRequest application. */ + public application?: (google.appengine.v1.IApplication|null); + + /** + * Creates a new CreateApplicationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApplicationRequest instance + */ + public static create(properties?: google.appengine.v1.ICreateApplicationRequest): google.appengine.v1.CreateApplicationRequest; + + /** + * Encodes the specified CreateApplicationRequest message. Does not implicitly {@link google.appengine.v1.CreateApplicationRequest.verify|verify} messages. + * @param message CreateApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ICreateApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApplicationRequest message, length delimited. Does not implicitly {@link google.appengine.v1.CreateApplicationRequest.verify|verify} messages. + * @param message CreateApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ICreateApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApplicationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.CreateApplicationRequest; + + /** + * Decodes a CreateApplicationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.CreateApplicationRequest; + + /** + * Verifies a CreateApplicationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApplicationRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.CreateApplicationRequest; + + /** + * Creates a plain object from a CreateApplicationRequest message. Also converts values to other types if specified. + * @param message CreateApplicationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.CreateApplicationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApplicationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApplicationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApplicationRequest. */ + interface IUpdateApplicationRequest { + + /** UpdateApplicationRequest name */ + name?: (string|null); + + /** UpdateApplicationRequest application */ + application?: (google.appengine.v1.IApplication|null); + + /** UpdateApplicationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateApplicationRequest. */ + class UpdateApplicationRequest implements IUpdateApplicationRequest { + + /** + * Constructs a new UpdateApplicationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IUpdateApplicationRequest); + + /** UpdateApplicationRequest name. */ + public name: string; + + /** UpdateApplicationRequest application. */ + public application?: (google.appengine.v1.IApplication|null); + + /** UpdateApplicationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateApplicationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApplicationRequest instance + */ + public static create(properties?: google.appengine.v1.IUpdateApplicationRequest): google.appengine.v1.UpdateApplicationRequest; + + /** + * Encodes the specified UpdateApplicationRequest message. Does not implicitly {@link google.appengine.v1.UpdateApplicationRequest.verify|verify} messages. + * @param message UpdateApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IUpdateApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApplicationRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateApplicationRequest.verify|verify} messages. + * @param message UpdateApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IUpdateApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApplicationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.UpdateApplicationRequest; + + /** + * Decodes an UpdateApplicationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.UpdateApplicationRequest; + + /** + * Verifies an UpdateApplicationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApplicationRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.UpdateApplicationRequest; + + /** + * Creates a plain object from an UpdateApplicationRequest message. Also converts values to other types if specified. + * @param message UpdateApplicationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.UpdateApplicationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApplicationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApplicationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RepairApplicationRequest. */ + interface IRepairApplicationRequest { + + /** RepairApplicationRequest name */ + name?: (string|null); + } + + /** Represents a RepairApplicationRequest. */ + class RepairApplicationRequest implements IRepairApplicationRequest { + + /** + * Constructs a new RepairApplicationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IRepairApplicationRequest); + + /** RepairApplicationRequest name. */ + public name: string; + + /** + * Creates a new RepairApplicationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RepairApplicationRequest instance + */ + public static create(properties?: google.appengine.v1.IRepairApplicationRequest): google.appengine.v1.RepairApplicationRequest; + + /** + * Encodes the specified RepairApplicationRequest message. Does not implicitly {@link google.appengine.v1.RepairApplicationRequest.verify|verify} messages. + * @param message RepairApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IRepairApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RepairApplicationRequest message, length delimited. Does not implicitly {@link google.appengine.v1.RepairApplicationRequest.verify|verify} messages. + * @param message RepairApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IRepairApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RepairApplicationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RepairApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.RepairApplicationRequest; + + /** + * Decodes a RepairApplicationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RepairApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.RepairApplicationRequest; + + /** + * Verifies a RepairApplicationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RepairApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RepairApplicationRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.RepairApplicationRequest; + + /** + * Creates a plain object from a RepairApplicationRequest message. Also converts values to other types if specified. + * @param message RepairApplicationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.RepairApplicationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RepairApplicationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RepairApplicationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Services */ + class Services extends $protobuf.rpc.Service { + + /** + * Constructs a new Services service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Services service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Services; + + /** + * Calls ListServices. + * @param request ListServicesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListServicesResponse + */ + public listServices(request: google.appengine.v1.IListServicesRequest, callback: google.appengine.v1.Services.ListServicesCallback): void; + + /** + * Calls ListServices. + * @param request ListServicesRequest message or plain object + * @returns Promise + */ + public listServices(request: google.appengine.v1.IListServicesRequest): Promise; + + /** + * Calls GetService. + * @param request GetServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Service + */ + public getService(request: google.appengine.v1.IGetServiceRequest, callback: google.appengine.v1.Services.GetServiceCallback): void; + + /** + * Calls GetService. + * @param request GetServiceRequest message or plain object + * @returns Promise + */ + public getService(request: google.appengine.v1.IGetServiceRequest): Promise; + + /** + * Calls UpdateService. + * @param request UpdateServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateService(request: google.appengine.v1.IUpdateServiceRequest, callback: google.appengine.v1.Services.UpdateServiceCallback): void; + + /** + * Calls UpdateService. + * @param request UpdateServiceRequest message or plain object + * @returns Promise + */ + public updateService(request: google.appengine.v1.IUpdateServiceRequest): Promise; + + /** + * Calls DeleteService. + * @param request DeleteServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteService(request: google.appengine.v1.IDeleteServiceRequest, callback: google.appengine.v1.Services.DeleteServiceCallback): void; + + /** + * Calls DeleteService. + * @param request DeleteServiceRequest message or plain object + * @returns Promise + */ + public deleteService(request: google.appengine.v1.IDeleteServiceRequest): Promise; + } + + namespace Services { + + /** + * Callback as used by {@link google.appengine.v1.Services|listServices}. + * @param error Error, if any + * @param [response] ListServicesResponse + */ + type ListServicesCallback = (error: (Error|null), response?: google.appengine.v1.ListServicesResponse) => void; + + /** + * Callback as used by {@link google.appengine.v1.Services|getService}. + * @param error Error, if any + * @param [response] Service + */ + type GetServiceCallback = (error: (Error|null), response?: google.appengine.v1.Service) => void; + + /** + * Callback as used by {@link google.appengine.v1.Services|updateService}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.appengine.v1.Services|deleteService}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ListServicesRequest. */ + interface IListServicesRequest { + + /** ListServicesRequest parent */ + parent?: (string|null); + + /** ListServicesRequest pageSize */ + pageSize?: (number|null); + + /** ListServicesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListServicesRequest. */ + class ListServicesRequest implements IListServicesRequest { + + /** + * Constructs a new ListServicesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListServicesRequest); + + /** ListServicesRequest parent. */ + public parent: string; + + /** ListServicesRequest pageSize. */ + public pageSize: number; + + /** ListServicesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListServicesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServicesRequest instance + */ + public static create(properties?: google.appengine.v1.IListServicesRequest): google.appengine.v1.ListServicesRequest; + + /** + * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.appengine.v1.ListServicesRequest.verify|verify} messages. + * @param message ListServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListServicesRequest.verify|verify} messages. + * @param message ListServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListServicesRequest; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListServicesRequest; + + /** + * Verifies a ListServicesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServicesRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListServicesRequest; + + /** + * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. + * @param message ListServicesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServicesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServicesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListServicesResponse. */ + interface IListServicesResponse { + + /** ListServicesResponse services */ + services?: (google.appengine.v1.IService[]|null); + + /** ListServicesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListServicesResponse. */ + class ListServicesResponse implements IListServicesResponse { + + /** + * Constructs a new ListServicesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListServicesResponse); + + /** ListServicesResponse services. */ + public services: google.appengine.v1.IService[]; + + /** ListServicesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListServicesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServicesResponse instance + */ + public static create(properties?: google.appengine.v1.IListServicesResponse): google.appengine.v1.ListServicesResponse; + + /** + * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.appengine.v1.ListServicesResponse.verify|verify} messages. + * @param message ListServicesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListServicesResponse.verify|verify} messages. + * @param message ListServicesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListServicesResponse; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListServicesResponse; + + /** + * Verifies a ListServicesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServicesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServicesResponse + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListServicesResponse; + + /** + * Creates a plain object from a ListServicesResponse message. Also converts values to other types if specified. + * @param message ListServicesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListServicesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServicesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServicesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetServiceRequest. */ + interface IGetServiceRequest { + + /** GetServiceRequest name */ + name?: (string|null); + } + + /** Represents a GetServiceRequest. */ + class GetServiceRequest implements IGetServiceRequest { + + /** + * Constructs a new GetServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IGetServiceRequest); + + /** GetServiceRequest name. */ + public name: string; + + /** + * Creates a new GetServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServiceRequest instance + */ + public static create(properties?: google.appengine.v1.IGetServiceRequest): google.appengine.v1.GetServiceRequest; + + /** + * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.appengine.v1.GetServiceRequest.verify|verify} messages. + * @param message GetServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetServiceRequest.verify|verify} messages. + * @param message GetServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.GetServiceRequest; + + /** + * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.GetServiceRequest; + + /** + * Verifies a GetServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.GetServiceRequest; + + /** + * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. + * @param message GetServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.GetServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateServiceRequest. */ + interface IUpdateServiceRequest { + + /** UpdateServiceRequest name */ + name?: (string|null); + + /** UpdateServiceRequest service */ + service?: (google.appengine.v1.IService|null); + + /** UpdateServiceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateServiceRequest migrateTraffic */ + migrateTraffic?: (boolean|null); + } + + /** Represents an UpdateServiceRequest. */ + class UpdateServiceRequest implements IUpdateServiceRequest { + + /** + * Constructs a new UpdateServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IUpdateServiceRequest); + + /** UpdateServiceRequest name. */ + public name: string; + + /** UpdateServiceRequest service. */ + public service?: (google.appengine.v1.IService|null); + + /** UpdateServiceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateServiceRequest migrateTraffic. */ + public migrateTraffic: boolean; + + /** + * Creates a new UpdateServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateServiceRequest instance + */ + public static create(properties?: google.appengine.v1.IUpdateServiceRequest): google.appengine.v1.UpdateServiceRequest; + + /** + * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.appengine.v1.UpdateServiceRequest.verify|verify} messages. + * @param message UpdateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateServiceRequest.verify|verify} messages. + * @param message UpdateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.UpdateServiceRequest; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.UpdateServiceRequest; + + /** + * Verifies an UpdateServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.UpdateServiceRequest; + + /** + * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. + * @param message UpdateServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.UpdateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteServiceRequest. */ + interface IDeleteServiceRequest { + + /** DeleteServiceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteServiceRequest. */ + class DeleteServiceRequest implements IDeleteServiceRequest { + + /** + * Constructs a new DeleteServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IDeleteServiceRequest); + + /** DeleteServiceRequest name. */ + public name: string; + + /** + * Creates a new DeleteServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteServiceRequest instance + */ + public static create(properties?: google.appengine.v1.IDeleteServiceRequest): google.appengine.v1.DeleteServiceRequest; + + /** + * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.appengine.v1.DeleteServiceRequest.verify|verify} messages. + * @param message DeleteServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteServiceRequest.verify|verify} messages. + * @param message DeleteServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.DeleteServiceRequest; + + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.DeleteServiceRequest; + + /** + * Verifies a DeleteServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.DeleteServiceRequest; + + /** + * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. + * @param message DeleteServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.DeleteServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Versions */ + class Versions extends $protobuf.rpc.Service { + + /** + * Constructs a new Versions 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 Versions 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): Versions; + + /** + * Calls ListVersions. + * @param request ListVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListVersionsResponse + */ + public listVersions(request: google.appengine.v1.IListVersionsRequest, callback: google.appengine.v1.Versions.ListVersionsCallback): void; + + /** + * Calls ListVersions. + * @param request ListVersionsRequest message or plain object + * @returns Promise + */ + public listVersions(request: google.appengine.v1.IListVersionsRequest): Promise; + + /** + * Calls GetVersion. + * @param request GetVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Version + */ + public getVersion(request: google.appengine.v1.IGetVersionRequest, callback: google.appengine.v1.Versions.GetVersionCallback): void; + + /** + * Calls GetVersion. + * @param request GetVersionRequest message or plain object + * @returns Promise + */ + public getVersion(request: google.appengine.v1.IGetVersionRequest): Promise; + + /** + * Calls CreateVersion. + * @param request CreateVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createVersion(request: google.appengine.v1.ICreateVersionRequest, callback: google.appengine.v1.Versions.CreateVersionCallback): void; + + /** + * Calls CreateVersion. + * @param request CreateVersionRequest message or plain object + * @returns Promise + */ + public createVersion(request: google.appengine.v1.ICreateVersionRequest): Promise; + + /** + * Calls UpdateVersion. + * @param request UpdateVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateVersion(request: google.appengine.v1.IUpdateVersionRequest, callback: google.appengine.v1.Versions.UpdateVersionCallback): void; + + /** + * Calls UpdateVersion. + * @param request UpdateVersionRequest message or plain object + * @returns Promise + */ + public updateVersion(request: google.appengine.v1.IUpdateVersionRequest): Promise; + + /** + * Calls DeleteVersion. + * @param request DeleteVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteVersion(request: google.appengine.v1.IDeleteVersionRequest, callback: google.appengine.v1.Versions.DeleteVersionCallback): void; + + /** + * Calls DeleteVersion. + * @param request DeleteVersionRequest message or plain object + * @returns Promise + */ + public deleteVersion(request: google.appengine.v1.IDeleteVersionRequest): Promise; + } + + namespace Versions { + + /** + * Callback as used by {@link google.appengine.v1.Versions|listVersions}. + * @param error Error, if any + * @param [response] ListVersionsResponse + */ + type ListVersionsCallback = (error: (Error|null), response?: google.appengine.v1.ListVersionsResponse) => void; + + /** + * Callback as used by {@link google.appengine.v1.Versions|getVersion}. + * @param error Error, if any + * @param [response] Version + */ + type GetVersionCallback = (error: (Error|null), response?: google.appengine.v1.Version) => void; + + /** + * Callback as used by {@link google.appengine.v1.Versions|createVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.appengine.v1.Versions|updateVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.appengine.v1.Versions|deleteVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ListVersionsRequest. */ + interface IListVersionsRequest { + + /** ListVersionsRequest parent */ + parent?: (string|null); + + /** ListVersionsRequest view */ + view?: (google.appengine.v1.VersionView|keyof typeof google.appengine.v1.VersionView|null); + + /** ListVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListVersionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListVersionsRequest. */ + class ListVersionsRequest implements IListVersionsRequest { + + /** + * Constructs a new ListVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListVersionsRequest); + + /** ListVersionsRequest parent. */ + public parent: string; + + /** ListVersionsRequest view. */ + public view: (google.appengine.v1.VersionView|keyof typeof google.appengine.v1.VersionView); + + /** ListVersionsRequest pageSize. */ + public pageSize: number; + + /** ListVersionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVersionsRequest instance + */ + public static create(properties?: google.appengine.v1.IListVersionsRequest): google.appengine.v1.ListVersionsRequest; + + /** + * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.appengine.v1.ListVersionsRequest.verify|verify} messages. + * @param message ListVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListVersionsRequest.verify|verify} messages. + * @param message ListVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListVersionsRequest; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListVersionsRequest; + + /** + * Verifies a ListVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListVersionsRequest; + + /** + * Creates a plain object from a ListVersionsRequest message. Also converts values to other types if specified. + * @param message ListVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVersionsResponse. */ + interface IListVersionsResponse { + + /** ListVersionsResponse versions */ + versions?: (google.appengine.v1.IVersion[]|null); + + /** ListVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListVersionsResponse. */ + class ListVersionsResponse implements IListVersionsResponse { + + /** + * Constructs a new ListVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListVersionsResponse); + + /** ListVersionsResponse versions. */ + public versions: google.appengine.v1.IVersion[]; + + /** ListVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVersionsResponse instance + */ + public static create(properties?: google.appengine.v1.IListVersionsResponse): google.appengine.v1.ListVersionsResponse; + + /** + * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.appengine.v1.ListVersionsResponse.verify|verify} messages. + * @param message ListVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVersionsResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListVersionsResponse.verify|verify} messages. + * @param message ListVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListVersionsResponse; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListVersionsResponse; + + /** + * Verifies a ListVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListVersionsResponse; + + /** + * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. + * @param message ListVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VersionView enum. */ + enum VersionView { + BASIC = 0, + FULL = 1 + } + + /** Properties of a GetVersionRequest. */ + interface IGetVersionRequest { + + /** GetVersionRequest name */ + name?: (string|null); + + /** GetVersionRequest view */ + view?: (google.appengine.v1.VersionView|keyof typeof google.appengine.v1.VersionView|null); + } + + /** Represents a GetVersionRequest. */ + class GetVersionRequest implements IGetVersionRequest { + + /** + * Constructs a new GetVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IGetVersionRequest); + + /** GetVersionRequest name. */ + public name: string; + + /** GetVersionRequest view. */ + public view: (google.appengine.v1.VersionView|keyof typeof google.appengine.v1.VersionView); + + /** + * Creates a new GetVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVersionRequest instance + */ + public static create(properties?: google.appengine.v1.IGetVersionRequest): google.appengine.v1.GetVersionRequest; + + /** + * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.appengine.v1.GetVersionRequest.verify|verify} messages. + * @param message GetVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVersionRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetVersionRequest.verify|verify} messages. + * @param message GetVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.GetVersionRequest; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.GetVersionRequest; + + /** + * Verifies a GetVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.GetVersionRequest; + + /** + * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. + * @param message GetVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.GetVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateVersionRequest. */ + interface ICreateVersionRequest { + + /** CreateVersionRequest parent */ + parent?: (string|null); + + /** CreateVersionRequest version */ + version?: (google.appengine.v1.IVersion|null); + } + + /** Represents a CreateVersionRequest. */ + class CreateVersionRequest implements ICreateVersionRequest { + + /** + * Constructs a new CreateVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ICreateVersionRequest); + + /** CreateVersionRequest parent. */ + public parent: string; + + /** CreateVersionRequest version. */ + public version?: (google.appengine.v1.IVersion|null); + + /** + * Creates a new CreateVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateVersionRequest instance + */ + public static create(properties?: google.appengine.v1.ICreateVersionRequest): google.appengine.v1.CreateVersionRequest; + + /** + * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.appengine.v1.CreateVersionRequest.verify|verify} messages. + * @param message CreateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.appengine.v1.CreateVersionRequest.verify|verify} messages. + * @param message CreateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.CreateVersionRequest; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.CreateVersionRequest; + + /** + * Verifies a CreateVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.CreateVersionRequest; + + /** + * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. + * @param message CreateVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.CreateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateVersionRequest. */ + interface IUpdateVersionRequest { + + /** UpdateVersionRequest name */ + name?: (string|null); + + /** UpdateVersionRequest version */ + version?: (google.appengine.v1.IVersion|null); + + /** UpdateVersionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateVersionRequest. */ + class UpdateVersionRequest implements IUpdateVersionRequest { + + /** + * Constructs a new UpdateVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IUpdateVersionRequest); + + /** UpdateVersionRequest name. */ + public name: string; + + /** UpdateVersionRequest version. */ + public version?: (google.appengine.v1.IVersion|null); + + /** UpdateVersionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateVersionRequest instance + */ + public static create(properties?: google.appengine.v1.IUpdateVersionRequest): google.appengine.v1.UpdateVersionRequest; + + /** + * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.appengine.v1.UpdateVersionRequest.verify|verify} messages. + * @param message UpdateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateVersionRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateVersionRequest.verify|verify} messages. + * @param message UpdateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.UpdateVersionRequest; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.UpdateVersionRequest; + + /** + * Verifies an UpdateVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.UpdateVersionRequest; + + /** + * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. + * @param message UpdateVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.UpdateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteVersionRequest. */ + interface IDeleteVersionRequest { + + /** DeleteVersionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteVersionRequest. */ + class DeleteVersionRequest implements IDeleteVersionRequest { + + /** + * Constructs a new DeleteVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IDeleteVersionRequest); + + /** DeleteVersionRequest name. */ + public name: string; + + /** + * Creates a new DeleteVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteVersionRequest instance + */ + public static create(properties?: google.appengine.v1.IDeleteVersionRequest): google.appengine.v1.DeleteVersionRequest; + + /** + * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.appengine.v1.DeleteVersionRequest.verify|verify} messages. + * @param message DeleteVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteVersionRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteVersionRequest.verify|verify} messages. + * @param message DeleteVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.DeleteVersionRequest; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.DeleteVersionRequest; + + /** + * Verifies a DeleteVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.DeleteVersionRequest; + + /** + * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. + * @param message DeleteVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.DeleteVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an Instances */ + class Instances extends $protobuf.rpc.Service { + + /** + * Constructs a new Instances service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Instances service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Instances; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.appengine.v1.IListInstancesRequest, callback: google.appengine.v1.Instances.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.appengine.v1.IListInstancesRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.appengine.v1.IGetInstanceRequest, callback: google.appengine.v1.Instances.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.appengine.v1.IGetInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.appengine.v1.IDeleteInstanceRequest, callback: google.appengine.v1.Instances.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.appengine.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls DebugInstance. + * @param request DebugInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public debugInstance(request: google.appengine.v1.IDebugInstanceRequest, callback: google.appengine.v1.Instances.DebugInstanceCallback): void; + + /** + * Calls DebugInstance. + * @param request DebugInstanceRequest message or plain object + * @returns Promise + */ + public debugInstance(request: google.appengine.v1.IDebugInstanceRequest): Promise; + } + + namespace Instances { + + /** + * Callback as used by {@link google.appengine.v1.Instances|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.appengine.v1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.appengine.v1.Instances|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.appengine.v1.Instance) => void; + + /** + * Callback as used by {@link google.appengine.v1.Instances|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.appengine.v1.Instances|debugInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DebugInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.appengine.v1.IListInstancesRequest): google.appengine.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.appengine.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.appengine.v1.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.appengine.v1.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.appengine.v1.IListInstancesResponse): google.appengine.v1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.appengine.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.appengine.v1.IGetInstanceRequest): google.appengine.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.appengine.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.appengine.v1.IDeleteInstanceRequest): google.appengine.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.appengine.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DebugInstanceRequest. */ + interface IDebugInstanceRequest { + + /** DebugInstanceRequest name */ + name?: (string|null); + + /** DebugInstanceRequest sshKey */ + sshKey?: (string|null); + } + + /** Represents a DebugInstanceRequest. */ + class DebugInstanceRequest implements IDebugInstanceRequest { + + /** + * Constructs a new DebugInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IDebugInstanceRequest); + + /** DebugInstanceRequest name. */ + public name: string; + + /** DebugInstanceRequest sshKey. */ + public sshKey: string; + + /** + * Creates a new DebugInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DebugInstanceRequest instance + */ + public static create(properties?: google.appengine.v1.IDebugInstanceRequest): google.appengine.v1.DebugInstanceRequest; + + /** + * Encodes the specified DebugInstanceRequest message. Does not implicitly {@link google.appengine.v1.DebugInstanceRequest.verify|verify} messages. + * @param message DebugInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IDebugInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DebugInstanceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DebugInstanceRequest.verify|verify} messages. + * @param message DebugInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IDebugInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DebugInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DebugInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.DebugInstanceRequest; + + /** + * Decodes a DebugInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DebugInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.DebugInstanceRequest; + + /** + * Verifies a DebugInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DebugInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DebugInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.DebugInstanceRequest; + + /** + * Creates a plain object from a DebugInstanceRequest message. Also converts values to other types if specified. + * @param message DebugInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.DebugInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DebugInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DebugInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Firewall */ + class Firewall extends $protobuf.rpc.Service { + + /** + * Constructs a new Firewall 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 Firewall 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): Firewall; + + /** + * Calls ListIngressRules. + * @param request ListIngressRulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListIngressRulesResponse + */ + public listIngressRules(request: google.appengine.v1.IListIngressRulesRequest, callback: google.appengine.v1.Firewall.ListIngressRulesCallback): void; + + /** + * Calls ListIngressRules. + * @param request ListIngressRulesRequest message or plain object + * @returns Promise + */ + public listIngressRules(request: google.appengine.v1.IListIngressRulesRequest): Promise; + + /** + * Calls BatchUpdateIngressRules. + * @param request BatchUpdateIngressRulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchUpdateIngressRulesResponse + */ + public batchUpdateIngressRules(request: google.appengine.v1.IBatchUpdateIngressRulesRequest, callback: google.appengine.v1.Firewall.BatchUpdateIngressRulesCallback): void; + + /** + * Calls BatchUpdateIngressRules. + * @param request BatchUpdateIngressRulesRequest message or plain object + * @returns Promise + */ + public batchUpdateIngressRules(request: google.appengine.v1.IBatchUpdateIngressRulesRequest): Promise; + + /** + * Calls CreateIngressRule. + * @param request CreateIngressRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallRule + */ + public createIngressRule(request: google.appengine.v1.ICreateIngressRuleRequest, callback: google.appengine.v1.Firewall.CreateIngressRuleCallback): void; + + /** + * Calls CreateIngressRule. + * @param request CreateIngressRuleRequest message or plain object + * @returns Promise + */ + public createIngressRule(request: google.appengine.v1.ICreateIngressRuleRequest): Promise; + + /** + * Calls GetIngressRule. + * @param request GetIngressRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallRule + */ + public getIngressRule(request: google.appengine.v1.IGetIngressRuleRequest, callback: google.appengine.v1.Firewall.GetIngressRuleCallback): void; + + /** + * Calls GetIngressRule. + * @param request GetIngressRuleRequest message or plain object + * @returns Promise + */ + public getIngressRule(request: google.appengine.v1.IGetIngressRuleRequest): Promise; + + /** + * Calls UpdateIngressRule. + * @param request UpdateIngressRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallRule + */ + public updateIngressRule(request: google.appengine.v1.IUpdateIngressRuleRequest, callback: google.appengine.v1.Firewall.UpdateIngressRuleCallback): void; + + /** + * Calls UpdateIngressRule. + * @param request UpdateIngressRuleRequest message or plain object + * @returns Promise + */ + public updateIngressRule(request: google.appengine.v1.IUpdateIngressRuleRequest): Promise; + + /** + * Calls DeleteIngressRule. + * @param request DeleteIngressRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteIngressRule(request: google.appengine.v1.IDeleteIngressRuleRequest, callback: google.appengine.v1.Firewall.DeleteIngressRuleCallback): void; + + /** + * Calls DeleteIngressRule. + * @param request DeleteIngressRuleRequest message or plain object + * @returns Promise + */ + public deleteIngressRule(request: google.appengine.v1.IDeleteIngressRuleRequest): Promise; + } + + namespace Firewall { + + /** + * Callback as used by {@link google.appengine.v1.Firewall|listIngressRules}. + * @param error Error, if any + * @param [response] ListIngressRulesResponse + */ + type ListIngressRulesCallback = (error: (Error|null), response?: google.appengine.v1.ListIngressRulesResponse) => void; + + /** + * Callback as used by {@link google.appengine.v1.Firewall|batchUpdateIngressRules}. + * @param error Error, if any + * @param [response] BatchUpdateIngressRulesResponse + */ + type BatchUpdateIngressRulesCallback = (error: (Error|null), response?: google.appengine.v1.BatchUpdateIngressRulesResponse) => void; + + /** + * Callback as used by {@link google.appengine.v1.Firewall|createIngressRule}. + * @param error Error, if any + * @param [response] FirewallRule + */ + type CreateIngressRuleCallback = (error: (Error|null), response?: google.appengine.v1.FirewallRule) => void; + + /** + * Callback as used by {@link google.appengine.v1.Firewall|getIngressRule}. + * @param error Error, if any + * @param [response] FirewallRule + */ + type GetIngressRuleCallback = (error: (Error|null), response?: google.appengine.v1.FirewallRule) => void; + + /** + * Callback as used by {@link google.appengine.v1.Firewall|updateIngressRule}. + * @param error Error, if any + * @param [response] FirewallRule + */ + type UpdateIngressRuleCallback = (error: (Error|null), response?: google.appengine.v1.FirewallRule) => void; + + /** + * Callback as used by {@link google.appengine.v1.Firewall|deleteIngressRule}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteIngressRuleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a ListIngressRulesRequest. */ + interface IListIngressRulesRequest { + + /** ListIngressRulesRequest parent */ + parent?: (string|null); + + /** ListIngressRulesRequest pageSize */ + pageSize?: (number|null); + + /** ListIngressRulesRequest pageToken */ + pageToken?: (string|null); + + /** ListIngressRulesRequest matchingAddress */ + matchingAddress?: (string|null); + } + + /** Represents a ListIngressRulesRequest. */ + class ListIngressRulesRequest implements IListIngressRulesRequest { + + /** + * Constructs a new ListIngressRulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListIngressRulesRequest); + + /** ListIngressRulesRequest parent. */ + public parent: string; + + /** ListIngressRulesRequest pageSize. */ + public pageSize: number; + + /** ListIngressRulesRequest pageToken. */ + public pageToken: string; + + /** ListIngressRulesRequest matchingAddress. */ + public matchingAddress: string; + + /** + * Creates a new ListIngressRulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListIngressRulesRequest instance + */ + public static create(properties?: google.appengine.v1.IListIngressRulesRequest): google.appengine.v1.ListIngressRulesRequest; + + /** + * Encodes the specified ListIngressRulesRequest message. Does not implicitly {@link google.appengine.v1.ListIngressRulesRequest.verify|verify} messages. + * @param message ListIngressRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListIngressRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListIngressRulesRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListIngressRulesRequest.verify|verify} messages. + * @param message ListIngressRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListIngressRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListIngressRulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListIngressRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListIngressRulesRequest; + + /** + * Decodes a ListIngressRulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListIngressRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListIngressRulesRequest; + + /** + * Verifies a ListIngressRulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListIngressRulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListIngressRulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListIngressRulesRequest; + + /** + * Creates a plain object from a ListIngressRulesRequest message. Also converts values to other types if specified. + * @param message ListIngressRulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListIngressRulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListIngressRulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListIngressRulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListIngressRulesResponse. */ + interface IListIngressRulesResponse { + + /** ListIngressRulesResponse ingressRules */ + ingressRules?: (google.appengine.v1.IFirewallRule[]|null); + + /** ListIngressRulesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListIngressRulesResponse. */ + class ListIngressRulesResponse implements IListIngressRulesResponse { + + /** + * Constructs a new ListIngressRulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListIngressRulesResponse); + + /** ListIngressRulesResponse ingressRules. */ + public ingressRules: google.appengine.v1.IFirewallRule[]; + + /** ListIngressRulesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListIngressRulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListIngressRulesResponse instance + */ + public static create(properties?: google.appengine.v1.IListIngressRulesResponse): google.appengine.v1.ListIngressRulesResponse; + + /** + * Encodes the specified ListIngressRulesResponse message. Does not implicitly {@link google.appengine.v1.ListIngressRulesResponse.verify|verify} messages. + * @param message ListIngressRulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListIngressRulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListIngressRulesResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListIngressRulesResponse.verify|verify} messages. + * @param message ListIngressRulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListIngressRulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListIngressRulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListIngressRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListIngressRulesResponse; + + /** + * Decodes a ListIngressRulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListIngressRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListIngressRulesResponse; + + /** + * Verifies a ListIngressRulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListIngressRulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListIngressRulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListIngressRulesResponse; + + /** + * Creates a plain object from a ListIngressRulesResponse message. Also converts values to other types if specified. + * @param message ListIngressRulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListIngressRulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListIngressRulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListIngressRulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchUpdateIngressRulesRequest. */ + interface IBatchUpdateIngressRulesRequest { + + /** BatchUpdateIngressRulesRequest name */ + name?: (string|null); + + /** BatchUpdateIngressRulesRequest ingressRules */ + ingressRules?: (google.appengine.v1.IFirewallRule[]|null); + } + + /** Represents a BatchUpdateIngressRulesRequest. */ + class BatchUpdateIngressRulesRequest implements IBatchUpdateIngressRulesRequest { + + /** + * Constructs a new BatchUpdateIngressRulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IBatchUpdateIngressRulesRequest); + + /** BatchUpdateIngressRulesRequest name. */ + public name: string; + + /** BatchUpdateIngressRulesRequest ingressRules. */ + public ingressRules: google.appengine.v1.IFirewallRule[]; + + /** + * Creates a new BatchUpdateIngressRulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchUpdateIngressRulesRequest instance + */ + public static create(properties?: google.appengine.v1.IBatchUpdateIngressRulesRequest): google.appengine.v1.BatchUpdateIngressRulesRequest; + + /** + * Encodes the specified BatchUpdateIngressRulesRequest message. Does not implicitly {@link google.appengine.v1.BatchUpdateIngressRulesRequest.verify|verify} messages. + * @param message BatchUpdateIngressRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IBatchUpdateIngressRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchUpdateIngressRulesRequest message, length delimited. Does not implicitly {@link google.appengine.v1.BatchUpdateIngressRulesRequest.verify|verify} messages. + * @param message BatchUpdateIngressRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IBatchUpdateIngressRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchUpdateIngressRulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchUpdateIngressRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.BatchUpdateIngressRulesRequest; + + /** + * Decodes a BatchUpdateIngressRulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchUpdateIngressRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.BatchUpdateIngressRulesRequest; + + /** + * Verifies a BatchUpdateIngressRulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchUpdateIngressRulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchUpdateIngressRulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.BatchUpdateIngressRulesRequest; + + /** + * Creates a plain object from a BatchUpdateIngressRulesRequest message. Also converts values to other types if specified. + * @param message BatchUpdateIngressRulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.BatchUpdateIngressRulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchUpdateIngressRulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchUpdateIngressRulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchUpdateIngressRulesResponse. */ + interface IBatchUpdateIngressRulesResponse { + + /** BatchUpdateIngressRulesResponse ingressRules */ + ingressRules?: (google.appengine.v1.IFirewallRule[]|null); + } + + /** Represents a BatchUpdateIngressRulesResponse. */ + class BatchUpdateIngressRulesResponse implements IBatchUpdateIngressRulesResponse { + + /** + * Constructs a new BatchUpdateIngressRulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IBatchUpdateIngressRulesResponse); + + /** BatchUpdateIngressRulesResponse ingressRules. */ + public ingressRules: google.appengine.v1.IFirewallRule[]; + + /** + * Creates a new BatchUpdateIngressRulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchUpdateIngressRulesResponse instance + */ + public static create(properties?: google.appengine.v1.IBatchUpdateIngressRulesResponse): google.appengine.v1.BatchUpdateIngressRulesResponse; + + /** + * Encodes the specified BatchUpdateIngressRulesResponse message. Does not implicitly {@link google.appengine.v1.BatchUpdateIngressRulesResponse.verify|verify} messages. + * @param message BatchUpdateIngressRulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IBatchUpdateIngressRulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchUpdateIngressRulesResponse message, length delimited. Does not implicitly {@link google.appengine.v1.BatchUpdateIngressRulesResponse.verify|verify} messages. + * @param message BatchUpdateIngressRulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IBatchUpdateIngressRulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchUpdateIngressRulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchUpdateIngressRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.BatchUpdateIngressRulesResponse; + + /** + * Decodes a BatchUpdateIngressRulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchUpdateIngressRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.BatchUpdateIngressRulesResponse; + + /** + * Verifies a BatchUpdateIngressRulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchUpdateIngressRulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchUpdateIngressRulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.BatchUpdateIngressRulesResponse; + + /** + * Creates a plain object from a BatchUpdateIngressRulesResponse message. Also converts values to other types if specified. + * @param message BatchUpdateIngressRulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.BatchUpdateIngressRulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchUpdateIngressRulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchUpdateIngressRulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateIngressRuleRequest. */ + interface ICreateIngressRuleRequest { + + /** CreateIngressRuleRequest parent */ + parent?: (string|null); + + /** CreateIngressRuleRequest rule */ + rule?: (google.appengine.v1.IFirewallRule|null); + } + + /** Represents a CreateIngressRuleRequest. */ + class CreateIngressRuleRequest implements ICreateIngressRuleRequest { + + /** + * Constructs a new CreateIngressRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ICreateIngressRuleRequest); + + /** CreateIngressRuleRequest parent. */ + public parent: string; + + /** CreateIngressRuleRequest rule. */ + public rule?: (google.appengine.v1.IFirewallRule|null); + + /** + * Creates a new CreateIngressRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateIngressRuleRequest instance + */ + public static create(properties?: google.appengine.v1.ICreateIngressRuleRequest): google.appengine.v1.CreateIngressRuleRequest; + + /** + * Encodes the specified CreateIngressRuleRequest message. Does not implicitly {@link google.appengine.v1.CreateIngressRuleRequest.verify|verify} messages. + * @param message CreateIngressRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ICreateIngressRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateIngressRuleRequest message, length delimited. Does not implicitly {@link google.appengine.v1.CreateIngressRuleRequest.verify|verify} messages. + * @param message CreateIngressRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ICreateIngressRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateIngressRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.CreateIngressRuleRequest; + + /** + * Decodes a CreateIngressRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.CreateIngressRuleRequest; + + /** + * Verifies a CreateIngressRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateIngressRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateIngressRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.CreateIngressRuleRequest; + + /** + * Creates a plain object from a CreateIngressRuleRequest message. Also converts values to other types if specified. + * @param message CreateIngressRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.CreateIngressRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateIngressRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateIngressRuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIngressRuleRequest. */ + interface IGetIngressRuleRequest { + + /** GetIngressRuleRequest name */ + name?: (string|null); + } + + /** Represents a GetIngressRuleRequest. */ + class GetIngressRuleRequest implements IGetIngressRuleRequest { + + /** + * Constructs a new GetIngressRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IGetIngressRuleRequest); + + /** GetIngressRuleRequest name. */ + public name: string; + + /** + * Creates a new GetIngressRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIngressRuleRequest instance + */ + public static create(properties?: google.appengine.v1.IGetIngressRuleRequest): google.appengine.v1.GetIngressRuleRequest; + + /** + * Encodes the specified GetIngressRuleRequest message. Does not implicitly {@link google.appengine.v1.GetIngressRuleRequest.verify|verify} messages. + * @param message GetIngressRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IGetIngressRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIngressRuleRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetIngressRuleRequest.verify|verify} messages. + * @param message GetIngressRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IGetIngressRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIngressRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.GetIngressRuleRequest; + + /** + * Decodes a GetIngressRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.GetIngressRuleRequest; + + /** + * Verifies a GetIngressRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIngressRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIngressRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.GetIngressRuleRequest; + + /** + * Creates a plain object from a GetIngressRuleRequest message. Also converts values to other types if specified. + * @param message GetIngressRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.GetIngressRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIngressRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIngressRuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateIngressRuleRequest. */ + interface IUpdateIngressRuleRequest { + + /** UpdateIngressRuleRequest name */ + name?: (string|null); + + /** UpdateIngressRuleRequest rule */ + rule?: (google.appengine.v1.IFirewallRule|null); + + /** UpdateIngressRuleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateIngressRuleRequest. */ + class UpdateIngressRuleRequest implements IUpdateIngressRuleRequest { + + /** + * Constructs a new UpdateIngressRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IUpdateIngressRuleRequest); + + /** UpdateIngressRuleRequest name. */ + public name: string; + + /** UpdateIngressRuleRequest rule. */ + public rule?: (google.appengine.v1.IFirewallRule|null); + + /** UpdateIngressRuleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateIngressRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateIngressRuleRequest instance + */ + public static create(properties?: google.appengine.v1.IUpdateIngressRuleRequest): google.appengine.v1.UpdateIngressRuleRequest; + + /** + * Encodes the specified UpdateIngressRuleRequest message. Does not implicitly {@link google.appengine.v1.UpdateIngressRuleRequest.verify|verify} messages. + * @param message UpdateIngressRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IUpdateIngressRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateIngressRuleRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateIngressRuleRequest.verify|verify} messages. + * @param message UpdateIngressRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IUpdateIngressRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateIngressRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.UpdateIngressRuleRequest; + + /** + * Decodes an UpdateIngressRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.UpdateIngressRuleRequest; + + /** + * Verifies an UpdateIngressRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateIngressRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateIngressRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.UpdateIngressRuleRequest; + + /** + * Creates a plain object from an UpdateIngressRuleRequest message. Also converts values to other types if specified. + * @param message UpdateIngressRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.UpdateIngressRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateIngressRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateIngressRuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteIngressRuleRequest. */ + interface IDeleteIngressRuleRequest { + + /** DeleteIngressRuleRequest name */ + name?: (string|null); + } + + /** Represents a DeleteIngressRuleRequest. */ + class DeleteIngressRuleRequest implements IDeleteIngressRuleRequest { + + /** + * Constructs a new DeleteIngressRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IDeleteIngressRuleRequest); + + /** DeleteIngressRuleRequest name. */ + public name: string; + + /** + * Creates a new DeleteIngressRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteIngressRuleRequest instance + */ + public static create(properties?: google.appengine.v1.IDeleteIngressRuleRequest): google.appengine.v1.DeleteIngressRuleRequest; + + /** + * Encodes the specified DeleteIngressRuleRequest message. Does not implicitly {@link google.appengine.v1.DeleteIngressRuleRequest.verify|verify} messages. + * @param message DeleteIngressRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IDeleteIngressRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteIngressRuleRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteIngressRuleRequest.verify|verify} messages. + * @param message DeleteIngressRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IDeleteIngressRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteIngressRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.DeleteIngressRuleRequest; + + /** + * Decodes a DeleteIngressRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.DeleteIngressRuleRequest; + + /** + * Verifies a DeleteIngressRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteIngressRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteIngressRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.DeleteIngressRuleRequest; + + /** + * Creates a plain object from a DeleteIngressRuleRequest message. Also converts values to other types if specified. + * @param message DeleteIngressRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.DeleteIngressRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteIngressRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteIngressRuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AuthorizedDomains */ + class AuthorizedDomains extends $protobuf.rpc.Service { + + /** + * Constructs a new AuthorizedDomains 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 AuthorizedDomains 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): AuthorizedDomains; + + /** + * Calls ListAuthorizedDomains. + * @param request ListAuthorizedDomainsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAuthorizedDomainsResponse + */ + public listAuthorizedDomains(request: google.appengine.v1.IListAuthorizedDomainsRequest, callback: google.appengine.v1.AuthorizedDomains.ListAuthorizedDomainsCallback): void; + + /** + * Calls ListAuthorizedDomains. + * @param request ListAuthorizedDomainsRequest message or plain object + * @returns Promise + */ + public listAuthorizedDomains(request: google.appengine.v1.IListAuthorizedDomainsRequest): Promise; + } + + namespace AuthorizedDomains { + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedDomains|listAuthorizedDomains}. + * @param error Error, if any + * @param [response] ListAuthorizedDomainsResponse + */ + type ListAuthorizedDomainsCallback = (error: (Error|null), response?: google.appengine.v1.ListAuthorizedDomainsResponse) => void; + } + + /** Properties of a ListAuthorizedDomainsRequest. */ + interface IListAuthorizedDomainsRequest { + + /** ListAuthorizedDomainsRequest parent */ + parent?: (string|null); + + /** ListAuthorizedDomainsRequest pageSize */ + pageSize?: (number|null); + + /** ListAuthorizedDomainsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAuthorizedDomainsRequest. */ + class ListAuthorizedDomainsRequest implements IListAuthorizedDomainsRequest { + + /** + * Constructs a new ListAuthorizedDomainsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListAuthorizedDomainsRequest); + + /** ListAuthorizedDomainsRequest parent. */ + public parent: string; + + /** ListAuthorizedDomainsRequest pageSize. */ + public pageSize: number; + + /** ListAuthorizedDomainsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAuthorizedDomainsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAuthorizedDomainsRequest instance + */ + public static create(properties?: google.appengine.v1.IListAuthorizedDomainsRequest): google.appengine.v1.ListAuthorizedDomainsRequest; + + /** + * Encodes the specified ListAuthorizedDomainsRequest message. Does not implicitly {@link google.appengine.v1.ListAuthorizedDomainsRequest.verify|verify} messages. + * @param message ListAuthorizedDomainsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListAuthorizedDomainsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAuthorizedDomainsRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListAuthorizedDomainsRequest.verify|verify} messages. + * @param message ListAuthorizedDomainsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListAuthorizedDomainsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAuthorizedDomainsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAuthorizedDomainsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListAuthorizedDomainsRequest; + + /** + * Decodes a ListAuthorizedDomainsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAuthorizedDomainsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListAuthorizedDomainsRequest; + + /** + * Verifies a ListAuthorizedDomainsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAuthorizedDomainsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAuthorizedDomainsRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListAuthorizedDomainsRequest; + + /** + * Creates a plain object from a ListAuthorizedDomainsRequest message. Also converts values to other types if specified. + * @param message ListAuthorizedDomainsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListAuthorizedDomainsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAuthorizedDomainsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAuthorizedDomainsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAuthorizedDomainsResponse. */ + interface IListAuthorizedDomainsResponse { + + /** ListAuthorizedDomainsResponse domains */ + domains?: (google.appengine.v1.IAuthorizedDomain[]|null); + + /** ListAuthorizedDomainsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAuthorizedDomainsResponse. */ + class ListAuthorizedDomainsResponse implements IListAuthorizedDomainsResponse { + + /** + * Constructs a new ListAuthorizedDomainsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListAuthorizedDomainsResponse); + + /** ListAuthorizedDomainsResponse domains. */ + public domains: google.appengine.v1.IAuthorizedDomain[]; + + /** ListAuthorizedDomainsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAuthorizedDomainsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAuthorizedDomainsResponse instance + */ + public static create(properties?: google.appengine.v1.IListAuthorizedDomainsResponse): google.appengine.v1.ListAuthorizedDomainsResponse; + + /** + * Encodes the specified ListAuthorizedDomainsResponse message. Does not implicitly {@link google.appengine.v1.ListAuthorizedDomainsResponse.verify|verify} messages. + * @param message ListAuthorizedDomainsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListAuthorizedDomainsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAuthorizedDomainsResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListAuthorizedDomainsResponse.verify|verify} messages. + * @param message ListAuthorizedDomainsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListAuthorizedDomainsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAuthorizedDomainsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAuthorizedDomainsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListAuthorizedDomainsResponse; + + /** + * Decodes a ListAuthorizedDomainsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAuthorizedDomainsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListAuthorizedDomainsResponse; + + /** + * Verifies a ListAuthorizedDomainsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAuthorizedDomainsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAuthorizedDomainsResponse + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListAuthorizedDomainsResponse; + + /** + * Creates a plain object from a ListAuthorizedDomainsResponse message. Also converts values to other types if specified. + * @param message ListAuthorizedDomainsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListAuthorizedDomainsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAuthorizedDomainsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAuthorizedDomainsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AuthorizedCertificates */ + class AuthorizedCertificates extends $protobuf.rpc.Service { + + /** + * Constructs a new AuthorizedCertificates 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 AuthorizedCertificates 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): AuthorizedCertificates; + + /** + * Calls ListAuthorizedCertificates. + * @param request ListAuthorizedCertificatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAuthorizedCertificatesResponse + */ + public listAuthorizedCertificates(request: google.appengine.v1.IListAuthorizedCertificatesRequest, callback: google.appengine.v1.AuthorizedCertificates.ListAuthorizedCertificatesCallback): void; + + /** + * Calls ListAuthorizedCertificates. + * @param request ListAuthorizedCertificatesRequest message or plain object + * @returns Promise + */ + public listAuthorizedCertificates(request: google.appengine.v1.IListAuthorizedCertificatesRequest): Promise; + + /** + * Calls GetAuthorizedCertificate. + * @param request GetAuthorizedCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AuthorizedCertificate + */ + public getAuthorizedCertificate(request: google.appengine.v1.IGetAuthorizedCertificateRequest, callback: google.appengine.v1.AuthorizedCertificates.GetAuthorizedCertificateCallback): void; + + /** + * Calls GetAuthorizedCertificate. + * @param request GetAuthorizedCertificateRequest message or plain object + * @returns Promise + */ + public getAuthorizedCertificate(request: google.appengine.v1.IGetAuthorizedCertificateRequest): Promise; + + /** + * Calls CreateAuthorizedCertificate. + * @param request CreateAuthorizedCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AuthorizedCertificate + */ + public createAuthorizedCertificate(request: google.appengine.v1.ICreateAuthorizedCertificateRequest, callback: google.appengine.v1.AuthorizedCertificates.CreateAuthorizedCertificateCallback): void; + + /** + * Calls CreateAuthorizedCertificate. + * @param request CreateAuthorizedCertificateRequest message or plain object + * @returns Promise + */ + public createAuthorizedCertificate(request: google.appengine.v1.ICreateAuthorizedCertificateRequest): Promise; + + /** + * Calls UpdateAuthorizedCertificate. + * @param request UpdateAuthorizedCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AuthorizedCertificate + */ + public updateAuthorizedCertificate(request: google.appengine.v1.IUpdateAuthorizedCertificateRequest, callback: google.appengine.v1.AuthorizedCertificates.UpdateAuthorizedCertificateCallback): void; + + /** + * Calls UpdateAuthorizedCertificate. + * @param request UpdateAuthorizedCertificateRequest message or plain object + * @returns Promise + */ + public updateAuthorizedCertificate(request: google.appengine.v1.IUpdateAuthorizedCertificateRequest): Promise; + + /** + * Calls DeleteAuthorizedCertificate. + * @param request DeleteAuthorizedCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAuthorizedCertificate(request: google.appengine.v1.IDeleteAuthorizedCertificateRequest, callback: google.appengine.v1.AuthorizedCertificates.DeleteAuthorizedCertificateCallback): void; + + /** + * Calls DeleteAuthorizedCertificate. + * @param request DeleteAuthorizedCertificateRequest message or plain object + * @returns Promise + */ + public deleteAuthorizedCertificate(request: google.appengine.v1.IDeleteAuthorizedCertificateRequest): Promise; + } + + namespace AuthorizedCertificates { + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedCertificates|listAuthorizedCertificates}. + * @param error Error, if any + * @param [response] ListAuthorizedCertificatesResponse + */ + type ListAuthorizedCertificatesCallback = (error: (Error|null), response?: google.appengine.v1.ListAuthorizedCertificatesResponse) => void; + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedCertificates|getAuthorizedCertificate}. + * @param error Error, if any + * @param [response] AuthorizedCertificate + */ + type GetAuthorizedCertificateCallback = (error: (Error|null), response?: google.appengine.v1.AuthorizedCertificate) => void; + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedCertificates|createAuthorizedCertificate}. + * @param error Error, if any + * @param [response] AuthorizedCertificate + */ + type CreateAuthorizedCertificateCallback = (error: (Error|null), response?: google.appengine.v1.AuthorizedCertificate) => void; + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedCertificates|updateAuthorizedCertificate}. + * @param error Error, if any + * @param [response] AuthorizedCertificate + */ + type UpdateAuthorizedCertificateCallback = (error: (Error|null), response?: google.appengine.v1.AuthorizedCertificate) => void; + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedCertificates|deleteAuthorizedCertificate}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAuthorizedCertificateCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a ListAuthorizedCertificatesRequest. */ + interface IListAuthorizedCertificatesRequest { + + /** ListAuthorizedCertificatesRequest parent */ + parent?: (string|null); + + /** ListAuthorizedCertificatesRequest view */ + view?: (google.appengine.v1.AuthorizedCertificateView|keyof typeof google.appengine.v1.AuthorizedCertificateView|null); + + /** ListAuthorizedCertificatesRequest pageSize */ + pageSize?: (number|null); + + /** ListAuthorizedCertificatesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAuthorizedCertificatesRequest. */ + class ListAuthorizedCertificatesRequest implements IListAuthorizedCertificatesRequest { + + /** + * Constructs a new ListAuthorizedCertificatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListAuthorizedCertificatesRequest); + + /** ListAuthorizedCertificatesRequest parent. */ + public parent: string; + + /** ListAuthorizedCertificatesRequest view. */ + public view: (google.appengine.v1.AuthorizedCertificateView|keyof typeof google.appengine.v1.AuthorizedCertificateView); + + /** ListAuthorizedCertificatesRequest pageSize. */ + public pageSize: number; + + /** ListAuthorizedCertificatesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAuthorizedCertificatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAuthorizedCertificatesRequest instance + */ + public static create(properties?: google.appengine.v1.IListAuthorizedCertificatesRequest): google.appengine.v1.ListAuthorizedCertificatesRequest; + + /** + * Encodes the specified ListAuthorizedCertificatesRequest message. Does not implicitly {@link google.appengine.v1.ListAuthorizedCertificatesRequest.verify|verify} messages. + * @param message ListAuthorizedCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListAuthorizedCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAuthorizedCertificatesRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListAuthorizedCertificatesRequest.verify|verify} messages. + * @param message ListAuthorizedCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListAuthorizedCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAuthorizedCertificatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAuthorizedCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListAuthorizedCertificatesRequest; + + /** + * Decodes a ListAuthorizedCertificatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAuthorizedCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListAuthorizedCertificatesRequest; + + /** + * Verifies a ListAuthorizedCertificatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAuthorizedCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAuthorizedCertificatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListAuthorizedCertificatesRequest; + + /** + * Creates a plain object from a ListAuthorizedCertificatesRequest message. Also converts values to other types if specified. + * @param message ListAuthorizedCertificatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListAuthorizedCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAuthorizedCertificatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAuthorizedCertificatesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAuthorizedCertificatesResponse. */ + interface IListAuthorizedCertificatesResponse { + + /** ListAuthorizedCertificatesResponse certificates */ + certificates?: (google.appengine.v1.IAuthorizedCertificate[]|null); + + /** ListAuthorizedCertificatesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAuthorizedCertificatesResponse. */ + class ListAuthorizedCertificatesResponse implements IListAuthorizedCertificatesResponse { + + /** + * Constructs a new ListAuthorizedCertificatesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListAuthorizedCertificatesResponse); + + /** ListAuthorizedCertificatesResponse certificates. */ + public certificates: google.appengine.v1.IAuthorizedCertificate[]; + + /** ListAuthorizedCertificatesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAuthorizedCertificatesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAuthorizedCertificatesResponse instance + */ + public static create(properties?: google.appengine.v1.IListAuthorizedCertificatesResponse): google.appengine.v1.ListAuthorizedCertificatesResponse; + + /** + * Encodes the specified ListAuthorizedCertificatesResponse message. Does not implicitly {@link google.appengine.v1.ListAuthorizedCertificatesResponse.verify|verify} messages. + * @param message ListAuthorizedCertificatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListAuthorizedCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAuthorizedCertificatesResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListAuthorizedCertificatesResponse.verify|verify} messages. + * @param message ListAuthorizedCertificatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListAuthorizedCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAuthorizedCertificatesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAuthorizedCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListAuthorizedCertificatesResponse; + + /** + * Decodes a ListAuthorizedCertificatesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAuthorizedCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListAuthorizedCertificatesResponse; + + /** + * Verifies a ListAuthorizedCertificatesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAuthorizedCertificatesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAuthorizedCertificatesResponse + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListAuthorizedCertificatesResponse; + + /** + * Creates a plain object from a ListAuthorizedCertificatesResponse message. Also converts values to other types if specified. + * @param message ListAuthorizedCertificatesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListAuthorizedCertificatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAuthorizedCertificatesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAuthorizedCertificatesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAuthorizedCertificateRequest. */ + interface IGetAuthorizedCertificateRequest { + + /** GetAuthorizedCertificateRequest name */ + name?: (string|null); + + /** GetAuthorizedCertificateRequest view */ + view?: (google.appengine.v1.AuthorizedCertificateView|keyof typeof google.appengine.v1.AuthorizedCertificateView|null); + } + + /** Represents a GetAuthorizedCertificateRequest. */ + class GetAuthorizedCertificateRequest implements IGetAuthorizedCertificateRequest { + + /** + * Constructs a new GetAuthorizedCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IGetAuthorizedCertificateRequest); + + /** GetAuthorizedCertificateRequest name. */ + public name: string; + + /** GetAuthorizedCertificateRequest view. */ + public view: (google.appengine.v1.AuthorizedCertificateView|keyof typeof google.appengine.v1.AuthorizedCertificateView); + + /** + * Creates a new GetAuthorizedCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAuthorizedCertificateRequest instance + */ + public static create(properties?: google.appengine.v1.IGetAuthorizedCertificateRequest): google.appengine.v1.GetAuthorizedCertificateRequest; + + /** + * Encodes the specified GetAuthorizedCertificateRequest message. Does not implicitly {@link google.appengine.v1.GetAuthorizedCertificateRequest.verify|verify} messages. + * @param message GetAuthorizedCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IGetAuthorizedCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAuthorizedCertificateRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetAuthorizedCertificateRequest.verify|verify} messages. + * @param message GetAuthorizedCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IGetAuthorizedCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAuthorizedCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.GetAuthorizedCertificateRequest; + + /** + * Decodes a GetAuthorizedCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.GetAuthorizedCertificateRequest; + + /** + * Verifies a GetAuthorizedCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAuthorizedCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAuthorizedCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.GetAuthorizedCertificateRequest; + + /** + * Creates a plain object from a GetAuthorizedCertificateRequest message. Also converts values to other types if specified. + * @param message GetAuthorizedCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.GetAuthorizedCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAuthorizedCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAuthorizedCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** AuthorizedCertificateView enum. */ + enum AuthorizedCertificateView { + BASIC_CERTIFICATE = 0, + FULL_CERTIFICATE = 1 + } + + /** Properties of a CreateAuthorizedCertificateRequest. */ + interface ICreateAuthorizedCertificateRequest { + + /** CreateAuthorizedCertificateRequest parent */ + parent?: (string|null); + + /** CreateAuthorizedCertificateRequest certificate */ + certificate?: (google.appengine.v1.IAuthorizedCertificate|null); + } + + /** Represents a CreateAuthorizedCertificateRequest. */ + class CreateAuthorizedCertificateRequest implements ICreateAuthorizedCertificateRequest { + + /** + * Constructs a new CreateAuthorizedCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ICreateAuthorizedCertificateRequest); + + /** CreateAuthorizedCertificateRequest parent. */ + public parent: string; + + /** CreateAuthorizedCertificateRequest certificate. */ + public certificate?: (google.appengine.v1.IAuthorizedCertificate|null); + + /** + * Creates a new CreateAuthorizedCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAuthorizedCertificateRequest instance + */ + public static create(properties?: google.appengine.v1.ICreateAuthorizedCertificateRequest): google.appengine.v1.CreateAuthorizedCertificateRequest; + + /** + * Encodes the specified CreateAuthorizedCertificateRequest message. Does not implicitly {@link google.appengine.v1.CreateAuthorizedCertificateRequest.verify|verify} messages. + * @param message CreateAuthorizedCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ICreateAuthorizedCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAuthorizedCertificateRequest message, length delimited. Does not implicitly {@link google.appengine.v1.CreateAuthorizedCertificateRequest.verify|verify} messages. + * @param message CreateAuthorizedCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ICreateAuthorizedCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAuthorizedCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.CreateAuthorizedCertificateRequest; + + /** + * Decodes a CreateAuthorizedCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.CreateAuthorizedCertificateRequest; + + /** + * Verifies a CreateAuthorizedCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAuthorizedCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAuthorizedCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.CreateAuthorizedCertificateRequest; + + /** + * Creates a plain object from a CreateAuthorizedCertificateRequest message. Also converts values to other types if specified. + * @param message CreateAuthorizedCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.CreateAuthorizedCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAuthorizedCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAuthorizedCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAuthorizedCertificateRequest. */ + interface IUpdateAuthorizedCertificateRequest { + + /** UpdateAuthorizedCertificateRequest name */ + name?: (string|null); + + /** UpdateAuthorizedCertificateRequest certificate */ + certificate?: (google.appengine.v1.IAuthorizedCertificate|null); + + /** UpdateAuthorizedCertificateRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAuthorizedCertificateRequest. */ + class UpdateAuthorizedCertificateRequest implements IUpdateAuthorizedCertificateRequest { + + /** + * Constructs a new UpdateAuthorizedCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IUpdateAuthorizedCertificateRequest); + + /** UpdateAuthorizedCertificateRequest name. */ + public name: string; + + /** UpdateAuthorizedCertificateRequest certificate. */ + public certificate?: (google.appengine.v1.IAuthorizedCertificate|null); + + /** UpdateAuthorizedCertificateRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAuthorizedCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAuthorizedCertificateRequest instance + */ + public static create(properties?: google.appengine.v1.IUpdateAuthorizedCertificateRequest): google.appengine.v1.UpdateAuthorizedCertificateRequest; + + /** + * Encodes the specified UpdateAuthorizedCertificateRequest message. Does not implicitly {@link google.appengine.v1.UpdateAuthorizedCertificateRequest.verify|verify} messages. + * @param message UpdateAuthorizedCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IUpdateAuthorizedCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAuthorizedCertificateRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateAuthorizedCertificateRequest.verify|verify} messages. + * @param message UpdateAuthorizedCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IUpdateAuthorizedCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAuthorizedCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.UpdateAuthorizedCertificateRequest; + + /** + * Decodes an UpdateAuthorizedCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.UpdateAuthorizedCertificateRequest; + + /** + * Verifies an UpdateAuthorizedCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAuthorizedCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAuthorizedCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.UpdateAuthorizedCertificateRequest; + + /** + * Creates a plain object from an UpdateAuthorizedCertificateRequest message. Also converts values to other types if specified. + * @param message UpdateAuthorizedCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.UpdateAuthorizedCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAuthorizedCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAuthorizedCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAuthorizedCertificateRequest. */ + interface IDeleteAuthorizedCertificateRequest { + + /** DeleteAuthorizedCertificateRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAuthorizedCertificateRequest. */ + class DeleteAuthorizedCertificateRequest implements IDeleteAuthorizedCertificateRequest { + + /** + * Constructs a new DeleteAuthorizedCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IDeleteAuthorizedCertificateRequest); + + /** DeleteAuthorizedCertificateRequest name. */ + public name: string; + + /** + * Creates a new DeleteAuthorizedCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAuthorizedCertificateRequest instance + */ + public static create(properties?: google.appengine.v1.IDeleteAuthorizedCertificateRequest): google.appengine.v1.DeleteAuthorizedCertificateRequest; + + /** + * Encodes the specified DeleteAuthorizedCertificateRequest message. Does not implicitly {@link google.appengine.v1.DeleteAuthorizedCertificateRequest.verify|verify} messages. + * @param message DeleteAuthorizedCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IDeleteAuthorizedCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAuthorizedCertificateRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteAuthorizedCertificateRequest.verify|verify} messages. + * @param message DeleteAuthorizedCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IDeleteAuthorizedCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAuthorizedCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.DeleteAuthorizedCertificateRequest; + + /** + * Decodes a DeleteAuthorizedCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.DeleteAuthorizedCertificateRequest; + + /** + * Verifies a DeleteAuthorizedCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAuthorizedCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAuthorizedCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.DeleteAuthorizedCertificateRequest; + + /** + * Creates a plain object from a DeleteAuthorizedCertificateRequest message. Also converts values to other types if specified. + * @param message DeleteAuthorizedCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.DeleteAuthorizedCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAuthorizedCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAuthorizedCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a DomainMappings */ + class DomainMappings extends $protobuf.rpc.Service { + + /** + * Constructs a new DomainMappings 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 DomainMappings 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): DomainMappings; + + /** + * Calls ListDomainMappings. + * @param request ListDomainMappingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDomainMappingsResponse + */ + public listDomainMappings(request: google.appengine.v1.IListDomainMappingsRequest, callback: google.appengine.v1.DomainMappings.ListDomainMappingsCallback): void; + + /** + * Calls ListDomainMappings. + * @param request ListDomainMappingsRequest message or plain object + * @returns Promise + */ + public listDomainMappings(request: google.appengine.v1.IListDomainMappingsRequest): Promise; + + /** + * Calls GetDomainMapping. + * @param request GetDomainMappingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DomainMapping + */ + public getDomainMapping(request: google.appengine.v1.IGetDomainMappingRequest, callback: google.appengine.v1.DomainMappings.GetDomainMappingCallback): void; + + /** + * Calls GetDomainMapping. + * @param request GetDomainMappingRequest message or plain object + * @returns Promise + */ + public getDomainMapping(request: google.appengine.v1.IGetDomainMappingRequest): Promise; + + /** + * Calls CreateDomainMapping. + * @param request CreateDomainMappingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDomainMapping(request: google.appengine.v1.ICreateDomainMappingRequest, callback: google.appengine.v1.DomainMappings.CreateDomainMappingCallback): void; + + /** + * Calls CreateDomainMapping. + * @param request CreateDomainMappingRequest message or plain object + * @returns Promise + */ + public createDomainMapping(request: google.appengine.v1.ICreateDomainMappingRequest): Promise; + + /** + * Calls UpdateDomainMapping. + * @param request UpdateDomainMappingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDomainMapping(request: google.appengine.v1.IUpdateDomainMappingRequest, callback: google.appengine.v1.DomainMappings.UpdateDomainMappingCallback): void; + + /** + * Calls UpdateDomainMapping. + * @param request UpdateDomainMappingRequest message or plain object + * @returns Promise + */ + public updateDomainMapping(request: google.appengine.v1.IUpdateDomainMappingRequest): Promise; + + /** + * Calls DeleteDomainMapping. + * @param request DeleteDomainMappingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDomainMapping(request: google.appengine.v1.IDeleteDomainMappingRequest, callback: google.appengine.v1.DomainMappings.DeleteDomainMappingCallback): void; + + /** + * Calls DeleteDomainMapping. + * @param request DeleteDomainMappingRequest message or plain object + * @returns Promise + */ + public deleteDomainMapping(request: google.appengine.v1.IDeleteDomainMappingRequest): Promise; + } + + namespace DomainMappings { + + /** + * Callback as used by {@link google.appengine.v1.DomainMappings|listDomainMappings}. + * @param error Error, if any + * @param [response] ListDomainMappingsResponse + */ + type ListDomainMappingsCallback = (error: (Error|null), response?: google.appengine.v1.ListDomainMappingsResponse) => void; + + /** + * Callback as used by {@link google.appengine.v1.DomainMappings|getDomainMapping}. + * @param error Error, if any + * @param [response] DomainMapping + */ + type GetDomainMappingCallback = (error: (Error|null), response?: google.appengine.v1.DomainMapping) => void; + + /** + * Callback as used by {@link google.appengine.v1.DomainMappings|createDomainMapping}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDomainMappingCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.appengine.v1.DomainMappings|updateDomainMapping}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDomainMappingCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.appengine.v1.DomainMappings|deleteDomainMapping}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDomainMappingCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ListDomainMappingsRequest. */ + interface IListDomainMappingsRequest { + + /** ListDomainMappingsRequest parent */ + parent?: (string|null); + + /** ListDomainMappingsRequest pageSize */ + pageSize?: (number|null); + + /** ListDomainMappingsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDomainMappingsRequest. */ + class ListDomainMappingsRequest implements IListDomainMappingsRequest { + + /** + * Constructs a new ListDomainMappingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListDomainMappingsRequest); + + /** ListDomainMappingsRequest parent. */ + public parent: string; + + /** ListDomainMappingsRequest pageSize. */ + public pageSize: number; + + /** ListDomainMappingsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDomainMappingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDomainMappingsRequest instance + */ + public static create(properties?: google.appengine.v1.IListDomainMappingsRequest): google.appengine.v1.ListDomainMappingsRequest; + + /** + * Encodes the specified ListDomainMappingsRequest message. Does not implicitly {@link google.appengine.v1.ListDomainMappingsRequest.verify|verify} messages. + * @param message ListDomainMappingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListDomainMappingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDomainMappingsRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListDomainMappingsRequest.verify|verify} messages. + * @param message ListDomainMappingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListDomainMappingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDomainMappingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDomainMappingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListDomainMappingsRequest; + + /** + * Decodes a ListDomainMappingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDomainMappingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListDomainMappingsRequest; + + /** + * Verifies a ListDomainMappingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDomainMappingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDomainMappingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListDomainMappingsRequest; + + /** + * Creates a plain object from a ListDomainMappingsRequest message. Also converts values to other types if specified. + * @param message ListDomainMappingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListDomainMappingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDomainMappingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDomainMappingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDomainMappingsResponse. */ + interface IListDomainMappingsResponse { + + /** ListDomainMappingsResponse domainMappings */ + domainMappings?: (google.appengine.v1.IDomainMapping[]|null); + + /** ListDomainMappingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDomainMappingsResponse. */ + class ListDomainMappingsResponse implements IListDomainMappingsResponse { + + /** + * Constructs a new ListDomainMappingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IListDomainMappingsResponse); + + /** ListDomainMappingsResponse domainMappings. */ + public domainMappings: google.appengine.v1.IDomainMapping[]; + + /** ListDomainMappingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDomainMappingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDomainMappingsResponse instance + */ + public static create(properties?: google.appengine.v1.IListDomainMappingsResponse): google.appengine.v1.ListDomainMappingsResponse; + + /** + * Encodes the specified ListDomainMappingsResponse message. Does not implicitly {@link google.appengine.v1.ListDomainMappingsResponse.verify|verify} messages. + * @param message ListDomainMappingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IListDomainMappingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDomainMappingsResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListDomainMappingsResponse.verify|verify} messages. + * @param message ListDomainMappingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IListDomainMappingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDomainMappingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDomainMappingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ListDomainMappingsResponse; + + /** + * Decodes a ListDomainMappingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDomainMappingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ListDomainMappingsResponse; + + /** + * Verifies a ListDomainMappingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDomainMappingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDomainMappingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ListDomainMappingsResponse; + + /** + * Creates a plain object from a ListDomainMappingsResponse message. Also converts values to other types if specified. + * @param message ListDomainMappingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ListDomainMappingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDomainMappingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDomainMappingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDomainMappingRequest. */ + interface IGetDomainMappingRequest { + + /** GetDomainMappingRequest name */ + name?: (string|null); + } + + /** Represents a GetDomainMappingRequest. */ + class GetDomainMappingRequest implements IGetDomainMappingRequest { + + /** + * Constructs a new GetDomainMappingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IGetDomainMappingRequest); + + /** GetDomainMappingRequest name. */ + public name: string; + + /** + * Creates a new GetDomainMappingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDomainMappingRequest instance + */ + public static create(properties?: google.appengine.v1.IGetDomainMappingRequest): google.appengine.v1.GetDomainMappingRequest; + + /** + * Encodes the specified GetDomainMappingRequest message. Does not implicitly {@link google.appengine.v1.GetDomainMappingRequest.verify|verify} messages. + * @param message GetDomainMappingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IGetDomainMappingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDomainMappingRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetDomainMappingRequest.verify|verify} messages. + * @param message GetDomainMappingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IGetDomainMappingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDomainMappingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.GetDomainMappingRequest; + + /** + * Decodes a GetDomainMappingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.GetDomainMappingRequest; + + /** + * Verifies a GetDomainMappingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDomainMappingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDomainMappingRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.GetDomainMappingRequest; + + /** + * Creates a plain object from a GetDomainMappingRequest message. Also converts values to other types if specified. + * @param message GetDomainMappingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.GetDomainMappingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDomainMappingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDomainMappingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DomainOverrideStrategy enum. */ + enum DomainOverrideStrategy { + UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY = 0, + STRICT = 1, + OVERRIDE = 2 + } + + /** Properties of a CreateDomainMappingRequest. */ + interface ICreateDomainMappingRequest { + + /** CreateDomainMappingRequest parent */ + parent?: (string|null); + + /** CreateDomainMappingRequest domainMapping */ + domainMapping?: (google.appengine.v1.IDomainMapping|null); + + /** CreateDomainMappingRequest overrideStrategy */ + overrideStrategy?: (google.appengine.v1.DomainOverrideStrategy|keyof typeof google.appengine.v1.DomainOverrideStrategy|null); + } + + /** Represents a CreateDomainMappingRequest. */ + class CreateDomainMappingRequest implements ICreateDomainMappingRequest { + + /** + * Constructs a new CreateDomainMappingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ICreateDomainMappingRequest); + + /** CreateDomainMappingRequest parent. */ + public parent: string; + + /** CreateDomainMappingRequest domainMapping. */ + public domainMapping?: (google.appengine.v1.IDomainMapping|null); + + /** CreateDomainMappingRequest overrideStrategy. */ + public overrideStrategy: (google.appengine.v1.DomainOverrideStrategy|keyof typeof google.appengine.v1.DomainOverrideStrategy); + + /** + * Creates a new CreateDomainMappingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDomainMappingRequest instance + */ + public static create(properties?: google.appengine.v1.ICreateDomainMappingRequest): google.appengine.v1.CreateDomainMappingRequest; + + /** + * Encodes the specified CreateDomainMappingRequest message. Does not implicitly {@link google.appengine.v1.CreateDomainMappingRequest.verify|verify} messages. + * @param message CreateDomainMappingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ICreateDomainMappingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDomainMappingRequest message, length delimited. Does not implicitly {@link google.appengine.v1.CreateDomainMappingRequest.verify|verify} messages. + * @param message CreateDomainMappingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ICreateDomainMappingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDomainMappingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.CreateDomainMappingRequest; + + /** + * Decodes a CreateDomainMappingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.CreateDomainMappingRequest; + + /** + * Verifies a CreateDomainMappingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDomainMappingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDomainMappingRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.CreateDomainMappingRequest; + + /** + * Creates a plain object from a CreateDomainMappingRequest message. Also converts values to other types if specified. + * @param message CreateDomainMappingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.CreateDomainMappingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDomainMappingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDomainMappingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDomainMappingRequest. */ + interface IUpdateDomainMappingRequest { + + /** UpdateDomainMappingRequest name */ + name?: (string|null); + + /** UpdateDomainMappingRequest domainMapping */ + domainMapping?: (google.appengine.v1.IDomainMapping|null); + + /** UpdateDomainMappingRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDomainMappingRequest. */ + class UpdateDomainMappingRequest implements IUpdateDomainMappingRequest { + + /** + * Constructs a new UpdateDomainMappingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IUpdateDomainMappingRequest); + + /** UpdateDomainMappingRequest name. */ + public name: string; + + /** UpdateDomainMappingRequest domainMapping. */ + public domainMapping?: (google.appengine.v1.IDomainMapping|null); + + /** UpdateDomainMappingRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDomainMappingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDomainMappingRequest instance + */ + public static create(properties?: google.appengine.v1.IUpdateDomainMappingRequest): google.appengine.v1.UpdateDomainMappingRequest; + + /** + * Encodes the specified UpdateDomainMappingRequest message. Does not implicitly {@link google.appengine.v1.UpdateDomainMappingRequest.verify|verify} messages. + * @param message UpdateDomainMappingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IUpdateDomainMappingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDomainMappingRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateDomainMappingRequest.verify|verify} messages. + * @param message UpdateDomainMappingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IUpdateDomainMappingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDomainMappingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.UpdateDomainMappingRequest; + + /** + * Decodes an UpdateDomainMappingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.UpdateDomainMappingRequest; + + /** + * Verifies an UpdateDomainMappingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDomainMappingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDomainMappingRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.UpdateDomainMappingRequest; + + /** + * Creates a plain object from an UpdateDomainMappingRequest message. Also converts values to other types if specified. + * @param message UpdateDomainMappingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.UpdateDomainMappingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDomainMappingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDomainMappingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDomainMappingRequest. */ + interface IDeleteDomainMappingRequest { + + /** DeleteDomainMappingRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDomainMappingRequest. */ + class DeleteDomainMappingRequest implements IDeleteDomainMappingRequest { + + /** + * Constructs a new DeleteDomainMappingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IDeleteDomainMappingRequest); + + /** DeleteDomainMappingRequest name. */ + public name: string; + + /** + * Creates a new DeleteDomainMappingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDomainMappingRequest instance + */ + public static create(properties?: google.appengine.v1.IDeleteDomainMappingRequest): google.appengine.v1.DeleteDomainMappingRequest; + + /** + * Encodes the specified DeleteDomainMappingRequest message. Does not implicitly {@link google.appengine.v1.DeleteDomainMappingRequest.verify|verify} messages. + * @param message DeleteDomainMappingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IDeleteDomainMappingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDomainMappingRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteDomainMappingRequest.verify|verify} messages. + * @param message DeleteDomainMappingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IDeleteDomainMappingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDomainMappingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.DeleteDomainMappingRequest; + + /** + * Decodes a DeleteDomainMappingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.DeleteDomainMappingRequest; + + /** + * Verifies a DeleteDomainMappingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDomainMappingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDomainMappingRequest + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.DeleteDomainMappingRequest; + + /** + * Creates a plain object from a DeleteDomainMappingRequest message. Also converts values to other types if specified. + * @param message DeleteDomainMappingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.DeleteDomainMappingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDomainMappingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDomainMappingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Application. */ + interface IApplication { + + /** Application name */ + name?: (string|null); + + /** Application id */ + id?: (string|null); + + /** Application dispatchRules */ + dispatchRules?: (google.appengine.v1.IUrlDispatchRule[]|null); + + /** Application authDomain */ + authDomain?: (string|null); + + /** Application locationId */ + locationId?: (string|null); + + /** Application codeBucket */ + codeBucket?: (string|null); + + /** Application defaultCookieExpiration */ + defaultCookieExpiration?: (google.protobuf.IDuration|null); + + /** Application servingStatus */ + servingStatus?: (google.appengine.v1.Application.ServingStatus|keyof typeof google.appengine.v1.Application.ServingStatus|null); + + /** Application defaultHostname */ + defaultHostname?: (string|null); + + /** Application defaultBucket */ + defaultBucket?: (string|null); + + /** Application serviceAccount */ + serviceAccount?: (string|null); + + /** Application iap */ + iap?: (google.appengine.v1.Application.IIdentityAwareProxy|null); + + /** Application gcrDomain */ + gcrDomain?: (string|null); + + /** Application databaseType */ + databaseType?: (google.appengine.v1.Application.DatabaseType|keyof typeof google.appengine.v1.Application.DatabaseType|null); + + /** Application featureSettings */ + featureSettings?: (google.appengine.v1.Application.IFeatureSettings|null); + } + + /** Represents an Application. */ + class Application implements IApplication { + + /** + * Constructs a new Application. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IApplication); + + /** Application name. */ + public name: string; + + /** Application id. */ + public id: string; + + /** Application dispatchRules. */ + public dispatchRules: google.appengine.v1.IUrlDispatchRule[]; + + /** Application authDomain. */ + public authDomain: string; + + /** Application locationId. */ + public locationId: string; + + /** Application codeBucket. */ + public codeBucket: string; + + /** Application defaultCookieExpiration. */ + public defaultCookieExpiration?: (google.protobuf.IDuration|null); + + /** Application servingStatus. */ + public servingStatus: (google.appengine.v1.Application.ServingStatus|keyof typeof google.appengine.v1.Application.ServingStatus); + + /** Application defaultHostname. */ + public defaultHostname: string; + + /** Application defaultBucket. */ + public defaultBucket: string; + + /** Application serviceAccount. */ + public serviceAccount: string; + + /** Application iap. */ + public iap?: (google.appengine.v1.Application.IIdentityAwareProxy|null); + + /** Application gcrDomain. */ + public gcrDomain: string; + + /** Application databaseType. */ + public databaseType: (google.appengine.v1.Application.DatabaseType|keyof typeof google.appengine.v1.Application.DatabaseType); + + /** Application featureSettings. */ + public featureSettings?: (google.appengine.v1.Application.IFeatureSettings|null); + + /** + * Creates a new Application instance using the specified properties. + * @param [properties] Properties to set + * @returns Application instance + */ + public static create(properties?: google.appengine.v1.IApplication): google.appengine.v1.Application; + + /** + * Encodes the specified Application message. Does not implicitly {@link google.appengine.v1.Application.verify|verify} messages. + * @param message Application message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Application message, length delimited. Does not implicitly {@link google.appengine.v1.Application.verify|verify} messages. + * @param message Application message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Application message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Application; + + /** + * Decodes an Application message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Application; + + /** + * Verifies an Application message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Application message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Application + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Application; + + /** + * Creates a plain object from an Application message. Also converts values to other types if specified. + * @param message Application + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Application, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Application to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Application + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Application { + + /** ServingStatus enum. */ + enum ServingStatus { + UNSPECIFIED = 0, + SERVING = 1, + USER_DISABLED = 2, + SYSTEM_DISABLED = 3 + } + + /** Properties of an IdentityAwareProxy. */ + interface IIdentityAwareProxy { + + /** IdentityAwareProxy enabled */ + enabled?: (boolean|null); + + /** IdentityAwareProxy oauth2ClientId */ + oauth2ClientId?: (string|null); + + /** IdentityAwareProxy oauth2ClientSecret */ + oauth2ClientSecret?: (string|null); + + /** IdentityAwareProxy oauth2ClientSecretSha256 */ + oauth2ClientSecretSha256?: (string|null); + } + + /** Represents an IdentityAwareProxy. */ + class IdentityAwareProxy implements IIdentityAwareProxy { + + /** + * Constructs a new IdentityAwareProxy. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.Application.IIdentityAwareProxy); + + /** IdentityAwareProxy enabled. */ + public enabled: boolean; + + /** IdentityAwareProxy oauth2ClientId. */ + public oauth2ClientId: string; + + /** IdentityAwareProxy oauth2ClientSecret. */ + public oauth2ClientSecret: string; + + /** IdentityAwareProxy oauth2ClientSecretSha256. */ + public oauth2ClientSecretSha256: string; + + /** + * Creates a new IdentityAwareProxy instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentityAwareProxy instance + */ + public static create(properties?: google.appengine.v1.Application.IIdentityAwareProxy): google.appengine.v1.Application.IdentityAwareProxy; + + /** + * Encodes the specified IdentityAwareProxy message. Does not implicitly {@link google.appengine.v1.Application.IdentityAwareProxy.verify|verify} messages. + * @param message IdentityAwareProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.Application.IIdentityAwareProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentityAwareProxy message, length delimited. Does not implicitly {@link google.appengine.v1.Application.IdentityAwareProxy.verify|verify} messages. + * @param message IdentityAwareProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.Application.IIdentityAwareProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentityAwareProxy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentityAwareProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Application.IdentityAwareProxy; + + /** + * Decodes an IdentityAwareProxy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentityAwareProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Application.IdentityAwareProxy; + + /** + * Verifies an IdentityAwareProxy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IdentityAwareProxy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentityAwareProxy + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Application.IdentityAwareProxy; + + /** + * Creates a plain object from an IdentityAwareProxy message. Also converts values to other types if specified. + * @param message IdentityAwareProxy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Application.IdentityAwareProxy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentityAwareProxy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentityAwareProxy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DatabaseType enum. */ + enum DatabaseType { + DATABASE_TYPE_UNSPECIFIED = 0, + CLOUD_DATASTORE = 1, + CLOUD_FIRESTORE = 2, + CLOUD_DATASTORE_COMPATIBILITY = 3 + } + + /** Properties of a FeatureSettings. */ + interface IFeatureSettings { + + /** FeatureSettings splitHealthChecks */ + splitHealthChecks?: (boolean|null); + + /** FeatureSettings useContainerOptimizedOs */ + useContainerOptimizedOs?: (boolean|null); + } + + /** Represents a FeatureSettings. */ + class FeatureSettings implements IFeatureSettings { + + /** + * Constructs a new FeatureSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.Application.IFeatureSettings); + + /** FeatureSettings splitHealthChecks. */ + public splitHealthChecks: boolean; + + /** FeatureSettings useContainerOptimizedOs. */ + public useContainerOptimizedOs: boolean; + + /** + * Creates a new FeatureSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSettings instance + */ + public static create(properties?: google.appengine.v1.Application.IFeatureSettings): google.appengine.v1.Application.FeatureSettings; + + /** + * Encodes the specified FeatureSettings message. Does not implicitly {@link google.appengine.v1.Application.FeatureSettings.verify|verify} messages. + * @param message FeatureSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.Application.IFeatureSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSettings message, length delimited. Does not implicitly {@link google.appengine.v1.Application.FeatureSettings.verify|verify} messages. + * @param message FeatureSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.Application.IFeatureSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Application.FeatureSettings; + + /** + * Decodes a FeatureSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Application.FeatureSettings; + + /** + * Verifies a FeatureSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSettings + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Application.FeatureSettings; + + /** + * Creates a plain object from a FeatureSettings message. Also converts values to other types if specified. + * @param message FeatureSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Application.FeatureSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an UrlDispatchRule. */ + interface IUrlDispatchRule { + + /** UrlDispatchRule domain */ + domain?: (string|null); + + /** UrlDispatchRule path */ + path?: (string|null); + + /** UrlDispatchRule service */ + service?: (string|null); + } + + /** Represents an UrlDispatchRule. */ + class UrlDispatchRule implements IUrlDispatchRule { + + /** + * Constructs a new UrlDispatchRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IUrlDispatchRule); + + /** UrlDispatchRule domain. */ + public domain: string; + + /** UrlDispatchRule path. */ + public path: string; + + /** UrlDispatchRule service. */ + public service: string; + + /** + * Creates a new UrlDispatchRule instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlDispatchRule instance + */ + public static create(properties?: google.appengine.v1.IUrlDispatchRule): google.appengine.v1.UrlDispatchRule; + + /** + * Encodes the specified UrlDispatchRule message. Does not implicitly {@link google.appengine.v1.UrlDispatchRule.verify|verify} messages. + * @param message UrlDispatchRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IUrlDispatchRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlDispatchRule message, length delimited. Does not implicitly {@link google.appengine.v1.UrlDispatchRule.verify|verify} messages. + * @param message UrlDispatchRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IUrlDispatchRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlDispatchRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlDispatchRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.UrlDispatchRule; + + /** + * Decodes an UrlDispatchRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlDispatchRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.UrlDispatchRule; + + /** + * Verifies an UrlDispatchRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlDispatchRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlDispatchRule + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.UrlDispatchRule; + + /** + * Creates a plain object from an UrlDispatchRule message. Also converts values to other types if specified. + * @param message UrlDispatchRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.UrlDispatchRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlDispatchRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UrlDispatchRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuthorizedCertificate. */ + interface IAuthorizedCertificate { + + /** AuthorizedCertificate name */ + name?: (string|null); + + /** AuthorizedCertificate id */ + id?: (string|null); + + /** AuthorizedCertificate displayName */ + displayName?: (string|null); + + /** AuthorizedCertificate domainNames */ + domainNames?: (string[]|null); + + /** AuthorizedCertificate expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** AuthorizedCertificate certificateRawData */ + certificateRawData?: (google.appengine.v1.ICertificateRawData|null); + + /** AuthorizedCertificate managedCertificate */ + managedCertificate?: (google.appengine.v1.IManagedCertificate|null); + + /** AuthorizedCertificate visibleDomainMappings */ + visibleDomainMappings?: (string[]|null); + + /** AuthorizedCertificate domainMappingsCount */ + domainMappingsCount?: (number|null); + } + + /** Represents an AuthorizedCertificate. */ + class AuthorizedCertificate implements IAuthorizedCertificate { + + /** + * Constructs a new AuthorizedCertificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IAuthorizedCertificate); + + /** AuthorizedCertificate name. */ + public name: string; + + /** AuthorizedCertificate id. */ + public id: string; + + /** AuthorizedCertificate displayName. */ + public displayName: string; + + /** AuthorizedCertificate domainNames. */ + public domainNames: string[]; + + /** AuthorizedCertificate expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** AuthorizedCertificate certificateRawData. */ + public certificateRawData?: (google.appengine.v1.ICertificateRawData|null); + + /** AuthorizedCertificate managedCertificate. */ + public managedCertificate?: (google.appengine.v1.IManagedCertificate|null); + + /** AuthorizedCertificate visibleDomainMappings. */ + public visibleDomainMappings: string[]; + + /** AuthorizedCertificate domainMappingsCount. */ + public domainMappingsCount: number; + + /** + * Creates a new AuthorizedCertificate instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizedCertificate instance + */ + public static create(properties?: google.appengine.v1.IAuthorizedCertificate): google.appengine.v1.AuthorizedCertificate; + + /** + * Encodes the specified AuthorizedCertificate message. Does not implicitly {@link google.appengine.v1.AuthorizedCertificate.verify|verify} messages. + * @param message AuthorizedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IAuthorizedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizedCertificate message, length delimited. Does not implicitly {@link google.appengine.v1.AuthorizedCertificate.verify|verify} messages. + * @param message AuthorizedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IAuthorizedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizedCertificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.AuthorizedCertificate; + + /** + * Decodes an AuthorizedCertificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.AuthorizedCertificate; + + /** + * Verifies an AuthorizedCertificate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuthorizedCertificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizedCertificate + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.AuthorizedCertificate; + + /** + * Creates a plain object from an AuthorizedCertificate message. Also converts values to other types if specified. + * @param message AuthorizedCertificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.AuthorizedCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizedCertificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizedCertificate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CertificateRawData. */ + interface ICertificateRawData { + + /** CertificateRawData publicCertificate */ + publicCertificate?: (string|null); + + /** CertificateRawData privateKey */ + privateKey?: (string|null); + } + + /** Represents a CertificateRawData. */ + class CertificateRawData implements ICertificateRawData { + + /** + * Constructs a new CertificateRawData. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ICertificateRawData); + + /** CertificateRawData publicCertificate. */ + public publicCertificate: string; + + /** CertificateRawData privateKey. */ + public privateKey: string; + + /** + * Creates a new CertificateRawData instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateRawData instance + */ + public static create(properties?: google.appengine.v1.ICertificateRawData): google.appengine.v1.CertificateRawData; + + /** + * Encodes the specified CertificateRawData message. Does not implicitly {@link google.appengine.v1.CertificateRawData.verify|verify} messages. + * @param message CertificateRawData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ICertificateRawData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateRawData message, length delimited. Does not implicitly {@link google.appengine.v1.CertificateRawData.verify|verify} messages. + * @param message CertificateRawData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ICertificateRawData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateRawData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateRawData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.CertificateRawData; + + /** + * Decodes a CertificateRawData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateRawData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.CertificateRawData; + + /** + * Verifies a CertificateRawData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CertificateRawData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateRawData + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.CertificateRawData; + + /** + * Creates a plain object from a CertificateRawData message. Also converts values to other types if specified. + * @param message CertificateRawData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.CertificateRawData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateRawData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateRawData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ManagementStatus enum. */ + enum ManagementStatus { + MANAGEMENT_STATUS_UNSPECIFIED = 0, + OK = 1, + PENDING = 2, + FAILED_RETRYING_NOT_VISIBLE = 4, + FAILED_PERMANENT = 6, + FAILED_RETRYING_CAA_FORBIDDEN = 7, + FAILED_RETRYING_CAA_CHECKING = 8 + } + + /** Properties of a ManagedCertificate. */ + interface IManagedCertificate { + + /** ManagedCertificate lastRenewalTime */ + lastRenewalTime?: (google.protobuf.ITimestamp|null); + + /** ManagedCertificate status */ + status?: (google.appengine.v1.ManagementStatus|keyof typeof google.appengine.v1.ManagementStatus|null); + } + + /** Represents a ManagedCertificate. */ + class ManagedCertificate implements IManagedCertificate { + + /** + * Constructs a new ManagedCertificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IManagedCertificate); + + /** ManagedCertificate lastRenewalTime. */ + public lastRenewalTime?: (google.protobuf.ITimestamp|null); + + /** ManagedCertificate status. */ + public status: (google.appengine.v1.ManagementStatus|keyof typeof google.appengine.v1.ManagementStatus); + + /** + * Creates a new ManagedCertificate instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagedCertificate instance + */ + public static create(properties?: google.appengine.v1.IManagedCertificate): google.appengine.v1.ManagedCertificate; + + /** + * Encodes the specified ManagedCertificate message. Does not implicitly {@link google.appengine.v1.ManagedCertificate.verify|verify} messages. + * @param message ManagedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IManagedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagedCertificate message, length delimited. Does not implicitly {@link google.appengine.v1.ManagedCertificate.verify|verify} messages. + * @param message ManagedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IManagedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagedCertificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ManagedCertificate; + + /** + * Decodes a ManagedCertificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ManagedCertificate; + + /** + * Verifies a ManagedCertificate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagedCertificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagedCertificate + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ManagedCertificate; + + /** + * Creates a plain object from a ManagedCertificate message. Also converts values to other types if specified. + * @param message ManagedCertificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ManagedCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagedCertificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagedCertificate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuthorizedDomain. */ + interface IAuthorizedDomain { + + /** AuthorizedDomain name */ + name?: (string|null); + + /** AuthorizedDomain id */ + id?: (string|null); + } + + /** Represents an AuthorizedDomain. */ + class AuthorizedDomain implements IAuthorizedDomain { + + /** + * Constructs a new AuthorizedDomain. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IAuthorizedDomain); + + /** AuthorizedDomain name. */ + public name: string; + + /** AuthorizedDomain id. */ + public id: string; + + /** + * Creates a new AuthorizedDomain instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizedDomain instance + */ + public static create(properties?: google.appengine.v1.IAuthorizedDomain): google.appengine.v1.AuthorizedDomain; + + /** + * Encodes the specified AuthorizedDomain message. Does not implicitly {@link google.appengine.v1.AuthorizedDomain.verify|verify} messages. + * @param message AuthorizedDomain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IAuthorizedDomain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizedDomain message, length delimited. Does not implicitly {@link google.appengine.v1.AuthorizedDomain.verify|verify} messages. + * @param message AuthorizedDomain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IAuthorizedDomain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizedDomain message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizedDomain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.AuthorizedDomain; + + /** + * Decodes an AuthorizedDomain message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizedDomain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.AuthorizedDomain; + + /** + * Verifies an AuthorizedDomain message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuthorizedDomain message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizedDomain + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.AuthorizedDomain; + + /** + * Creates a plain object from an AuthorizedDomain message. Also converts values to other types if specified. + * @param message AuthorizedDomain + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.AuthorizedDomain, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizedDomain to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizedDomain + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DomainMapping. */ + interface IDomainMapping { + + /** DomainMapping name */ + name?: (string|null); + + /** DomainMapping id */ + id?: (string|null); + + /** DomainMapping sslSettings */ + sslSettings?: (google.appengine.v1.ISslSettings|null); + + /** DomainMapping resourceRecords */ + resourceRecords?: (google.appengine.v1.IResourceRecord[]|null); + } + + /** Represents a DomainMapping. */ + class DomainMapping implements IDomainMapping { + + /** + * Constructs a new DomainMapping. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IDomainMapping); + + /** DomainMapping name. */ + public name: string; + + /** DomainMapping id. */ + public id: string; + + /** DomainMapping sslSettings. */ + public sslSettings?: (google.appengine.v1.ISslSettings|null); + + /** DomainMapping resourceRecords. */ + public resourceRecords: google.appengine.v1.IResourceRecord[]; + + /** + * Creates a new DomainMapping instance using the specified properties. + * @param [properties] Properties to set + * @returns DomainMapping instance + */ + public static create(properties?: google.appengine.v1.IDomainMapping): google.appengine.v1.DomainMapping; + + /** + * Encodes the specified DomainMapping message. Does not implicitly {@link google.appengine.v1.DomainMapping.verify|verify} messages. + * @param message DomainMapping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IDomainMapping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DomainMapping message, length delimited. Does not implicitly {@link google.appengine.v1.DomainMapping.verify|verify} messages. + * @param message DomainMapping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IDomainMapping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DomainMapping message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DomainMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.DomainMapping; + + /** + * Decodes a DomainMapping message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DomainMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.DomainMapping; + + /** + * Verifies a DomainMapping message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DomainMapping message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DomainMapping + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.DomainMapping; + + /** + * Creates a plain object from a DomainMapping message. Also converts values to other types if specified. + * @param message DomainMapping + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.DomainMapping, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DomainMapping to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DomainMapping + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SslSettings. */ + interface ISslSettings { + + /** SslSettings certificateId */ + certificateId?: (string|null); + + /** SslSettings sslManagementType */ + sslManagementType?: (google.appengine.v1.SslSettings.SslManagementType|keyof typeof google.appengine.v1.SslSettings.SslManagementType|null); + + /** SslSettings pendingManagedCertificateId */ + pendingManagedCertificateId?: (string|null); + } + + /** Represents a SslSettings. */ + class SslSettings implements ISslSettings { + + /** + * Constructs a new SslSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ISslSettings); + + /** SslSettings certificateId. */ + public certificateId: string; + + /** SslSettings sslManagementType. */ + public sslManagementType: (google.appengine.v1.SslSettings.SslManagementType|keyof typeof google.appengine.v1.SslSettings.SslManagementType); + + /** SslSettings pendingManagedCertificateId. */ + public pendingManagedCertificateId: string; + + /** + * Creates a new SslSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SslSettings instance + */ + public static create(properties?: google.appengine.v1.ISslSettings): google.appengine.v1.SslSettings; + + /** + * Encodes the specified SslSettings message. Does not implicitly {@link google.appengine.v1.SslSettings.verify|verify} messages. + * @param message SslSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ISslSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslSettings message, length delimited. Does not implicitly {@link google.appengine.v1.SslSettings.verify|verify} messages. + * @param message SslSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ISslSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.SslSettings; + + /** + * Decodes a SslSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.SslSettings; + + /** + * Verifies a SslSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslSettings + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.SslSettings; + + /** + * Creates a plain object from a SslSettings message. Also converts values to other types if specified. + * @param message SslSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.SslSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SslSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SslSettings { + + /** SslManagementType enum. */ + enum SslManagementType { + SSL_MANAGEMENT_TYPE_UNSPECIFIED = 0, + AUTOMATIC = 1, + MANUAL = 2 + } + } + + /** Properties of a ResourceRecord. */ + interface IResourceRecord { + + /** ResourceRecord name */ + name?: (string|null); + + /** ResourceRecord rrdata */ + rrdata?: (string|null); + + /** ResourceRecord type */ + type?: (google.appengine.v1.ResourceRecord.RecordType|keyof typeof google.appengine.v1.ResourceRecord.RecordType|null); + } + + /** Represents a ResourceRecord. */ + class ResourceRecord implements IResourceRecord { + + /** + * Constructs a new ResourceRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IResourceRecord); + + /** ResourceRecord name. */ + public name: string; + + /** ResourceRecord rrdata. */ + public rrdata: string; + + /** ResourceRecord type. */ + public type: (google.appengine.v1.ResourceRecord.RecordType|keyof typeof google.appengine.v1.ResourceRecord.RecordType); + + /** + * Creates a new ResourceRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceRecord instance + */ + public static create(properties?: google.appengine.v1.IResourceRecord): google.appengine.v1.ResourceRecord; + + /** + * Encodes the specified ResourceRecord message. Does not implicitly {@link google.appengine.v1.ResourceRecord.verify|verify} messages. + * @param message ResourceRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IResourceRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceRecord message, length delimited. Does not implicitly {@link google.appengine.v1.ResourceRecord.verify|verify} messages. + * @param message ResourceRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IResourceRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ResourceRecord; + + /** + * Decodes a ResourceRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ResourceRecord; + + /** + * Verifies a ResourceRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceRecord + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ResourceRecord; + + /** + * Creates a plain object from a ResourceRecord message. Also converts values to other types if specified. + * @param message ResourceRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ResourceRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceRecord { + + /** RecordType enum. */ + enum RecordType { + RECORD_TYPE_UNSPECIFIED = 0, + A = 1, + AAAA = 2, + CNAME = 3 + } + } + + /** Properties of a FirewallRule. */ + interface IFirewallRule { + + /** FirewallRule priority */ + priority?: (number|null); + + /** FirewallRule action */ + action?: (google.appengine.v1.FirewallRule.Action|keyof typeof google.appengine.v1.FirewallRule.Action|null); + + /** FirewallRule sourceRange */ + sourceRange?: (string|null); + + /** FirewallRule description */ + description?: (string|null); + } + + /** Represents a FirewallRule. */ + class FirewallRule implements IFirewallRule { + + /** + * Constructs a new FirewallRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IFirewallRule); + + /** FirewallRule priority. */ + public priority: number; + + /** FirewallRule action. */ + public action: (google.appengine.v1.FirewallRule.Action|keyof typeof google.appengine.v1.FirewallRule.Action); + + /** FirewallRule sourceRange. */ + public sourceRange: string; + + /** FirewallRule description. */ + public description: string; + + /** + * Creates a new FirewallRule instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallRule instance + */ + public static create(properties?: google.appengine.v1.IFirewallRule): google.appengine.v1.FirewallRule; + + /** + * Encodes the specified FirewallRule message. Does not implicitly {@link google.appengine.v1.FirewallRule.verify|verify} messages. + * @param message FirewallRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IFirewallRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallRule message, length delimited. Does not implicitly {@link google.appengine.v1.FirewallRule.verify|verify} messages. + * @param message FirewallRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IFirewallRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.FirewallRule; + + /** + * Decodes a FirewallRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.FirewallRule; + + /** + * Verifies a FirewallRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallRule + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.FirewallRule; + + /** + * Creates a plain object from a FirewallRule message. Also converts values to other types if specified. + * @param message FirewallRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.FirewallRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FirewallRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FirewallRule { + + /** Action enum. */ + enum Action { + UNSPECIFIED_ACTION = 0, + ALLOW = 1, + DENY = 2 + } + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance id */ + id?: (string|null); + + /** Instance appEngineRelease */ + appEngineRelease?: (string|null); + + /** Instance availability */ + availability?: (google.appengine.v1.Instance.Availability|keyof typeof google.appengine.v1.Instance.Availability|null); + + /** Instance vmName */ + vmName?: (string|null); + + /** Instance vmZoneName */ + vmZoneName?: (string|null); + + /** Instance vmId */ + vmId?: (string|null); + + /** Instance startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Instance requests */ + requests?: (number|null); + + /** Instance errors */ + errors?: (number|null); + + /** Instance qps */ + qps?: (number|null); + + /** Instance averageLatency */ + averageLatency?: (number|null); + + /** Instance memoryUsage */ + memoryUsage?: (number|Long|string|null); + + /** Instance vmStatus */ + vmStatus?: (string|null); + + /** Instance vmDebugEnabled */ + vmDebugEnabled?: (boolean|null); + + /** Instance vmIp */ + vmIp?: (string|null); + + /** Instance vmLiveness */ + vmLiveness?: (google.appengine.v1.Instance.Liveness.LivenessState|keyof typeof google.appengine.v1.Instance.Liveness.LivenessState|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance id. */ + public id: string; + + /** Instance appEngineRelease. */ + public appEngineRelease: string; + + /** Instance availability. */ + public availability: (google.appengine.v1.Instance.Availability|keyof typeof google.appengine.v1.Instance.Availability); + + /** Instance vmName. */ + public vmName: string; + + /** Instance vmZoneName. */ + public vmZoneName: string; + + /** Instance vmId. */ + public vmId: string; + + /** Instance startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Instance requests. */ + public requests: number; + + /** Instance errors. */ + public errors: number; + + /** Instance qps. */ + public qps: number; + + /** Instance averageLatency. */ + public averageLatency: number; + + /** Instance memoryUsage. */ + public memoryUsage: (number|Long|string); + + /** Instance vmStatus. */ + public vmStatus: string; + + /** Instance vmDebugEnabled. */ + public vmDebugEnabled: boolean; + + /** Instance vmIp. */ + public vmIp: string; + + /** Instance vmLiveness. */ + public vmLiveness: (google.appengine.v1.Instance.Liveness.LivenessState|keyof typeof google.appengine.v1.Instance.Liveness.LivenessState); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.appengine.v1.IInstance): google.appengine.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.appengine.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.appengine.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** Availability enum. */ + enum Availability { + UNSPECIFIED = 0, + RESIDENT = 1, + DYNAMIC = 2 + } + + /** Properties of a Liveness. */ + interface ILiveness { + } + + /** Represents a Liveness. */ + class Liveness implements ILiveness { + + /** + * Constructs a new Liveness. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.Instance.ILiveness); + + /** + * Creates a new Liveness instance using the specified properties. + * @param [properties] Properties to set + * @returns Liveness instance + */ + public static create(properties?: google.appengine.v1.Instance.ILiveness): google.appengine.v1.Instance.Liveness; + + /** + * Encodes the specified Liveness message. Does not implicitly {@link google.appengine.v1.Instance.Liveness.verify|verify} messages. + * @param message Liveness message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.Instance.ILiveness, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Liveness message, length delimited. Does not implicitly {@link google.appengine.v1.Instance.Liveness.verify|verify} messages. + * @param message Liveness message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.Instance.ILiveness, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Liveness message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Liveness + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Instance.Liveness; + + /** + * Decodes a Liveness message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Liveness + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Instance.Liveness; + + /** + * Verifies a Liveness message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Liveness message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Liveness + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Instance.Liveness; + + /** + * Creates a plain object from a Liveness message. Also converts values to other types if specified. + * @param message Liveness + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Instance.Liveness, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Liveness to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Liveness + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Liveness { + + /** LivenessState enum. */ + enum LivenessState { + LIVENESS_STATE_UNSPECIFIED = 0, + UNKNOWN = 1, + HEALTHY = 2, + UNHEALTHY = 3, + DRAINING = 4, + TIMEOUT = 5 + } + } + } + + /** Properties of a Service. */ + interface IService { + + /** Service name */ + name?: (string|null); + + /** Service id */ + id?: (string|null); + + /** Service split */ + split?: (google.appengine.v1.ITrafficSplit|null); + + /** Service labels */ + labels?: ({ [k: string]: string }|null); + + /** Service networkSettings */ + networkSettings?: (google.appengine.v1.INetworkSettings|null); + } + + /** Represents a Service. */ + class Service implements IService { + + /** + * Constructs a new Service. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IService); + + /** Service name. */ + public name: string; + + /** Service id. */ + public id: string; + + /** Service split. */ + public split?: (google.appengine.v1.ITrafficSplit|null); + + /** Service labels. */ + public labels: { [k: string]: string }; + + /** Service networkSettings. */ + public networkSettings?: (google.appengine.v1.INetworkSettings|null); + + /** + * Creates a new Service instance using the specified properties. + * @param [properties] Properties to set + * @returns Service instance + */ + public static create(properties?: google.appengine.v1.IService): google.appengine.v1.Service; + + /** + * Encodes the specified Service message. Does not implicitly {@link google.appengine.v1.Service.verify|verify} messages. + * @param message Service message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.appengine.v1.Service.verify|verify} messages. + * @param message Service message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Service message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Service; + + /** + * Decodes a Service message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Service; + + /** + * Verifies a Service message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Service message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Service + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Service; + + /** + * Creates a plain object from a Service message. Also converts values to other types if specified. + * @param message Service + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Service, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Service to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Service + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrafficSplit. */ + interface ITrafficSplit { + + /** TrafficSplit shardBy */ + shardBy?: (google.appengine.v1.TrafficSplit.ShardBy|keyof typeof google.appengine.v1.TrafficSplit.ShardBy|null); + + /** TrafficSplit allocations */ + allocations?: ({ [k: string]: number }|null); + } + + /** Represents a TrafficSplit. */ + class TrafficSplit implements ITrafficSplit { + + /** + * Constructs a new TrafficSplit. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ITrafficSplit); + + /** TrafficSplit shardBy. */ + public shardBy: (google.appengine.v1.TrafficSplit.ShardBy|keyof typeof google.appengine.v1.TrafficSplit.ShardBy); + + /** TrafficSplit allocations. */ + public allocations: { [k: string]: number }; + + /** + * Creates a new TrafficSplit instance using the specified properties. + * @param [properties] Properties to set + * @returns TrafficSplit instance + */ + public static create(properties?: google.appengine.v1.ITrafficSplit): google.appengine.v1.TrafficSplit; + + /** + * Encodes the specified TrafficSplit message. Does not implicitly {@link google.appengine.v1.TrafficSplit.verify|verify} messages. + * @param message TrafficSplit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ITrafficSplit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrafficSplit message, length delimited. Does not implicitly {@link google.appengine.v1.TrafficSplit.verify|verify} messages. + * @param message TrafficSplit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ITrafficSplit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrafficSplit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrafficSplit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.TrafficSplit; + + /** + * Decodes a TrafficSplit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrafficSplit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.TrafficSplit; + + /** + * Verifies a TrafficSplit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrafficSplit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrafficSplit + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.TrafficSplit; + + /** + * Creates a plain object from a TrafficSplit message. Also converts values to other types if specified. + * @param message TrafficSplit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.TrafficSplit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrafficSplit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrafficSplit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TrafficSplit { + + /** ShardBy enum. */ + enum ShardBy { + UNSPECIFIED = 0, + COOKIE = 1, + IP = 2, + RANDOM = 3 + } + } + + /** Properties of a NetworkSettings. */ + interface INetworkSettings { + + /** NetworkSettings ingressTrafficAllowed */ + ingressTrafficAllowed?: (google.appengine.v1.NetworkSettings.IngressTrafficAllowed|keyof typeof google.appengine.v1.NetworkSettings.IngressTrafficAllowed|null); + } + + /** Represents a NetworkSettings. */ + class NetworkSettings implements INetworkSettings { + + /** + * Constructs a new NetworkSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.INetworkSettings); + + /** NetworkSettings ingressTrafficAllowed. */ + public ingressTrafficAllowed: (google.appengine.v1.NetworkSettings.IngressTrafficAllowed|keyof typeof google.appengine.v1.NetworkSettings.IngressTrafficAllowed); + + /** + * Creates a new NetworkSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkSettings instance + */ + public static create(properties?: google.appengine.v1.INetworkSettings): google.appengine.v1.NetworkSettings; + + /** + * Encodes the specified NetworkSettings message. Does not implicitly {@link google.appengine.v1.NetworkSettings.verify|verify} messages. + * @param message NetworkSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.INetworkSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkSettings message, length delimited. Does not implicitly {@link google.appengine.v1.NetworkSettings.verify|verify} messages. + * @param message NetworkSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.INetworkSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.NetworkSettings; + + /** + * Decodes a NetworkSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.NetworkSettings; + + /** + * Verifies a NetworkSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkSettings + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.NetworkSettings; + + /** + * Creates a plain object from a NetworkSettings message. Also converts values to other types if specified. + * @param message NetworkSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.NetworkSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NetworkSettings { + + /** IngressTrafficAllowed enum. */ + enum IngressTrafficAllowed { + INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED = 0, + INGRESS_TRAFFIC_ALLOWED_ALL = 1, + INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY = 2, + INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB = 3 + } + } + + /** Properties of a Version. */ + interface IVersion { + + /** Version name */ + name?: (string|null); + + /** Version id */ + id?: (string|null); + + /** Version automaticScaling */ + automaticScaling?: (google.appengine.v1.IAutomaticScaling|null); + + /** Version basicScaling */ + basicScaling?: (google.appengine.v1.IBasicScaling|null); + + /** Version manualScaling */ + manualScaling?: (google.appengine.v1.IManualScaling|null); + + /** Version inboundServices */ + inboundServices?: (google.appengine.v1.InboundServiceType[]|null); + + /** Version instanceClass */ + instanceClass?: (string|null); + + /** Version network */ + network?: (google.appengine.v1.INetwork|null); + + /** Version zones */ + zones?: (string[]|null); + + /** Version resources */ + resources?: (google.appengine.v1.IResources|null); + + /** Version runtime */ + runtime?: (string|null); + + /** Version runtimeChannel */ + runtimeChannel?: (string|null); + + /** Version threadsafe */ + threadsafe?: (boolean|null); + + /** Version vm */ + vm?: (boolean|null); + + /** Version appEngineApis */ + appEngineApis?: (boolean|null); + + /** Version betaSettings */ + betaSettings?: ({ [k: string]: string }|null); + + /** Version env */ + env?: (string|null); + + /** Version servingStatus */ + servingStatus?: (google.appengine.v1.ServingStatus|keyof typeof google.appengine.v1.ServingStatus|null); + + /** Version createdBy */ + createdBy?: (string|null); + + /** Version createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Version diskUsageBytes */ + diskUsageBytes?: (number|Long|string|null); + + /** Version runtimeApiVersion */ + runtimeApiVersion?: (string|null); + + /** Version runtimeMainExecutablePath */ + runtimeMainExecutablePath?: (string|null); + + /** Version serviceAccount */ + serviceAccount?: (string|null); + + /** Version handlers */ + handlers?: (google.appengine.v1.IUrlMap[]|null); + + /** Version errorHandlers */ + errorHandlers?: (google.appengine.v1.IErrorHandler[]|null); + + /** Version libraries */ + libraries?: (google.appengine.v1.ILibrary[]|null); + + /** Version apiConfig */ + apiConfig?: (google.appengine.v1.IApiConfigHandler|null); + + /** Version envVariables */ + envVariables?: ({ [k: string]: string }|null); + + /** Version buildEnvVariables */ + buildEnvVariables?: ({ [k: string]: string }|null); + + /** Version defaultExpiration */ + defaultExpiration?: (google.protobuf.IDuration|null); + + /** Version healthCheck */ + healthCheck?: (google.appengine.v1.IHealthCheck|null); + + /** Version readinessCheck */ + readinessCheck?: (google.appengine.v1.IReadinessCheck|null); + + /** Version livenessCheck */ + livenessCheck?: (google.appengine.v1.ILivenessCheck|null); + + /** Version nobuildFilesRegex */ + nobuildFilesRegex?: (string|null); + + /** Version deployment */ + deployment?: (google.appengine.v1.IDeployment|null); + + /** Version versionUrl */ + versionUrl?: (string|null); + + /** Version endpointsApiService */ + endpointsApiService?: (google.appengine.v1.IEndpointsApiService|null); + + /** Version entrypoint */ + entrypoint?: (google.appengine.v1.IEntrypoint|null); + + /** Version vpcAccessConnector */ + vpcAccessConnector?: (google.appengine.v1.IVpcAccessConnector|null); + } + + /** Represents a Version. */ + class Version implements IVersion { + + /** + * Constructs a new Version. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IVersion); + + /** Version name. */ + public name: string; + + /** Version id. */ + public id: string; + + /** Version automaticScaling. */ + public automaticScaling?: (google.appengine.v1.IAutomaticScaling|null); + + /** Version basicScaling. */ + public basicScaling?: (google.appengine.v1.IBasicScaling|null); + + /** Version manualScaling. */ + public manualScaling?: (google.appengine.v1.IManualScaling|null); + + /** Version inboundServices. */ + public inboundServices: google.appengine.v1.InboundServiceType[]; + + /** Version instanceClass. */ + public instanceClass: string; + + /** Version network. */ + public network?: (google.appengine.v1.INetwork|null); + + /** Version zones. */ + public zones: string[]; + + /** Version resources. */ + public resources?: (google.appengine.v1.IResources|null); + + /** Version runtime. */ + public runtime: string; + + /** Version runtimeChannel. */ + public runtimeChannel: string; + + /** Version threadsafe. */ + public threadsafe: boolean; + + /** Version vm. */ + public vm: boolean; + + /** Version appEngineApis. */ + public appEngineApis: boolean; + + /** Version betaSettings. */ + public betaSettings: { [k: string]: string }; + + /** Version env. */ + public env: string; + + /** Version servingStatus. */ + public servingStatus: (google.appengine.v1.ServingStatus|keyof typeof google.appengine.v1.ServingStatus); + + /** Version createdBy. */ + public createdBy: string; + + /** Version createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Version diskUsageBytes. */ + public diskUsageBytes: (number|Long|string); + + /** Version runtimeApiVersion. */ + public runtimeApiVersion: string; + + /** Version runtimeMainExecutablePath. */ + public runtimeMainExecutablePath: string; + + /** Version serviceAccount. */ + public serviceAccount: string; + + /** Version handlers. */ + public handlers: google.appengine.v1.IUrlMap[]; + + /** Version errorHandlers. */ + public errorHandlers: google.appengine.v1.IErrorHandler[]; + + /** Version libraries. */ + public libraries: google.appengine.v1.ILibrary[]; + + /** Version apiConfig. */ + public apiConfig?: (google.appengine.v1.IApiConfigHandler|null); + + /** Version envVariables. */ + public envVariables: { [k: string]: string }; + + /** Version buildEnvVariables. */ + public buildEnvVariables: { [k: string]: string }; + + /** Version defaultExpiration. */ + public defaultExpiration?: (google.protobuf.IDuration|null); + + /** Version healthCheck. */ + public healthCheck?: (google.appengine.v1.IHealthCheck|null); + + /** Version readinessCheck. */ + public readinessCheck?: (google.appengine.v1.IReadinessCheck|null); + + /** Version livenessCheck. */ + public livenessCheck?: (google.appengine.v1.ILivenessCheck|null); + + /** Version nobuildFilesRegex. */ + public nobuildFilesRegex: string; + + /** Version deployment. */ + public deployment?: (google.appengine.v1.IDeployment|null); + + /** Version versionUrl. */ + public versionUrl: string; + + /** Version endpointsApiService. */ + public endpointsApiService?: (google.appengine.v1.IEndpointsApiService|null); + + /** Version entrypoint. */ + public entrypoint?: (google.appengine.v1.IEntrypoint|null); + + /** Version vpcAccessConnector. */ + public vpcAccessConnector?: (google.appengine.v1.IVpcAccessConnector|null); + + /** Version scaling. */ + public scaling?: ("automaticScaling"|"basicScaling"|"manualScaling"); + + /** + * Creates a new Version instance using the specified properties. + * @param [properties] Properties to set + * @returns Version instance + */ + public static create(properties?: google.appengine.v1.IVersion): google.appengine.v1.Version; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.appengine.v1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.appengine.v1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Version message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Version; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Version; + + /** + * Verifies a Version message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Version + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Version; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @param message Version + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Version, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Version to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Version + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndpointsApiService. */ + interface IEndpointsApiService { + + /** EndpointsApiService name */ + name?: (string|null); + + /** EndpointsApiService configId */ + configId?: (string|null); + + /** EndpointsApiService rolloutStrategy */ + rolloutStrategy?: (google.appengine.v1.EndpointsApiService.RolloutStrategy|keyof typeof google.appengine.v1.EndpointsApiService.RolloutStrategy|null); + + /** EndpointsApiService disableTraceSampling */ + disableTraceSampling?: (boolean|null); + } + + /** Represents an EndpointsApiService. */ + class EndpointsApiService implements IEndpointsApiService { + + /** + * Constructs a new EndpointsApiService. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IEndpointsApiService); + + /** EndpointsApiService name. */ + public name: string; + + /** EndpointsApiService configId. */ + public configId: string; + + /** EndpointsApiService rolloutStrategy. */ + public rolloutStrategy: (google.appengine.v1.EndpointsApiService.RolloutStrategy|keyof typeof google.appengine.v1.EndpointsApiService.RolloutStrategy); + + /** EndpointsApiService disableTraceSampling. */ + public disableTraceSampling: boolean; + + /** + * Creates a new EndpointsApiService instance using the specified properties. + * @param [properties] Properties to set + * @returns EndpointsApiService instance + */ + public static create(properties?: google.appengine.v1.IEndpointsApiService): google.appengine.v1.EndpointsApiService; + + /** + * Encodes the specified EndpointsApiService message. Does not implicitly {@link google.appengine.v1.EndpointsApiService.verify|verify} messages. + * @param message EndpointsApiService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IEndpointsApiService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndpointsApiService message, length delimited. Does not implicitly {@link google.appengine.v1.EndpointsApiService.verify|verify} messages. + * @param message EndpointsApiService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IEndpointsApiService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndpointsApiService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndpointsApiService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.EndpointsApiService; + + /** + * Decodes an EndpointsApiService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndpointsApiService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.EndpointsApiService; + + /** + * Verifies an EndpointsApiService message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndpointsApiService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndpointsApiService + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.EndpointsApiService; + + /** + * Creates a plain object from an EndpointsApiService message. Also converts values to other types if specified. + * @param message EndpointsApiService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.EndpointsApiService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndpointsApiService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndpointsApiService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EndpointsApiService { + + /** RolloutStrategy enum. */ + enum RolloutStrategy { + UNSPECIFIED_ROLLOUT_STRATEGY = 0, + FIXED = 1, + MANAGED = 2 + } + } + + /** Properties of an AutomaticScaling. */ + interface IAutomaticScaling { + + /** AutomaticScaling coolDownPeriod */ + coolDownPeriod?: (google.protobuf.IDuration|null); + + /** AutomaticScaling cpuUtilization */ + cpuUtilization?: (google.appengine.v1.ICpuUtilization|null); + + /** AutomaticScaling maxConcurrentRequests */ + maxConcurrentRequests?: (number|null); + + /** AutomaticScaling maxIdleInstances */ + maxIdleInstances?: (number|null); + + /** AutomaticScaling maxTotalInstances */ + maxTotalInstances?: (number|null); + + /** AutomaticScaling maxPendingLatency */ + maxPendingLatency?: (google.protobuf.IDuration|null); + + /** AutomaticScaling minIdleInstances */ + minIdleInstances?: (number|null); + + /** AutomaticScaling minTotalInstances */ + minTotalInstances?: (number|null); + + /** AutomaticScaling minPendingLatency */ + minPendingLatency?: (google.protobuf.IDuration|null); + + /** AutomaticScaling requestUtilization */ + requestUtilization?: (google.appengine.v1.IRequestUtilization|null); + + /** AutomaticScaling diskUtilization */ + diskUtilization?: (google.appengine.v1.IDiskUtilization|null); + + /** AutomaticScaling networkUtilization */ + networkUtilization?: (google.appengine.v1.INetworkUtilization|null); + + /** AutomaticScaling standardSchedulerSettings */ + standardSchedulerSettings?: (google.appengine.v1.IStandardSchedulerSettings|null); + } + + /** Represents an AutomaticScaling. */ + class AutomaticScaling implements IAutomaticScaling { + + /** + * Constructs a new AutomaticScaling. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IAutomaticScaling); + + /** AutomaticScaling coolDownPeriod. */ + public coolDownPeriod?: (google.protobuf.IDuration|null); + + /** AutomaticScaling cpuUtilization. */ + public cpuUtilization?: (google.appengine.v1.ICpuUtilization|null); + + /** AutomaticScaling maxConcurrentRequests. */ + public maxConcurrentRequests: number; + + /** AutomaticScaling maxIdleInstances. */ + public maxIdleInstances: number; + + /** AutomaticScaling maxTotalInstances. */ + public maxTotalInstances: number; + + /** AutomaticScaling maxPendingLatency. */ + public maxPendingLatency?: (google.protobuf.IDuration|null); + + /** AutomaticScaling minIdleInstances. */ + public minIdleInstances: number; + + /** AutomaticScaling minTotalInstances. */ + public minTotalInstances: number; + + /** AutomaticScaling minPendingLatency. */ + public minPendingLatency?: (google.protobuf.IDuration|null); + + /** AutomaticScaling requestUtilization. */ + public requestUtilization?: (google.appengine.v1.IRequestUtilization|null); + + /** AutomaticScaling diskUtilization. */ + public diskUtilization?: (google.appengine.v1.IDiskUtilization|null); + + /** AutomaticScaling networkUtilization. */ + public networkUtilization?: (google.appengine.v1.INetworkUtilization|null); + + /** AutomaticScaling standardSchedulerSettings. */ + public standardSchedulerSettings?: (google.appengine.v1.IStandardSchedulerSettings|null); + + /** + * Creates a new AutomaticScaling instance using the specified properties. + * @param [properties] Properties to set + * @returns AutomaticScaling instance + */ + public static create(properties?: google.appengine.v1.IAutomaticScaling): google.appengine.v1.AutomaticScaling; + + /** + * Encodes the specified AutomaticScaling message. Does not implicitly {@link google.appengine.v1.AutomaticScaling.verify|verify} messages. + * @param message AutomaticScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IAutomaticScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutomaticScaling message, length delimited. Does not implicitly {@link google.appengine.v1.AutomaticScaling.verify|verify} messages. + * @param message AutomaticScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IAutomaticScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutomaticScaling message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutomaticScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.AutomaticScaling; + + /** + * Decodes an AutomaticScaling message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutomaticScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.AutomaticScaling; + + /** + * Verifies an AutomaticScaling message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutomaticScaling message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutomaticScaling + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.AutomaticScaling; + + /** + * Creates a plain object from an AutomaticScaling message. Also converts values to other types if specified. + * @param message AutomaticScaling + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.AutomaticScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutomaticScaling to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutomaticScaling + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BasicScaling. */ + interface IBasicScaling { + + /** BasicScaling idleTimeout */ + idleTimeout?: (google.protobuf.IDuration|null); + + /** BasicScaling maxInstances */ + maxInstances?: (number|null); + } + + /** Represents a BasicScaling. */ + class BasicScaling implements IBasicScaling { + + /** + * Constructs a new BasicScaling. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IBasicScaling); + + /** BasicScaling idleTimeout. */ + public idleTimeout?: (google.protobuf.IDuration|null); + + /** BasicScaling maxInstances. */ + public maxInstances: number; + + /** + * Creates a new BasicScaling instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicScaling instance + */ + public static create(properties?: google.appengine.v1.IBasicScaling): google.appengine.v1.BasicScaling; + + /** + * Encodes the specified BasicScaling message. Does not implicitly {@link google.appengine.v1.BasicScaling.verify|verify} messages. + * @param message BasicScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IBasicScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BasicScaling message, length delimited. Does not implicitly {@link google.appengine.v1.BasicScaling.verify|verify} messages. + * @param message BasicScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IBasicScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BasicScaling message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.BasicScaling; + + /** + * Decodes a BasicScaling message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.BasicScaling; + + /** + * Verifies a BasicScaling message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BasicScaling message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicScaling + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.BasicScaling; + + /** + * Creates a plain object from a BasicScaling message. Also converts values to other types if specified. + * @param message BasicScaling + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.BasicScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BasicScaling to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BasicScaling + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ManualScaling. */ + interface IManualScaling { + + /** ManualScaling instances */ + instances?: (number|null); + } + + /** Represents a ManualScaling. */ + class ManualScaling implements IManualScaling { + + /** + * Constructs a new ManualScaling. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IManualScaling); + + /** ManualScaling instances. */ + public instances: number; + + /** + * Creates a new ManualScaling instance using the specified properties. + * @param [properties] Properties to set + * @returns ManualScaling instance + */ + public static create(properties?: google.appengine.v1.IManualScaling): google.appengine.v1.ManualScaling; + + /** + * Encodes the specified ManualScaling message. Does not implicitly {@link google.appengine.v1.ManualScaling.verify|verify} messages. + * @param message ManualScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IManualScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManualScaling message, length delimited. Does not implicitly {@link google.appengine.v1.ManualScaling.verify|verify} messages. + * @param message ManualScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IManualScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManualScaling message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManualScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ManualScaling; + + /** + * Decodes a ManualScaling message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManualScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ManualScaling; + + /** + * Verifies a ManualScaling message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManualScaling message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManualScaling + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ManualScaling; + + /** + * Creates a plain object from a ManualScaling message. Also converts values to other types if specified. + * @param message ManualScaling + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ManualScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManualScaling to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManualScaling + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CpuUtilization. */ + interface ICpuUtilization { + + /** CpuUtilization aggregationWindowLength */ + aggregationWindowLength?: (google.protobuf.IDuration|null); + + /** CpuUtilization targetUtilization */ + targetUtilization?: (number|null); + } + + /** Represents a CpuUtilization. */ + class CpuUtilization implements ICpuUtilization { + + /** + * Constructs a new CpuUtilization. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ICpuUtilization); + + /** CpuUtilization aggregationWindowLength. */ + public aggregationWindowLength?: (google.protobuf.IDuration|null); + + /** CpuUtilization targetUtilization. */ + public targetUtilization: number; + + /** + * Creates a new CpuUtilization instance using the specified properties. + * @param [properties] Properties to set + * @returns CpuUtilization instance + */ + public static create(properties?: google.appengine.v1.ICpuUtilization): google.appengine.v1.CpuUtilization; + + /** + * Encodes the specified CpuUtilization message. Does not implicitly {@link google.appengine.v1.CpuUtilization.verify|verify} messages. + * @param message CpuUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ICpuUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CpuUtilization message, length delimited. Does not implicitly {@link google.appengine.v1.CpuUtilization.verify|verify} messages. + * @param message CpuUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ICpuUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CpuUtilization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CpuUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.CpuUtilization; + + /** + * Decodes a CpuUtilization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CpuUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.CpuUtilization; + + /** + * Verifies a CpuUtilization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CpuUtilization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CpuUtilization + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.CpuUtilization; + + /** + * Creates a plain object from a CpuUtilization message. Also converts values to other types if specified. + * @param message CpuUtilization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.CpuUtilization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CpuUtilization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CpuUtilization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestUtilization. */ + interface IRequestUtilization { + + /** RequestUtilization targetRequestCountPerSecond */ + targetRequestCountPerSecond?: (number|null); + + /** RequestUtilization targetConcurrentRequests */ + targetConcurrentRequests?: (number|null); + } + + /** Represents a RequestUtilization. */ + class RequestUtilization implements IRequestUtilization { + + /** + * Constructs a new RequestUtilization. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IRequestUtilization); + + /** RequestUtilization targetRequestCountPerSecond. */ + public targetRequestCountPerSecond: number; + + /** RequestUtilization targetConcurrentRequests. */ + public targetConcurrentRequests: number; + + /** + * Creates a new RequestUtilization instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestUtilization instance + */ + public static create(properties?: google.appengine.v1.IRequestUtilization): google.appengine.v1.RequestUtilization; + + /** + * Encodes the specified RequestUtilization message. Does not implicitly {@link google.appengine.v1.RequestUtilization.verify|verify} messages. + * @param message RequestUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IRequestUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestUtilization message, length delimited. Does not implicitly {@link google.appengine.v1.RequestUtilization.verify|verify} messages. + * @param message RequestUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IRequestUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestUtilization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.RequestUtilization; + + /** + * Decodes a RequestUtilization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.RequestUtilization; + + /** + * Verifies a RequestUtilization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestUtilization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestUtilization + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.RequestUtilization; + + /** + * Creates a plain object from a RequestUtilization message. Also converts values to other types if specified. + * @param message RequestUtilization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.RequestUtilization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestUtilization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestUtilization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DiskUtilization. */ + interface IDiskUtilization { + + /** DiskUtilization targetWriteBytesPerSecond */ + targetWriteBytesPerSecond?: (number|null); + + /** DiskUtilization targetWriteOpsPerSecond */ + targetWriteOpsPerSecond?: (number|null); + + /** DiskUtilization targetReadBytesPerSecond */ + targetReadBytesPerSecond?: (number|null); + + /** DiskUtilization targetReadOpsPerSecond */ + targetReadOpsPerSecond?: (number|null); + } + + /** Represents a DiskUtilization. */ + class DiskUtilization implements IDiskUtilization { + + /** + * Constructs a new DiskUtilization. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IDiskUtilization); + + /** DiskUtilization targetWriteBytesPerSecond. */ + public targetWriteBytesPerSecond: number; + + /** DiskUtilization targetWriteOpsPerSecond. */ + public targetWriteOpsPerSecond: number; + + /** DiskUtilization targetReadBytesPerSecond. */ + public targetReadBytesPerSecond: number; + + /** DiskUtilization targetReadOpsPerSecond. */ + public targetReadOpsPerSecond: number; + + /** + * Creates a new DiskUtilization instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskUtilization instance + */ + public static create(properties?: google.appengine.v1.IDiskUtilization): google.appengine.v1.DiskUtilization; + + /** + * Encodes the specified DiskUtilization message. Does not implicitly {@link google.appengine.v1.DiskUtilization.verify|verify} messages. + * @param message DiskUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IDiskUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskUtilization message, length delimited. Does not implicitly {@link google.appengine.v1.DiskUtilization.verify|verify} messages. + * @param message DiskUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IDiskUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskUtilization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.DiskUtilization; + + /** + * Decodes a DiskUtilization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.DiskUtilization; + + /** + * Verifies a DiskUtilization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskUtilization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskUtilization + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.DiskUtilization; + + /** + * Creates a plain object from a DiskUtilization message. Also converts values to other types if specified. + * @param message DiskUtilization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.DiskUtilization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskUtilization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiskUtilization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkUtilization. */ + interface INetworkUtilization { + + /** NetworkUtilization targetSentBytesPerSecond */ + targetSentBytesPerSecond?: (number|null); + + /** NetworkUtilization targetSentPacketsPerSecond */ + targetSentPacketsPerSecond?: (number|null); + + /** NetworkUtilization targetReceivedBytesPerSecond */ + targetReceivedBytesPerSecond?: (number|null); + + /** NetworkUtilization targetReceivedPacketsPerSecond */ + targetReceivedPacketsPerSecond?: (number|null); + } + + /** Represents a NetworkUtilization. */ + class NetworkUtilization implements INetworkUtilization { + + /** + * Constructs a new NetworkUtilization. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.INetworkUtilization); + + /** NetworkUtilization targetSentBytesPerSecond. */ + public targetSentBytesPerSecond: number; + + /** NetworkUtilization targetSentPacketsPerSecond. */ + public targetSentPacketsPerSecond: number; + + /** NetworkUtilization targetReceivedBytesPerSecond. */ + public targetReceivedBytesPerSecond: number; + + /** NetworkUtilization targetReceivedPacketsPerSecond. */ + public targetReceivedPacketsPerSecond: number; + + /** + * Creates a new NetworkUtilization instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkUtilization instance + */ + public static create(properties?: google.appengine.v1.INetworkUtilization): google.appengine.v1.NetworkUtilization; + + /** + * Encodes the specified NetworkUtilization message. Does not implicitly {@link google.appengine.v1.NetworkUtilization.verify|verify} messages. + * @param message NetworkUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.INetworkUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkUtilization message, length delimited. Does not implicitly {@link google.appengine.v1.NetworkUtilization.verify|verify} messages. + * @param message NetworkUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.INetworkUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkUtilization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.NetworkUtilization; + + /** + * Decodes a NetworkUtilization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.NetworkUtilization; + + /** + * Verifies a NetworkUtilization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkUtilization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkUtilization + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.NetworkUtilization; + + /** + * Creates a plain object from a NetworkUtilization message. Also converts values to other types if specified. + * @param message NetworkUtilization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.NetworkUtilization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkUtilization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkUtilization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StandardSchedulerSettings. */ + interface IStandardSchedulerSettings { + + /** StandardSchedulerSettings targetCpuUtilization */ + targetCpuUtilization?: (number|null); + + /** StandardSchedulerSettings targetThroughputUtilization */ + targetThroughputUtilization?: (number|null); + + /** StandardSchedulerSettings minInstances */ + minInstances?: (number|null); + + /** StandardSchedulerSettings maxInstances */ + maxInstances?: (number|null); + } + + /** Represents a StandardSchedulerSettings. */ + class StandardSchedulerSettings implements IStandardSchedulerSettings { + + /** + * Constructs a new StandardSchedulerSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IStandardSchedulerSettings); + + /** StandardSchedulerSettings targetCpuUtilization. */ + public targetCpuUtilization: number; + + /** StandardSchedulerSettings targetThroughputUtilization. */ + public targetThroughputUtilization: number; + + /** StandardSchedulerSettings minInstances. */ + public minInstances: number; + + /** StandardSchedulerSettings maxInstances. */ + public maxInstances: number; + + /** + * Creates a new StandardSchedulerSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardSchedulerSettings instance + */ + public static create(properties?: google.appengine.v1.IStandardSchedulerSettings): google.appengine.v1.StandardSchedulerSettings; + + /** + * Encodes the specified StandardSchedulerSettings message. Does not implicitly {@link google.appengine.v1.StandardSchedulerSettings.verify|verify} messages. + * @param message StandardSchedulerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IStandardSchedulerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardSchedulerSettings message, length delimited. Does not implicitly {@link google.appengine.v1.StandardSchedulerSettings.verify|verify} messages. + * @param message StandardSchedulerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IStandardSchedulerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardSchedulerSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardSchedulerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.StandardSchedulerSettings; + + /** + * Decodes a StandardSchedulerSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardSchedulerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.StandardSchedulerSettings; + + /** + * Verifies a StandardSchedulerSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardSchedulerSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardSchedulerSettings + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.StandardSchedulerSettings; + + /** + * Creates a plain object from a StandardSchedulerSettings message. Also converts values to other types if specified. + * @param message StandardSchedulerSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.StandardSchedulerSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardSchedulerSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardSchedulerSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Network. */ + interface INetwork { + + /** Network forwardedPorts */ + forwardedPorts?: (string[]|null); + + /** Network instanceTag */ + instanceTag?: (string|null); + + /** Network name */ + name?: (string|null); + + /** Network subnetworkName */ + subnetworkName?: (string|null); + + /** Network sessionAffinity */ + sessionAffinity?: (boolean|null); + } + + /** Represents a Network. */ + class Network implements INetwork { + + /** + * Constructs a new Network. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.INetwork); + + /** Network forwardedPorts. */ + public forwardedPorts: string[]; + + /** Network instanceTag. */ + public instanceTag: string; + + /** Network name. */ + public name: string; + + /** Network subnetworkName. */ + public subnetworkName: string; + + /** Network sessionAffinity. */ + public sessionAffinity: boolean; + + /** + * Creates a new Network instance using the specified properties. + * @param [properties] Properties to set + * @returns Network instance + */ + public static create(properties?: google.appengine.v1.INetwork): google.appengine.v1.Network; + + /** + * Encodes the specified Network message. Does not implicitly {@link google.appengine.v1.Network.verify|verify} messages. + * @param message Network message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.INetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Network message, length delimited. Does not implicitly {@link google.appengine.v1.Network.verify|verify} messages. + * @param message Network message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.INetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Network message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Network; + + /** + * Decodes a Network message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Network; + + /** + * Verifies a Network message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Network message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Network + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Network; + + /** + * Creates a plain object from a Network message. Also converts values to other types if specified. + * @param message Network + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Network, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Network to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Network + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Volume. */ + interface IVolume { + + /** Volume name */ + name?: (string|null); + + /** Volume volumeType */ + volumeType?: (string|null); + + /** Volume sizeGb */ + sizeGb?: (number|null); + } + + /** Represents a Volume. */ + class Volume implements IVolume { + + /** + * Constructs a new Volume. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IVolume); + + /** Volume name. */ + public name: string; + + /** Volume volumeType. */ + public volumeType: string; + + /** Volume sizeGb. */ + public sizeGb: number; + + /** + * Creates a new Volume instance using the specified properties. + * @param [properties] Properties to set + * @returns Volume instance + */ + public static create(properties?: google.appengine.v1.IVolume): google.appengine.v1.Volume; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.appengine.v1.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.appengine.v1.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Volume; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Volume; + + /** + * Verifies a Volume message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Volume + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Volume; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @param message Volume + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Volume, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Volume to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Volume + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Resources. */ + interface IResources { + + /** Resources cpu */ + cpu?: (number|null); + + /** Resources diskGb */ + diskGb?: (number|null); + + /** Resources memoryGb */ + memoryGb?: (number|null); + + /** Resources volumes */ + volumes?: (google.appengine.v1.IVolume[]|null); + + /** Resources kmsKeyReference */ + kmsKeyReference?: (string|null); + } + + /** Represents a Resources. */ + class Resources implements IResources { + + /** + * Constructs a new Resources. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IResources); + + /** Resources cpu. */ + public cpu: number; + + /** Resources diskGb. */ + public diskGb: number; + + /** Resources memoryGb. */ + public memoryGb: number; + + /** Resources volumes. */ + public volumes: google.appengine.v1.IVolume[]; + + /** Resources kmsKeyReference. */ + public kmsKeyReference: string; + + /** + * Creates a new Resources instance using the specified properties. + * @param [properties] Properties to set + * @returns Resources instance + */ + public static create(properties?: google.appengine.v1.IResources): google.appengine.v1.Resources; + + /** + * Encodes the specified Resources message. Does not implicitly {@link google.appengine.v1.Resources.verify|verify} messages. + * @param message Resources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resources message, length delimited. Does not implicitly {@link google.appengine.v1.Resources.verify|verify} messages. + * @param message Resources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Resources; + + /** + * Decodes a Resources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Resources; + + /** + * Verifies a Resources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Resources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resources + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Resources; + + /** + * Creates a plain object from a Resources message. Also converts values to other types if specified. + * @param message Resources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Resources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** InboundServiceType enum. */ + enum InboundServiceType { + INBOUND_SERVICE_UNSPECIFIED = 0, + INBOUND_SERVICE_MAIL = 1, + INBOUND_SERVICE_MAIL_BOUNCE = 2, + INBOUND_SERVICE_XMPP_ERROR = 3, + INBOUND_SERVICE_XMPP_MESSAGE = 4, + INBOUND_SERVICE_XMPP_SUBSCRIBE = 5, + INBOUND_SERVICE_XMPP_PRESENCE = 6, + INBOUND_SERVICE_CHANNEL_PRESENCE = 7, + INBOUND_SERVICE_WARMUP = 9 + } + + /** ServingStatus enum. */ + enum ServingStatus { + SERVING_STATUS_UNSPECIFIED = 0, + SERVING = 1, + STOPPED = 2 + } + + /** Properties of a VpcAccessConnector. */ + interface IVpcAccessConnector { + + /** VpcAccessConnector name */ + name?: (string|null); + + /** VpcAccessConnector egressSetting */ + egressSetting?: (google.appengine.v1.VpcAccessConnector.EgressSetting|keyof typeof google.appengine.v1.VpcAccessConnector.EgressSetting|null); + } + + /** Represents a VpcAccessConnector. */ + class VpcAccessConnector implements IVpcAccessConnector { + + /** + * Constructs a new VpcAccessConnector. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IVpcAccessConnector); + + /** VpcAccessConnector name. */ + public name: string; + + /** VpcAccessConnector egressSetting. */ + public egressSetting: (google.appengine.v1.VpcAccessConnector.EgressSetting|keyof typeof google.appengine.v1.VpcAccessConnector.EgressSetting); + + /** + * Creates a new VpcAccessConnector instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcAccessConnector instance + */ + public static create(properties?: google.appengine.v1.IVpcAccessConnector): google.appengine.v1.VpcAccessConnector; + + /** + * Encodes the specified VpcAccessConnector message. Does not implicitly {@link google.appengine.v1.VpcAccessConnector.verify|verify} messages. + * @param message VpcAccessConnector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IVpcAccessConnector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcAccessConnector message, length delimited. Does not implicitly {@link google.appengine.v1.VpcAccessConnector.verify|verify} messages. + * @param message VpcAccessConnector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IVpcAccessConnector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcAccessConnector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcAccessConnector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.VpcAccessConnector; + + /** + * Decodes a VpcAccessConnector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcAccessConnector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.VpcAccessConnector; + + /** + * Verifies a VpcAccessConnector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpcAccessConnector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcAccessConnector + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.VpcAccessConnector; + + /** + * Creates a plain object from a VpcAccessConnector message. Also converts values to other types if specified. + * @param message VpcAccessConnector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.VpcAccessConnector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcAccessConnector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcAccessConnector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VpcAccessConnector { + + /** EgressSetting enum. */ + enum EgressSetting { + EGRESS_SETTING_UNSPECIFIED = 0, + ALL_TRAFFIC = 1, + PRIVATE_IP_RANGES = 2 + } + } + + /** Properties of an Entrypoint. */ + interface IEntrypoint { + + /** Entrypoint shell */ + shell?: (string|null); + } + + /** Represents an Entrypoint. */ + class Entrypoint implements IEntrypoint { + + /** + * Constructs a new Entrypoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IEntrypoint); + + /** Entrypoint shell. */ + public shell?: (string|null); + + /** Entrypoint command. */ + public command?: "shell"; + + /** + * Creates a new Entrypoint instance using the specified properties. + * @param [properties] Properties to set + * @returns Entrypoint instance + */ + public static create(properties?: google.appengine.v1.IEntrypoint): google.appengine.v1.Entrypoint; + + /** + * Encodes the specified Entrypoint message. Does not implicitly {@link google.appengine.v1.Entrypoint.verify|verify} messages. + * @param message Entrypoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IEntrypoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entrypoint message, length delimited. Does not implicitly {@link google.appengine.v1.Entrypoint.verify|verify} messages. + * @param message Entrypoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IEntrypoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entrypoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entrypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Entrypoint; + + /** + * Decodes an Entrypoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entrypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Entrypoint; + + /** + * Verifies an Entrypoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entrypoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entrypoint + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Entrypoint; + + /** + * Creates a plain object from an Entrypoint message. Also converts values to other types if specified. + * @param message Entrypoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Entrypoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entrypoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entrypoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Deployment. */ + interface IDeployment { + + /** Deployment files */ + files?: ({ [k: string]: google.appengine.v1.IFileInfo }|null); + + /** Deployment container */ + container?: (google.appengine.v1.IContainerInfo|null); + + /** Deployment zip */ + zip?: (google.appengine.v1.IZipInfo|null); + + /** Deployment cloudBuildOptions */ + cloudBuildOptions?: (google.appengine.v1.ICloudBuildOptions|null); + } + + /** Represents a Deployment. */ + class Deployment implements IDeployment { + + /** + * Constructs a new Deployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IDeployment); + + /** Deployment files. */ + public files: { [k: string]: google.appengine.v1.IFileInfo }; + + /** Deployment container. */ + public container?: (google.appengine.v1.IContainerInfo|null); + + /** Deployment zip. */ + public zip?: (google.appengine.v1.IZipInfo|null); + + /** Deployment cloudBuildOptions. */ + public cloudBuildOptions?: (google.appengine.v1.ICloudBuildOptions|null); + + /** + * Creates a new Deployment instance using the specified properties. + * @param [properties] Properties to set + * @returns Deployment instance + */ + public static create(properties?: google.appengine.v1.IDeployment): google.appengine.v1.Deployment; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.appengine.v1.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.appengine.v1.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.Deployment; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.Deployment; + + /** + * Verifies a Deployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deployment + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.Deployment; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @param message Deployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileInfo. */ + interface IFileInfo { + + /** FileInfo sourceUrl */ + sourceUrl?: (string|null); + + /** FileInfo sha1Sum */ + sha1Sum?: (string|null); + + /** FileInfo mimeType */ + mimeType?: (string|null); + } + + /** Represents a FileInfo. */ + class FileInfo implements IFileInfo { + + /** + * Constructs a new FileInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IFileInfo); + + /** FileInfo sourceUrl. */ + public sourceUrl: string; + + /** FileInfo sha1Sum. */ + public sha1Sum: string; + + /** FileInfo mimeType. */ + public mimeType: string; + + /** + * Creates a new FileInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FileInfo instance + */ + public static create(properties?: google.appengine.v1.IFileInfo): google.appengine.v1.FileInfo; + + /** + * Encodes the specified FileInfo message. Does not implicitly {@link google.appengine.v1.FileInfo.verify|verify} messages. + * @param message FileInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IFileInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileInfo message, length delimited. Does not implicitly {@link google.appengine.v1.FileInfo.verify|verify} messages. + * @param message FileInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IFileInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.FileInfo; + + /** + * Decodes a FileInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.FileInfo; + + /** + * Verifies a FileInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileInfo + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.FileInfo; + + /** + * Creates a plain object from a FileInfo message. Also converts values to other types if specified. + * @param message FileInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.FileInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContainerInfo. */ + interface IContainerInfo { + + /** ContainerInfo image */ + image?: (string|null); + } + + /** Represents a ContainerInfo. */ + class ContainerInfo implements IContainerInfo { + + /** + * Constructs a new ContainerInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IContainerInfo); + + /** ContainerInfo image. */ + public image: string; + + /** + * Creates a new ContainerInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ContainerInfo instance + */ + public static create(properties?: google.appengine.v1.IContainerInfo): google.appengine.v1.ContainerInfo; + + /** + * Encodes the specified ContainerInfo message. Does not implicitly {@link google.appengine.v1.ContainerInfo.verify|verify} messages. + * @param message ContainerInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IContainerInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContainerInfo message, length delimited. Does not implicitly {@link google.appengine.v1.ContainerInfo.verify|verify} messages. + * @param message ContainerInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IContainerInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContainerInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContainerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ContainerInfo; + + /** + * Decodes a ContainerInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContainerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ContainerInfo; + + /** + * Verifies a ContainerInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContainerInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContainerInfo + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ContainerInfo; + + /** + * Creates a plain object from a ContainerInfo message. Also converts values to other types if specified. + * @param message ContainerInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ContainerInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContainerInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContainerInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudBuildOptions. */ + interface ICloudBuildOptions { + + /** CloudBuildOptions appYamlPath */ + appYamlPath?: (string|null); + + /** CloudBuildOptions cloudBuildTimeout */ + cloudBuildTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a CloudBuildOptions. */ + class CloudBuildOptions implements ICloudBuildOptions { + + /** + * Constructs a new CloudBuildOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ICloudBuildOptions); + + /** CloudBuildOptions appYamlPath. */ + public appYamlPath: string; + + /** CloudBuildOptions cloudBuildTimeout. */ + public cloudBuildTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new CloudBuildOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudBuildOptions instance + */ + public static create(properties?: google.appengine.v1.ICloudBuildOptions): google.appengine.v1.CloudBuildOptions; + + /** + * Encodes the specified CloudBuildOptions message. Does not implicitly {@link google.appengine.v1.CloudBuildOptions.verify|verify} messages. + * @param message CloudBuildOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ICloudBuildOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudBuildOptions message, length delimited. Does not implicitly {@link google.appengine.v1.CloudBuildOptions.verify|verify} messages. + * @param message CloudBuildOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ICloudBuildOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudBuildOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudBuildOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.CloudBuildOptions; + + /** + * Decodes a CloudBuildOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudBuildOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.CloudBuildOptions; + + /** + * Verifies a CloudBuildOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudBuildOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudBuildOptions + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.CloudBuildOptions; + + /** + * Creates a plain object from a CloudBuildOptions message. Also converts values to other types if specified. + * @param message CloudBuildOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.CloudBuildOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudBuildOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudBuildOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ZipInfo. */ + interface IZipInfo { + + /** ZipInfo sourceUrl */ + sourceUrl?: (string|null); + + /** ZipInfo filesCount */ + filesCount?: (number|null); + } + + /** Represents a ZipInfo. */ + class ZipInfo implements IZipInfo { + + /** + * Constructs a new ZipInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IZipInfo); + + /** ZipInfo sourceUrl. */ + public sourceUrl: string; + + /** ZipInfo filesCount. */ + public filesCount: number; + + /** + * Creates a new ZipInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ZipInfo instance + */ + public static create(properties?: google.appengine.v1.IZipInfo): google.appengine.v1.ZipInfo; + + /** + * Encodes the specified ZipInfo message. Does not implicitly {@link google.appengine.v1.ZipInfo.verify|verify} messages. + * @param message ZipInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IZipInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZipInfo message, length delimited. Does not implicitly {@link google.appengine.v1.ZipInfo.verify|verify} messages. + * @param message ZipInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IZipInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZipInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZipInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.ZipInfo; + + /** + * Decodes a ZipInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZipInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.ZipInfo; + + /** + * Verifies a ZipInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZipInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZipInfo + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.ZipInfo; + + /** + * Creates a plain object from a ZipInfo message. Also converts values to other types if specified. + * @param message ZipInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.ZipInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZipInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ZipInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditData. */ + interface IAuditData { + + /** AuditData updateService */ + updateService?: (google.appengine.v1.IUpdateServiceMethod|null); + + /** AuditData createVersion */ + createVersion?: (google.appengine.v1.ICreateVersionMethod|null); + } + + /** Represents an AuditData. */ + class AuditData implements IAuditData { + + /** + * Constructs a new AuditData. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IAuditData); + + /** AuditData updateService. */ + public updateService?: (google.appengine.v1.IUpdateServiceMethod|null); + + /** AuditData createVersion. */ + public createVersion?: (google.appengine.v1.ICreateVersionMethod|null); + + /** AuditData method. */ + public method?: ("updateService"|"createVersion"); + + /** + * Creates a new AuditData instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditData instance + */ + public static create(properties?: google.appengine.v1.IAuditData): google.appengine.v1.AuditData; + + /** + * Encodes the specified AuditData message. Does not implicitly {@link google.appengine.v1.AuditData.verify|verify} messages. + * @param message AuditData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IAuditData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditData message, length delimited. Does not implicitly {@link google.appengine.v1.AuditData.verify|verify} messages. + * @param message AuditData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IAuditData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.AuditData; + + /** + * Decodes an AuditData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.AuditData; + + /** + * Verifies an AuditData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditData + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.AuditData; + + /** + * Creates a plain object from an AuditData message. Also converts values to other types if specified. + * @param message AuditData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.AuditData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateServiceMethod. */ + interface IUpdateServiceMethod { + + /** UpdateServiceMethod request */ + request?: (google.appengine.v1.IUpdateServiceRequest|null); + } + + /** Represents an UpdateServiceMethod. */ + class UpdateServiceMethod implements IUpdateServiceMethod { + + /** + * Constructs a new UpdateServiceMethod. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IUpdateServiceMethod); + + /** UpdateServiceMethod request. */ + public request?: (google.appengine.v1.IUpdateServiceRequest|null); + + /** + * Creates a new UpdateServiceMethod instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateServiceMethod instance + */ + public static create(properties?: google.appengine.v1.IUpdateServiceMethod): google.appengine.v1.UpdateServiceMethod; + + /** + * Encodes the specified UpdateServiceMethod message. Does not implicitly {@link google.appengine.v1.UpdateServiceMethod.verify|verify} messages. + * @param message UpdateServiceMethod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IUpdateServiceMethod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateServiceMethod message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateServiceMethod.verify|verify} messages. + * @param message UpdateServiceMethod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IUpdateServiceMethod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateServiceMethod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateServiceMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.UpdateServiceMethod; + + /** + * Decodes an UpdateServiceMethod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateServiceMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.UpdateServiceMethod; + + /** + * Verifies an UpdateServiceMethod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateServiceMethod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateServiceMethod + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.UpdateServiceMethod; + + /** + * Creates a plain object from an UpdateServiceMethod message. Also converts values to other types if specified. + * @param message UpdateServiceMethod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.UpdateServiceMethod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateServiceMethod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateServiceMethod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateVersionMethod. */ + interface ICreateVersionMethod { + + /** CreateVersionMethod request */ + request?: (google.appengine.v1.ICreateVersionRequest|null); + } + + /** Represents a CreateVersionMethod. */ + class CreateVersionMethod implements ICreateVersionMethod { + + /** + * Constructs a new CreateVersionMethod. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ICreateVersionMethod); + + /** CreateVersionMethod request. */ + public request?: (google.appengine.v1.ICreateVersionRequest|null); + + /** + * Creates a new CreateVersionMethod instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateVersionMethod instance + */ + public static create(properties?: google.appengine.v1.ICreateVersionMethod): google.appengine.v1.CreateVersionMethod; + + /** + * Encodes the specified CreateVersionMethod message. Does not implicitly {@link google.appengine.v1.CreateVersionMethod.verify|verify} messages. + * @param message CreateVersionMethod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ICreateVersionMethod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateVersionMethod message, length delimited. Does not implicitly {@link google.appengine.v1.CreateVersionMethod.verify|verify} messages. + * @param message CreateVersionMethod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ICreateVersionMethod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateVersionMethod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateVersionMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.CreateVersionMethod; + + /** + * Decodes a CreateVersionMethod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateVersionMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.CreateVersionMethod; + + /** + * Verifies a CreateVersionMethod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateVersionMethod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateVersionMethod + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.CreateVersionMethod; + + /** + * Creates a plain object from a CreateVersionMethod message. Also converts values to other types if specified. + * @param message CreateVersionMethod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.CreateVersionMethod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateVersionMethod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateVersionMethod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { + + /** LocationMetadata standardEnvironmentAvailable */ + standardEnvironmentAvailable?: (boolean|null); + + /** LocationMetadata flexibleEnvironmentAvailable */ + flexibleEnvironmentAvailable?: (boolean|null); + + /** LocationMetadata searchApiAvailable */ + searchApiAvailable?: (boolean|null); + } + + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { + + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ILocationMetadata); + + /** LocationMetadata standardEnvironmentAvailable. */ + public standardEnvironmentAvailable: boolean; + + /** LocationMetadata flexibleEnvironmentAvailable. */ + public flexibleEnvironmentAvailable: boolean; + + /** LocationMetadata searchApiAvailable. */ + public searchApiAvailable: boolean; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.appengine.v1.ILocationMetadata): google.appengine.v1.LocationMetadata; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.appengine.v1.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.appengine.v1.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.LocationMetadata; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.LocationMetadata; + + /** + * Verifies a LocationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.LocationMetadata; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadataV1. */ + interface IOperationMetadataV1 { + + /** OperationMetadataV1 method */ + method?: (string|null); + + /** OperationMetadataV1 insertTime */ + insertTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadataV1 endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadataV1 user */ + user?: (string|null); + + /** OperationMetadataV1 target */ + target?: (string|null); + + /** OperationMetadataV1 ephemeralMessage */ + ephemeralMessage?: (string|null); + + /** OperationMetadataV1 warning */ + warning?: (string[]|null); + + /** OperationMetadataV1 createVersionMetadata */ + createVersionMetadata?: (google.appengine.v1.ICreateVersionMetadataV1|null); + } + + /** Represents an OperationMetadataV1. */ + class OperationMetadataV1 implements IOperationMetadataV1 { + + /** + * Constructs a new OperationMetadataV1. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.IOperationMetadataV1); + + /** OperationMetadataV1 method. */ + public method: string; + + /** OperationMetadataV1 insertTime. */ + public insertTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadataV1 endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadataV1 user. */ + public user: string; + + /** OperationMetadataV1 target. */ + public target: string; + + /** OperationMetadataV1 ephemeralMessage. */ + public ephemeralMessage: string; + + /** OperationMetadataV1 warning. */ + public warning: string[]; + + /** OperationMetadataV1 createVersionMetadata. */ + public createVersionMetadata?: (google.appengine.v1.ICreateVersionMetadataV1|null); + + /** OperationMetadataV1 methodMetadata. */ + public methodMetadata?: "createVersionMetadata"; + + /** + * Creates a new OperationMetadataV1 instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadataV1 instance + */ + public static create(properties?: google.appengine.v1.IOperationMetadataV1): google.appengine.v1.OperationMetadataV1; + + /** + * Encodes the specified OperationMetadataV1 message. Does not implicitly {@link google.appengine.v1.OperationMetadataV1.verify|verify} messages. + * @param message OperationMetadataV1 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.IOperationMetadataV1, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadataV1 message, length delimited. Does not implicitly {@link google.appengine.v1.OperationMetadataV1.verify|verify} messages. + * @param message OperationMetadataV1 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.IOperationMetadataV1, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadataV1 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadataV1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.OperationMetadataV1; + + /** + * Decodes an OperationMetadataV1 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadataV1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.OperationMetadataV1; + + /** + * Verifies an OperationMetadataV1 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadataV1 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadataV1 + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.OperationMetadataV1; + + /** + * Creates a plain object from an OperationMetadataV1 message. Also converts values to other types if specified. + * @param message OperationMetadataV1 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.OperationMetadataV1, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadataV1 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadataV1 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateVersionMetadataV1. */ + interface ICreateVersionMetadataV1 { + + /** CreateVersionMetadataV1 cloudBuildId */ + cloudBuildId?: (string|null); + } + + /** Represents a CreateVersionMetadataV1. */ + class CreateVersionMetadataV1 implements ICreateVersionMetadataV1 { + + /** + * Constructs a new CreateVersionMetadataV1. + * @param [properties] Properties to set + */ + constructor(properties?: google.appengine.v1.ICreateVersionMetadataV1); + + /** CreateVersionMetadataV1 cloudBuildId. */ + public cloudBuildId: string; + + /** + * Creates a new CreateVersionMetadataV1 instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateVersionMetadataV1 instance + */ + public static create(properties?: google.appengine.v1.ICreateVersionMetadataV1): google.appengine.v1.CreateVersionMetadataV1; + + /** + * Encodes the specified CreateVersionMetadataV1 message. Does not implicitly {@link google.appengine.v1.CreateVersionMetadataV1.verify|verify} messages. + * @param message CreateVersionMetadataV1 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.appengine.v1.ICreateVersionMetadataV1, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateVersionMetadataV1 message, length delimited. Does not implicitly {@link google.appengine.v1.CreateVersionMetadataV1.verify|verify} messages. + * @param message CreateVersionMetadataV1 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.appengine.v1.ICreateVersionMetadataV1, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateVersionMetadataV1 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateVersionMetadataV1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.appengine.v1.CreateVersionMetadataV1; + + /** + * Decodes a CreateVersionMetadataV1 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateVersionMetadataV1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.appengine.v1.CreateVersionMetadataV1; + + /** + * Verifies a CreateVersionMetadataV1 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateVersionMetadataV1 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateVersionMetadataV1 + */ + public static fromObject(object: { [k: string]: any }): google.appengine.v1.CreateVersionMetadataV1; + + /** + * Creates a plain object from a CreateVersionMetadataV1 message. Also converts values to other types if specified. + * @param message CreateVersionMetadataV1 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.appengine.v1.CreateVersionMetadataV1, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateVersionMetadataV1 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateVersionMetadataV1 + * @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 longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-appengine/protos/protos.js b/packages/google-appengine/protos/protos.js new file mode 100644 index 00000000000..186b910220c --- /dev/null +++ b/packages/google-appengine/protos/protos.js @@ -0,0 +1,43340 @@ +// 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_appengine_admin_protos || ($protobuf.roots._google_cloud_appengine_admin_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + 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.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.appengine = (function() { + + /** + * Namespace appengine. + * @memberof google + * @namespace + */ + var appengine = {}; + + appengine.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.appengine + * @namespace + */ + var v1 = {}; + + v1.ApiConfigHandler = (function() { + + /** + * Properties of an ApiConfigHandler. + * @memberof google.appengine.v1 + * @interface IApiConfigHandler + * @property {google.appengine.v1.AuthFailAction|null} [authFailAction] ApiConfigHandler authFailAction + * @property {google.appengine.v1.LoginRequirement|null} [login] ApiConfigHandler login + * @property {string|null} [script] ApiConfigHandler script + * @property {google.appengine.v1.SecurityLevel|null} [securityLevel] ApiConfigHandler securityLevel + * @property {string|null} [url] ApiConfigHandler url + */ + + /** + * Constructs a new ApiConfigHandler. + * @memberof google.appengine.v1 + * @classdesc Represents an ApiConfigHandler. + * @implements IApiConfigHandler + * @constructor + * @param {google.appengine.v1.IApiConfigHandler=} [properties] Properties to set + */ + function ApiConfigHandler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiConfigHandler authFailAction. + * @member {google.appengine.v1.AuthFailAction} authFailAction + * @memberof google.appengine.v1.ApiConfigHandler + * @instance + */ + ApiConfigHandler.prototype.authFailAction = 0; + + /** + * ApiConfigHandler login. + * @member {google.appengine.v1.LoginRequirement} login + * @memberof google.appengine.v1.ApiConfigHandler + * @instance + */ + ApiConfigHandler.prototype.login = 0; + + /** + * ApiConfigHandler script. + * @member {string} script + * @memberof google.appengine.v1.ApiConfigHandler + * @instance + */ + ApiConfigHandler.prototype.script = ""; + + /** + * ApiConfigHandler securityLevel. + * @member {google.appengine.v1.SecurityLevel} securityLevel + * @memberof google.appengine.v1.ApiConfigHandler + * @instance + */ + ApiConfigHandler.prototype.securityLevel = 0; + + /** + * ApiConfigHandler url. + * @member {string} url + * @memberof google.appengine.v1.ApiConfigHandler + * @instance + */ + ApiConfigHandler.prototype.url = ""; + + /** + * Creates a new ApiConfigHandler instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ApiConfigHandler + * @static + * @param {google.appengine.v1.IApiConfigHandler=} [properties] Properties to set + * @returns {google.appengine.v1.ApiConfigHandler} ApiConfigHandler instance + */ + ApiConfigHandler.create = function create(properties) { + return new ApiConfigHandler(properties); + }; + + /** + * Encodes the specified ApiConfigHandler message. Does not implicitly {@link google.appengine.v1.ApiConfigHandler.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ApiConfigHandler + * @static + * @param {google.appengine.v1.IApiConfigHandler} message ApiConfigHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiConfigHandler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authFailAction != null && Object.hasOwnProperty.call(message, "authFailAction")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.authFailAction); + if (message.login != null && Object.hasOwnProperty.call(message, "login")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.login); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.script); + if (message.securityLevel != null && Object.hasOwnProperty.call(message, "securityLevel")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.securityLevel); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.url); + return writer; + }; + + /** + * Encodes the specified ApiConfigHandler message, length delimited. Does not implicitly {@link google.appengine.v1.ApiConfigHandler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ApiConfigHandler + * @static + * @param {google.appengine.v1.IApiConfigHandler} message ApiConfigHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiConfigHandler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiConfigHandler message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ApiConfigHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ApiConfigHandler} ApiConfigHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiConfigHandler.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.appengine.v1.ApiConfigHandler(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.authFailAction = reader.int32(); + break; + } + case 2: { + message.login = reader.int32(); + break; + } + case 3: { + message.script = reader.string(); + break; + } + case 4: { + message.securityLevel = reader.int32(); + break; + } + case 5: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiConfigHandler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ApiConfigHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ApiConfigHandler} ApiConfigHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiConfigHandler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiConfigHandler message. + * @function verify + * @memberof google.appengine.v1.ApiConfigHandler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiConfigHandler.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authFailAction != null && message.hasOwnProperty("authFailAction")) + switch (message.authFailAction) { + default: + return "authFailAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.login != null && message.hasOwnProperty("login")) + switch (message.login) { + default: + return "login: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.script != null && message.hasOwnProperty("script")) + if (!$util.isString(message.script)) + return "script: string expected"; + if (message.securityLevel != null && message.hasOwnProperty("securityLevel")) + switch (message.securityLevel) { + default: + return "securityLevel: enum value expected"; + case 0: + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates an ApiConfigHandler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ApiConfigHandler + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ApiConfigHandler} ApiConfigHandler + */ + ApiConfigHandler.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ApiConfigHandler) + return object; + var message = new $root.google.appengine.v1.ApiConfigHandler(); + switch (object.authFailAction) { + default: + if (typeof object.authFailAction === "number") { + message.authFailAction = object.authFailAction; + break; + } + break; + case "AUTH_FAIL_ACTION_UNSPECIFIED": + case 0: + message.authFailAction = 0; + break; + case "AUTH_FAIL_ACTION_REDIRECT": + case 1: + message.authFailAction = 1; + break; + case "AUTH_FAIL_ACTION_UNAUTHORIZED": + case 2: + message.authFailAction = 2; + break; + } + switch (object.login) { + default: + if (typeof object.login === "number") { + message.login = object.login; + break; + } + break; + case "LOGIN_UNSPECIFIED": + case 0: + message.login = 0; + break; + case "LOGIN_OPTIONAL": + case 1: + message.login = 1; + break; + case "LOGIN_ADMIN": + case 2: + message.login = 2; + break; + case "LOGIN_REQUIRED": + case 3: + message.login = 3; + break; + } + if (object.script != null) + message.script = String(object.script); + switch (object.securityLevel) { + default: + if (typeof object.securityLevel === "number") { + message.securityLevel = object.securityLevel; + break; + } + break; + case "SECURE_UNSPECIFIED": + case 0: + message.securityLevel = 0; + break; + case "SECURE_DEFAULT": + case 0: + message.securityLevel = 0; + break; + case "SECURE_NEVER": + case 1: + message.securityLevel = 1; + break; + case "SECURE_OPTIONAL": + case 2: + message.securityLevel = 2; + break; + case "SECURE_ALWAYS": + case 3: + message.securityLevel = 3; + break; + } + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from an ApiConfigHandler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ApiConfigHandler + * @static + * @param {google.appengine.v1.ApiConfigHandler} message ApiConfigHandler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiConfigHandler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.authFailAction = options.enums === String ? "AUTH_FAIL_ACTION_UNSPECIFIED" : 0; + object.login = options.enums === String ? "LOGIN_UNSPECIFIED" : 0; + object.script = ""; + object.securityLevel = options.enums === String ? "SECURE_UNSPECIFIED" : 0; + object.url = ""; + } + if (message.authFailAction != null && message.hasOwnProperty("authFailAction")) + object.authFailAction = options.enums === String ? $root.google.appengine.v1.AuthFailAction[message.authFailAction] === undefined ? message.authFailAction : $root.google.appengine.v1.AuthFailAction[message.authFailAction] : message.authFailAction; + if (message.login != null && message.hasOwnProperty("login")) + object.login = options.enums === String ? $root.google.appengine.v1.LoginRequirement[message.login] === undefined ? message.login : $root.google.appengine.v1.LoginRequirement[message.login] : message.login; + if (message.script != null && message.hasOwnProperty("script")) + object.script = message.script; + if (message.securityLevel != null && message.hasOwnProperty("securityLevel")) + object.securityLevel = options.enums === String ? $root.google.appengine.v1.SecurityLevel[message.securityLevel] === undefined ? message.securityLevel : $root.google.appengine.v1.SecurityLevel[message.securityLevel] : message.securityLevel; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this ApiConfigHandler to JSON. + * @function toJSON + * @memberof google.appengine.v1.ApiConfigHandler + * @instance + * @returns {Object.} JSON object + */ + ApiConfigHandler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiConfigHandler + * @function getTypeUrl + * @memberof google.appengine.v1.ApiConfigHandler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiConfigHandler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ApiConfigHandler"; + }; + + return ApiConfigHandler; + })(); + + v1.ErrorHandler = (function() { + + /** + * Properties of an ErrorHandler. + * @memberof google.appengine.v1 + * @interface IErrorHandler + * @property {google.appengine.v1.ErrorHandler.ErrorCode|null} [errorCode] ErrorHandler errorCode + * @property {string|null} [staticFile] ErrorHandler staticFile + * @property {string|null} [mimeType] ErrorHandler mimeType + */ + + /** + * Constructs a new ErrorHandler. + * @memberof google.appengine.v1 + * @classdesc Represents an ErrorHandler. + * @implements IErrorHandler + * @constructor + * @param {google.appengine.v1.IErrorHandler=} [properties] Properties to set + */ + function ErrorHandler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ErrorHandler errorCode. + * @member {google.appengine.v1.ErrorHandler.ErrorCode} errorCode + * @memberof google.appengine.v1.ErrorHandler + * @instance + */ + ErrorHandler.prototype.errorCode = 0; + + /** + * ErrorHandler staticFile. + * @member {string} staticFile + * @memberof google.appengine.v1.ErrorHandler + * @instance + */ + ErrorHandler.prototype.staticFile = ""; + + /** + * ErrorHandler mimeType. + * @member {string} mimeType + * @memberof google.appengine.v1.ErrorHandler + * @instance + */ + ErrorHandler.prototype.mimeType = ""; + + /** + * Creates a new ErrorHandler instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ErrorHandler + * @static + * @param {google.appengine.v1.IErrorHandler=} [properties] Properties to set + * @returns {google.appengine.v1.ErrorHandler} ErrorHandler instance + */ + ErrorHandler.create = function create(properties) { + return new ErrorHandler(properties); + }; + + /** + * Encodes the specified ErrorHandler message. Does not implicitly {@link google.appengine.v1.ErrorHandler.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ErrorHandler + * @static + * @param {google.appengine.v1.IErrorHandler} message ErrorHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorHandler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorCode); + if (message.staticFile != null && Object.hasOwnProperty.call(message, "staticFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.staticFile); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified ErrorHandler message, length delimited. Does not implicitly {@link google.appengine.v1.ErrorHandler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ErrorHandler + * @static + * @param {google.appengine.v1.IErrorHandler} message ErrorHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorHandler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrorHandler message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ErrorHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ErrorHandler} ErrorHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorHandler.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.appengine.v1.ErrorHandler(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.errorCode = reader.int32(); + break; + } + case 2: { + message.staticFile = reader.string(); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorHandler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ErrorHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ErrorHandler} ErrorHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorHandler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorHandler message. + * @function verify + * @memberof google.appengine.v1.ErrorHandler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorHandler.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + switch (message.errorCode) { + default: + return "errorCode: enum value expected"; + case 0: + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.staticFile != null && message.hasOwnProperty("staticFile")) + if (!$util.isString(message.staticFile)) + return "staticFile: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates an ErrorHandler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ErrorHandler + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ErrorHandler} ErrorHandler + */ + ErrorHandler.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ErrorHandler) + return object; + var message = new $root.google.appengine.v1.ErrorHandler(); + switch (object.errorCode) { + default: + if (typeof object.errorCode === "number") { + message.errorCode = object.errorCode; + break; + } + break; + case "ERROR_CODE_UNSPECIFIED": + case 0: + message.errorCode = 0; + break; + case "ERROR_CODE_DEFAULT": + case 0: + message.errorCode = 0; + break; + case "ERROR_CODE_OVER_QUOTA": + case 1: + message.errorCode = 1; + break; + case "ERROR_CODE_DOS_API_DENIAL": + case 2: + message.errorCode = 2; + break; + case "ERROR_CODE_TIMEOUT": + case 3: + message.errorCode = 3; + break; + } + if (object.staticFile != null) + message.staticFile = String(object.staticFile); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from an ErrorHandler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ErrorHandler + * @static + * @param {google.appengine.v1.ErrorHandler} message ErrorHandler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorHandler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.errorCode = options.enums === String ? "ERROR_CODE_UNSPECIFIED" : 0; + object.staticFile = ""; + object.mimeType = ""; + } + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + object.errorCode = options.enums === String ? $root.google.appengine.v1.ErrorHandler.ErrorCode[message.errorCode] === undefined ? message.errorCode : $root.google.appengine.v1.ErrorHandler.ErrorCode[message.errorCode] : message.errorCode; + if (message.staticFile != null && message.hasOwnProperty("staticFile")) + object.staticFile = message.staticFile; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this ErrorHandler to JSON. + * @function toJSON + * @memberof google.appengine.v1.ErrorHandler + * @instance + * @returns {Object.} JSON object + */ + ErrorHandler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorHandler + * @function getTypeUrl + * @memberof google.appengine.v1.ErrorHandler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorHandler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ErrorHandler"; + }; + + /** + * ErrorCode enum. + * @name google.appengine.v1.ErrorHandler.ErrorCode + * @enum {number} + * @property {number} ERROR_CODE_UNSPECIFIED=0 ERROR_CODE_UNSPECIFIED value + * @property {number} ERROR_CODE_DEFAULT=0 ERROR_CODE_DEFAULT value + * @property {number} ERROR_CODE_OVER_QUOTA=1 ERROR_CODE_OVER_QUOTA value + * @property {number} ERROR_CODE_DOS_API_DENIAL=2 ERROR_CODE_DOS_API_DENIAL value + * @property {number} ERROR_CODE_TIMEOUT=3 ERROR_CODE_TIMEOUT value + */ + ErrorHandler.ErrorCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_CODE_UNSPECIFIED"] = 0; + values["ERROR_CODE_DEFAULT"] = 0; + values[valuesById[1] = "ERROR_CODE_OVER_QUOTA"] = 1; + values[valuesById[2] = "ERROR_CODE_DOS_API_DENIAL"] = 2; + values[valuesById[3] = "ERROR_CODE_TIMEOUT"] = 3; + return values; + })(); + + return ErrorHandler; + })(); + + v1.UrlMap = (function() { + + /** + * Properties of an UrlMap. + * @memberof google.appengine.v1 + * @interface IUrlMap + * @property {string|null} [urlRegex] UrlMap urlRegex + * @property {google.appengine.v1.IStaticFilesHandler|null} [staticFiles] UrlMap staticFiles + * @property {google.appengine.v1.IScriptHandler|null} [script] UrlMap script + * @property {google.appengine.v1.IApiEndpointHandler|null} [apiEndpoint] UrlMap apiEndpoint + * @property {google.appengine.v1.SecurityLevel|null} [securityLevel] UrlMap securityLevel + * @property {google.appengine.v1.LoginRequirement|null} [login] UrlMap login + * @property {google.appengine.v1.AuthFailAction|null} [authFailAction] UrlMap authFailAction + * @property {google.appengine.v1.UrlMap.RedirectHttpResponseCode|null} [redirectHttpResponseCode] UrlMap redirectHttpResponseCode + */ + + /** + * Constructs a new UrlMap. + * @memberof google.appengine.v1 + * @classdesc Represents an UrlMap. + * @implements IUrlMap + * @constructor + * @param {google.appengine.v1.IUrlMap=} [properties] Properties to set + */ + function UrlMap(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMap urlRegex. + * @member {string} urlRegex + * @memberof google.appengine.v1.UrlMap + * @instance + */ + UrlMap.prototype.urlRegex = ""; + + /** + * UrlMap staticFiles. + * @member {google.appengine.v1.IStaticFilesHandler|null|undefined} staticFiles + * @memberof google.appengine.v1.UrlMap + * @instance + */ + UrlMap.prototype.staticFiles = null; + + /** + * UrlMap script. + * @member {google.appengine.v1.IScriptHandler|null|undefined} script + * @memberof google.appengine.v1.UrlMap + * @instance + */ + UrlMap.prototype.script = null; + + /** + * UrlMap apiEndpoint. + * @member {google.appengine.v1.IApiEndpointHandler|null|undefined} apiEndpoint + * @memberof google.appengine.v1.UrlMap + * @instance + */ + UrlMap.prototype.apiEndpoint = null; + + /** + * UrlMap securityLevel. + * @member {google.appengine.v1.SecurityLevel} securityLevel + * @memberof google.appengine.v1.UrlMap + * @instance + */ + UrlMap.prototype.securityLevel = 0; + + /** + * UrlMap login. + * @member {google.appengine.v1.LoginRequirement} login + * @memberof google.appengine.v1.UrlMap + * @instance + */ + UrlMap.prototype.login = 0; + + /** + * UrlMap authFailAction. + * @member {google.appengine.v1.AuthFailAction} authFailAction + * @memberof google.appengine.v1.UrlMap + * @instance + */ + UrlMap.prototype.authFailAction = 0; + + /** + * UrlMap redirectHttpResponseCode. + * @member {google.appengine.v1.UrlMap.RedirectHttpResponseCode} redirectHttpResponseCode + * @memberof google.appengine.v1.UrlMap + * @instance + */ + UrlMap.prototype.redirectHttpResponseCode = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlMap handlerType. + * @member {"staticFiles"|"script"|"apiEndpoint"|undefined} handlerType + * @memberof google.appengine.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "handlerType", { + get: $util.oneOfGetter($oneOfFields = ["staticFiles", "script", "apiEndpoint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlMap instance using the specified properties. + * @function create + * @memberof google.appengine.v1.UrlMap + * @static + * @param {google.appengine.v1.IUrlMap=} [properties] Properties to set + * @returns {google.appengine.v1.UrlMap} UrlMap instance + */ + UrlMap.create = function create(properties) { + return new UrlMap(properties); + }; + + /** + * Encodes the specified UrlMap message. Does not implicitly {@link google.appengine.v1.UrlMap.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.UrlMap + * @static + * @param {google.appengine.v1.IUrlMap} message UrlMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMap.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.urlRegex != null && Object.hasOwnProperty.call(message, "urlRegex")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.urlRegex); + if (message.staticFiles != null && Object.hasOwnProperty.call(message, "staticFiles")) + $root.google.appengine.v1.StaticFilesHandler.encode(message.staticFiles, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + $root.google.appengine.v1.ScriptHandler.encode(message.script, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.apiEndpoint != null && Object.hasOwnProperty.call(message, "apiEndpoint")) + $root.google.appengine.v1.ApiEndpointHandler.encode(message.apiEndpoint, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.securityLevel != null && Object.hasOwnProperty.call(message, "securityLevel")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.securityLevel); + if (message.login != null && Object.hasOwnProperty.call(message, "login")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.login); + if (message.authFailAction != null && Object.hasOwnProperty.call(message, "authFailAction")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.authFailAction); + if (message.redirectHttpResponseCode != null && Object.hasOwnProperty.call(message, "redirectHttpResponseCode")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.redirectHttpResponseCode); + return writer; + }; + + /** + * Encodes the specified UrlMap message, length delimited. Does not implicitly {@link google.appengine.v1.UrlMap.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.UrlMap + * @static + * @param {google.appengine.v1.IUrlMap} message UrlMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMap message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.UrlMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.UrlMap} UrlMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMap.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.appengine.v1.UrlMap(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.urlRegex = reader.string(); + break; + } + case 2: { + message.staticFiles = $root.google.appengine.v1.StaticFilesHandler.decode(reader, reader.uint32()); + break; + } + case 3: { + message.script = $root.google.appengine.v1.ScriptHandler.decode(reader, reader.uint32()); + break; + } + case 4: { + message.apiEndpoint = $root.google.appengine.v1.ApiEndpointHandler.decode(reader, reader.uint32()); + break; + } + case 5: { + message.securityLevel = reader.int32(); + break; + } + case 6: { + message.login = reader.int32(); + break; + } + case 7: { + message.authFailAction = reader.int32(); + break; + } + case 8: { + message.redirectHttpResponseCode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.UrlMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.UrlMap} UrlMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMap message. + * @function verify + * @memberof google.appengine.v1.UrlMap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMap.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.urlRegex != null && message.hasOwnProperty("urlRegex")) + if (!$util.isString(message.urlRegex)) + return "urlRegex: string expected"; + if (message.staticFiles != null && message.hasOwnProperty("staticFiles")) { + properties.handlerType = 1; + { + var error = $root.google.appengine.v1.StaticFilesHandler.verify(message.staticFiles); + if (error) + return "staticFiles." + error; + } + } + if (message.script != null && message.hasOwnProperty("script")) { + if (properties.handlerType === 1) + return "handlerType: multiple values"; + properties.handlerType = 1; + { + var error = $root.google.appengine.v1.ScriptHandler.verify(message.script); + if (error) + return "script." + error; + } + } + if (message.apiEndpoint != null && message.hasOwnProperty("apiEndpoint")) { + if (properties.handlerType === 1) + return "handlerType: multiple values"; + properties.handlerType = 1; + { + var error = $root.google.appengine.v1.ApiEndpointHandler.verify(message.apiEndpoint); + if (error) + return "apiEndpoint." + error; + } + } + if (message.securityLevel != null && message.hasOwnProperty("securityLevel")) + switch (message.securityLevel) { + default: + return "securityLevel: enum value expected"; + case 0: + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.login != null && message.hasOwnProperty("login")) + switch (message.login) { + default: + return "login: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.authFailAction != null && message.hasOwnProperty("authFailAction")) + switch (message.authFailAction) { + default: + return "authFailAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.redirectHttpResponseCode != null && message.hasOwnProperty("redirectHttpResponseCode")) + switch (message.redirectHttpResponseCode) { + default: + return "redirectHttpResponseCode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates an UrlMap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.UrlMap + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.UrlMap} UrlMap + */ + UrlMap.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.UrlMap) + return object; + var message = new $root.google.appengine.v1.UrlMap(); + if (object.urlRegex != null) + message.urlRegex = String(object.urlRegex); + if (object.staticFiles != null) { + if (typeof object.staticFiles !== "object") + throw TypeError(".google.appengine.v1.UrlMap.staticFiles: object expected"); + message.staticFiles = $root.google.appengine.v1.StaticFilesHandler.fromObject(object.staticFiles); + } + if (object.script != null) { + if (typeof object.script !== "object") + throw TypeError(".google.appengine.v1.UrlMap.script: object expected"); + message.script = $root.google.appengine.v1.ScriptHandler.fromObject(object.script); + } + if (object.apiEndpoint != null) { + if (typeof object.apiEndpoint !== "object") + throw TypeError(".google.appengine.v1.UrlMap.apiEndpoint: object expected"); + message.apiEndpoint = $root.google.appengine.v1.ApiEndpointHandler.fromObject(object.apiEndpoint); + } + switch (object.securityLevel) { + default: + if (typeof object.securityLevel === "number") { + message.securityLevel = object.securityLevel; + break; + } + break; + case "SECURE_UNSPECIFIED": + case 0: + message.securityLevel = 0; + break; + case "SECURE_DEFAULT": + case 0: + message.securityLevel = 0; + break; + case "SECURE_NEVER": + case 1: + message.securityLevel = 1; + break; + case "SECURE_OPTIONAL": + case 2: + message.securityLevel = 2; + break; + case "SECURE_ALWAYS": + case 3: + message.securityLevel = 3; + break; + } + switch (object.login) { + default: + if (typeof object.login === "number") { + message.login = object.login; + break; + } + break; + case "LOGIN_UNSPECIFIED": + case 0: + message.login = 0; + break; + case "LOGIN_OPTIONAL": + case 1: + message.login = 1; + break; + case "LOGIN_ADMIN": + case 2: + message.login = 2; + break; + case "LOGIN_REQUIRED": + case 3: + message.login = 3; + break; + } + switch (object.authFailAction) { + default: + if (typeof object.authFailAction === "number") { + message.authFailAction = object.authFailAction; + break; + } + break; + case "AUTH_FAIL_ACTION_UNSPECIFIED": + case 0: + message.authFailAction = 0; + break; + case "AUTH_FAIL_ACTION_REDIRECT": + case 1: + message.authFailAction = 1; + break; + case "AUTH_FAIL_ACTION_UNAUTHORIZED": + case 2: + message.authFailAction = 2; + break; + } + switch (object.redirectHttpResponseCode) { + default: + if (typeof object.redirectHttpResponseCode === "number") { + message.redirectHttpResponseCode = object.redirectHttpResponseCode; + break; + } + break; + case "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED": + case 0: + message.redirectHttpResponseCode = 0; + break; + case "REDIRECT_HTTP_RESPONSE_CODE_301": + case 1: + message.redirectHttpResponseCode = 1; + break; + case "REDIRECT_HTTP_RESPONSE_CODE_302": + case 2: + message.redirectHttpResponseCode = 2; + break; + case "REDIRECT_HTTP_RESPONSE_CODE_303": + case 3: + message.redirectHttpResponseCode = 3; + break; + case "REDIRECT_HTTP_RESPONSE_CODE_307": + case 4: + message.redirectHttpResponseCode = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from an UrlMap message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.UrlMap + * @static + * @param {google.appengine.v1.UrlMap} message UrlMap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMap.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.urlRegex = ""; + object.securityLevel = options.enums === String ? "SECURE_UNSPECIFIED" : 0; + object.login = options.enums === String ? "LOGIN_UNSPECIFIED" : 0; + object.authFailAction = options.enums === String ? "AUTH_FAIL_ACTION_UNSPECIFIED" : 0; + object.redirectHttpResponseCode = options.enums === String ? "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED" : 0; + } + if (message.urlRegex != null && message.hasOwnProperty("urlRegex")) + object.urlRegex = message.urlRegex; + if (message.staticFiles != null && message.hasOwnProperty("staticFiles")) { + object.staticFiles = $root.google.appengine.v1.StaticFilesHandler.toObject(message.staticFiles, options); + if (options.oneofs) + object.handlerType = "staticFiles"; + } + if (message.script != null && message.hasOwnProperty("script")) { + object.script = $root.google.appengine.v1.ScriptHandler.toObject(message.script, options); + if (options.oneofs) + object.handlerType = "script"; + } + if (message.apiEndpoint != null && message.hasOwnProperty("apiEndpoint")) { + object.apiEndpoint = $root.google.appengine.v1.ApiEndpointHandler.toObject(message.apiEndpoint, options); + if (options.oneofs) + object.handlerType = "apiEndpoint"; + } + if (message.securityLevel != null && message.hasOwnProperty("securityLevel")) + object.securityLevel = options.enums === String ? $root.google.appengine.v1.SecurityLevel[message.securityLevel] === undefined ? message.securityLevel : $root.google.appengine.v1.SecurityLevel[message.securityLevel] : message.securityLevel; + if (message.login != null && message.hasOwnProperty("login")) + object.login = options.enums === String ? $root.google.appengine.v1.LoginRequirement[message.login] === undefined ? message.login : $root.google.appengine.v1.LoginRequirement[message.login] : message.login; + if (message.authFailAction != null && message.hasOwnProperty("authFailAction")) + object.authFailAction = options.enums === String ? $root.google.appengine.v1.AuthFailAction[message.authFailAction] === undefined ? message.authFailAction : $root.google.appengine.v1.AuthFailAction[message.authFailAction] : message.authFailAction; + if (message.redirectHttpResponseCode != null && message.hasOwnProperty("redirectHttpResponseCode")) + object.redirectHttpResponseCode = options.enums === String ? $root.google.appengine.v1.UrlMap.RedirectHttpResponseCode[message.redirectHttpResponseCode] === undefined ? message.redirectHttpResponseCode : $root.google.appengine.v1.UrlMap.RedirectHttpResponseCode[message.redirectHttpResponseCode] : message.redirectHttpResponseCode; + return object; + }; + + /** + * Converts this UrlMap to JSON. + * @function toJSON + * @memberof google.appengine.v1.UrlMap + * @instance + * @returns {Object.} JSON object + */ + UrlMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UrlMap + * @function getTypeUrl + * @memberof google.appengine.v1.UrlMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UrlMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.UrlMap"; + }; + + /** + * RedirectHttpResponseCode enum. + * @name google.appengine.v1.UrlMap.RedirectHttpResponseCode + * @enum {number} + * @property {number} REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED=0 REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED value + * @property {number} REDIRECT_HTTP_RESPONSE_CODE_301=1 REDIRECT_HTTP_RESPONSE_CODE_301 value + * @property {number} REDIRECT_HTTP_RESPONSE_CODE_302=2 REDIRECT_HTTP_RESPONSE_CODE_302 value + * @property {number} REDIRECT_HTTP_RESPONSE_CODE_303=3 REDIRECT_HTTP_RESPONSE_CODE_303 value + * @property {number} REDIRECT_HTTP_RESPONSE_CODE_307=4 REDIRECT_HTTP_RESPONSE_CODE_307 value + */ + UrlMap.RedirectHttpResponseCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REDIRECT_HTTP_RESPONSE_CODE_301"] = 1; + values[valuesById[2] = "REDIRECT_HTTP_RESPONSE_CODE_302"] = 2; + values[valuesById[3] = "REDIRECT_HTTP_RESPONSE_CODE_303"] = 3; + values[valuesById[4] = "REDIRECT_HTTP_RESPONSE_CODE_307"] = 4; + return values; + })(); + + return UrlMap; + })(); + + v1.StaticFilesHandler = (function() { + + /** + * Properties of a StaticFilesHandler. + * @memberof google.appengine.v1 + * @interface IStaticFilesHandler + * @property {string|null} [path] StaticFilesHandler path + * @property {string|null} [uploadPathRegex] StaticFilesHandler uploadPathRegex + * @property {Object.|null} [httpHeaders] StaticFilesHandler httpHeaders + * @property {string|null} [mimeType] StaticFilesHandler mimeType + * @property {google.protobuf.IDuration|null} [expiration] StaticFilesHandler expiration + * @property {boolean|null} [requireMatchingFile] StaticFilesHandler requireMatchingFile + * @property {boolean|null} [applicationReadable] StaticFilesHandler applicationReadable + */ + + /** + * Constructs a new StaticFilesHandler. + * @memberof google.appengine.v1 + * @classdesc Represents a StaticFilesHandler. + * @implements IStaticFilesHandler + * @constructor + * @param {google.appengine.v1.IStaticFilesHandler=} [properties] Properties to set + */ + function StaticFilesHandler(properties) { + this.httpHeaders = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StaticFilesHandler path. + * @member {string} path + * @memberof google.appengine.v1.StaticFilesHandler + * @instance + */ + StaticFilesHandler.prototype.path = ""; + + /** + * StaticFilesHandler uploadPathRegex. + * @member {string} uploadPathRegex + * @memberof google.appengine.v1.StaticFilesHandler + * @instance + */ + StaticFilesHandler.prototype.uploadPathRegex = ""; + + /** + * StaticFilesHandler httpHeaders. + * @member {Object.} httpHeaders + * @memberof google.appengine.v1.StaticFilesHandler + * @instance + */ + StaticFilesHandler.prototype.httpHeaders = $util.emptyObject; + + /** + * StaticFilesHandler mimeType. + * @member {string} mimeType + * @memberof google.appengine.v1.StaticFilesHandler + * @instance + */ + StaticFilesHandler.prototype.mimeType = ""; + + /** + * StaticFilesHandler expiration. + * @member {google.protobuf.IDuration|null|undefined} expiration + * @memberof google.appengine.v1.StaticFilesHandler + * @instance + */ + StaticFilesHandler.prototype.expiration = null; + + /** + * StaticFilesHandler requireMatchingFile. + * @member {boolean} requireMatchingFile + * @memberof google.appengine.v1.StaticFilesHandler + * @instance + */ + StaticFilesHandler.prototype.requireMatchingFile = false; + + /** + * StaticFilesHandler applicationReadable. + * @member {boolean} applicationReadable + * @memberof google.appengine.v1.StaticFilesHandler + * @instance + */ + StaticFilesHandler.prototype.applicationReadable = false; + + /** + * Creates a new StaticFilesHandler instance using the specified properties. + * @function create + * @memberof google.appengine.v1.StaticFilesHandler + * @static + * @param {google.appengine.v1.IStaticFilesHandler=} [properties] Properties to set + * @returns {google.appengine.v1.StaticFilesHandler} StaticFilesHandler instance + */ + StaticFilesHandler.create = function create(properties) { + return new StaticFilesHandler(properties); + }; + + /** + * Encodes the specified StaticFilesHandler message. Does not implicitly {@link google.appengine.v1.StaticFilesHandler.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.StaticFilesHandler + * @static + * @param {google.appengine.v1.IStaticFilesHandler} message StaticFilesHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticFilesHandler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.uploadPathRegex != null && Object.hasOwnProperty.call(message, "uploadPathRegex")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uploadPathRegex); + if (message.httpHeaders != null && Object.hasOwnProperty.call(message, "httpHeaders")) + for (var keys = Object.keys(message.httpHeaders), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.httpHeaders[keys[i]]).ldelim(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mimeType); + if (message.expiration != null && Object.hasOwnProperty.call(message, "expiration")) + $root.google.protobuf.Duration.encode(message.expiration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.requireMatchingFile != null && Object.hasOwnProperty.call(message, "requireMatchingFile")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requireMatchingFile); + if (message.applicationReadable != null && Object.hasOwnProperty.call(message, "applicationReadable")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.applicationReadable); + return writer; + }; + + /** + * Encodes the specified StaticFilesHandler message, length delimited. Does not implicitly {@link google.appengine.v1.StaticFilesHandler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.StaticFilesHandler + * @static + * @param {google.appengine.v1.IStaticFilesHandler} message StaticFilesHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticFilesHandler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StaticFilesHandler message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.StaticFilesHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.StaticFilesHandler} StaticFilesHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticFilesHandler.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.appengine.v1.StaticFilesHandler(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.uploadPathRegex = reader.string(); + break; + } + case 3: { + if (message.httpHeaders === $util.emptyObject) + message.httpHeaders = {}; + 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.httpHeaders[key] = value; + break; + } + case 4: { + message.mimeType = reader.string(); + break; + } + case 5: { + message.expiration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.requireMatchingFile = reader.bool(); + break; + } + case 7: { + message.applicationReadable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StaticFilesHandler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.StaticFilesHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.StaticFilesHandler} StaticFilesHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticFilesHandler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StaticFilesHandler message. + * @function verify + * @memberof google.appengine.v1.StaticFilesHandler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StaticFilesHandler.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.uploadPathRegex != null && message.hasOwnProperty("uploadPathRegex")) + if (!$util.isString(message.uploadPathRegex)) + return "uploadPathRegex: string expected"; + if (message.httpHeaders != null && message.hasOwnProperty("httpHeaders")) { + if (!$util.isObject(message.httpHeaders)) + return "httpHeaders: object expected"; + var key = Object.keys(message.httpHeaders); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.httpHeaders[key[i]])) + return "httpHeaders: string{k:string} expected"; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.expiration != null && message.hasOwnProperty("expiration")) { + var error = $root.google.protobuf.Duration.verify(message.expiration); + if (error) + return "expiration." + error; + } + if (message.requireMatchingFile != null && message.hasOwnProperty("requireMatchingFile")) + if (typeof message.requireMatchingFile !== "boolean") + return "requireMatchingFile: boolean expected"; + if (message.applicationReadable != null && message.hasOwnProperty("applicationReadable")) + if (typeof message.applicationReadable !== "boolean") + return "applicationReadable: boolean expected"; + return null; + }; + + /** + * Creates a StaticFilesHandler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.StaticFilesHandler + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.StaticFilesHandler} StaticFilesHandler + */ + StaticFilesHandler.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.StaticFilesHandler) + return object; + var message = new $root.google.appengine.v1.StaticFilesHandler(); + if (object.path != null) + message.path = String(object.path); + if (object.uploadPathRegex != null) + message.uploadPathRegex = String(object.uploadPathRegex); + if (object.httpHeaders) { + if (typeof object.httpHeaders !== "object") + throw TypeError(".google.appengine.v1.StaticFilesHandler.httpHeaders: object expected"); + message.httpHeaders = {}; + for (var keys = Object.keys(object.httpHeaders), i = 0; i < keys.length; ++i) + message.httpHeaders[keys[i]] = String(object.httpHeaders[keys[i]]); + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.expiration != null) { + if (typeof object.expiration !== "object") + throw TypeError(".google.appengine.v1.StaticFilesHandler.expiration: object expected"); + message.expiration = $root.google.protobuf.Duration.fromObject(object.expiration); + } + if (object.requireMatchingFile != null) + message.requireMatchingFile = Boolean(object.requireMatchingFile); + if (object.applicationReadable != null) + message.applicationReadable = Boolean(object.applicationReadable); + return message; + }; + + /** + * Creates a plain object from a StaticFilesHandler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.StaticFilesHandler + * @static + * @param {google.appengine.v1.StaticFilesHandler} message StaticFilesHandler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StaticFilesHandler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.httpHeaders = {}; + if (options.defaults) { + object.path = ""; + object.uploadPathRegex = ""; + object.mimeType = ""; + object.expiration = null; + object.requireMatchingFile = false; + object.applicationReadable = false; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.uploadPathRegex != null && message.hasOwnProperty("uploadPathRegex")) + object.uploadPathRegex = message.uploadPathRegex; + var keys2; + if (message.httpHeaders && (keys2 = Object.keys(message.httpHeaders)).length) { + object.httpHeaders = {}; + for (var j = 0; j < keys2.length; ++j) + object.httpHeaders[keys2[j]] = message.httpHeaders[keys2[j]]; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.expiration != null && message.hasOwnProperty("expiration")) + object.expiration = $root.google.protobuf.Duration.toObject(message.expiration, options); + if (message.requireMatchingFile != null && message.hasOwnProperty("requireMatchingFile")) + object.requireMatchingFile = message.requireMatchingFile; + if (message.applicationReadable != null && message.hasOwnProperty("applicationReadable")) + object.applicationReadable = message.applicationReadable; + return object; + }; + + /** + * Converts this StaticFilesHandler to JSON. + * @function toJSON + * @memberof google.appengine.v1.StaticFilesHandler + * @instance + * @returns {Object.} JSON object + */ + StaticFilesHandler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StaticFilesHandler + * @function getTypeUrl + * @memberof google.appengine.v1.StaticFilesHandler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StaticFilesHandler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.StaticFilesHandler"; + }; + + return StaticFilesHandler; + })(); + + v1.ScriptHandler = (function() { + + /** + * Properties of a ScriptHandler. + * @memberof google.appengine.v1 + * @interface IScriptHandler + * @property {string|null} [scriptPath] ScriptHandler scriptPath + */ + + /** + * Constructs a new ScriptHandler. + * @memberof google.appengine.v1 + * @classdesc Represents a ScriptHandler. + * @implements IScriptHandler + * @constructor + * @param {google.appengine.v1.IScriptHandler=} [properties] Properties to set + */ + function ScriptHandler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScriptHandler scriptPath. + * @member {string} scriptPath + * @memberof google.appengine.v1.ScriptHandler + * @instance + */ + ScriptHandler.prototype.scriptPath = ""; + + /** + * Creates a new ScriptHandler instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ScriptHandler + * @static + * @param {google.appengine.v1.IScriptHandler=} [properties] Properties to set + * @returns {google.appengine.v1.ScriptHandler} ScriptHandler instance + */ + ScriptHandler.create = function create(properties) { + return new ScriptHandler(properties); + }; + + /** + * Encodes the specified ScriptHandler message. Does not implicitly {@link google.appengine.v1.ScriptHandler.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ScriptHandler + * @static + * @param {google.appengine.v1.IScriptHandler} message ScriptHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScriptHandler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scriptPath != null && Object.hasOwnProperty.call(message, "scriptPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scriptPath); + return writer; + }; + + /** + * Encodes the specified ScriptHandler message, length delimited. Does not implicitly {@link google.appengine.v1.ScriptHandler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ScriptHandler + * @static + * @param {google.appengine.v1.IScriptHandler} message ScriptHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScriptHandler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScriptHandler message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ScriptHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ScriptHandler} ScriptHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScriptHandler.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.appengine.v1.ScriptHandler(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scriptPath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScriptHandler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ScriptHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ScriptHandler} ScriptHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScriptHandler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScriptHandler message. + * @function verify + * @memberof google.appengine.v1.ScriptHandler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScriptHandler.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scriptPath != null && message.hasOwnProperty("scriptPath")) + if (!$util.isString(message.scriptPath)) + return "scriptPath: string expected"; + return null; + }; + + /** + * Creates a ScriptHandler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ScriptHandler + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ScriptHandler} ScriptHandler + */ + ScriptHandler.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ScriptHandler) + return object; + var message = new $root.google.appengine.v1.ScriptHandler(); + if (object.scriptPath != null) + message.scriptPath = String(object.scriptPath); + return message; + }; + + /** + * Creates a plain object from a ScriptHandler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ScriptHandler + * @static + * @param {google.appengine.v1.ScriptHandler} message ScriptHandler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScriptHandler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.scriptPath = ""; + if (message.scriptPath != null && message.hasOwnProperty("scriptPath")) + object.scriptPath = message.scriptPath; + return object; + }; + + /** + * Converts this ScriptHandler to JSON. + * @function toJSON + * @memberof google.appengine.v1.ScriptHandler + * @instance + * @returns {Object.} JSON object + */ + ScriptHandler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScriptHandler + * @function getTypeUrl + * @memberof google.appengine.v1.ScriptHandler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScriptHandler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ScriptHandler"; + }; + + return ScriptHandler; + })(); + + v1.ApiEndpointHandler = (function() { + + /** + * Properties of an ApiEndpointHandler. + * @memberof google.appengine.v1 + * @interface IApiEndpointHandler + * @property {string|null} [scriptPath] ApiEndpointHandler scriptPath + */ + + /** + * Constructs a new ApiEndpointHandler. + * @memberof google.appengine.v1 + * @classdesc Represents an ApiEndpointHandler. + * @implements IApiEndpointHandler + * @constructor + * @param {google.appengine.v1.IApiEndpointHandler=} [properties] Properties to set + */ + function ApiEndpointHandler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiEndpointHandler scriptPath. + * @member {string} scriptPath + * @memberof google.appengine.v1.ApiEndpointHandler + * @instance + */ + ApiEndpointHandler.prototype.scriptPath = ""; + + /** + * Creates a new ApiEndpointHandler instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ApiEndpointHandler + * @static + * @param {google.appengine.v1.IApiEndpointHandler=} [properties] Properties to set + * @returns {google.appengine.v1.ApiEndpointHandler} ApiEndpointHandler instance + */ + ApiEndpointHandler.create = function create(properties) { + return new ApiEndpointHandler(properties); + }; + + /** + * Encodes the specified ApiEndpointHandler message. Does not implicitly {@link google.appengine.v1.ApiEndpointHandler.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ApiEndpointHandler + * @static + * @param {google.appengine.v1.IApiEndpointHandler} message ApiEndpointHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiEndpointHandler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scriptPath != null && Object.hasOwnProperty.call(message, "scriptPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scriptPath); + return writer; + }; + + /** + * Encodes the specified ApiEndpointHandler message, length delimited. Does not implicitly {@link google.appengine.v1.ApiEndpointHandler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ApiEndpointHandler + * @static + * @param {google.appengine.v1.IApiEndpointHandler} message ApiEndpointHandler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiEndpointHandler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiEndpointHandler message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ApiEndpointHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ApiEndpointHandler} ApiEndpointHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiEndpointHandler.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.appengine.v1.ApiEndpointHandler(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scriptPath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiEndpointHandler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ApiEndpointHandler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ApiEndpointHandler} ApiEndpointHandler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiEndpointHandler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiEndpointHandler message. + * @function verify + * @memberof google.appengine.v1.ApiEndpointHandler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiEndpointHandler.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scriptPath != null && message.hasOwnProperty("scriptPath")) + if (!$util.isString(message.scriptPath)) + return "scriptPath: string expected"; + return null; + }; + + /** + * Creates an ApiEndpointHandler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ApiEndpointHandler + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ApiEndpointHandler} ApiEndpointHandler + */ + ApiEndpointHandler.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ApiEndpointHandler) + return object; + var message = new $root.google.appengine.v1.ApiEndpointHandler(); + if (object.scriptPath != null) + message.scriptPath = String(object.scriptPath); + return message; + }; + + /** + * Creates a plain object from an ApiEndpointHandler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ApiEndpointHandler + * @static + * @param {google.appengine.v1.ApiEndpointHandler} message ApiEndpointHandler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiEndpointHandler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.scriptPath = ""; + if (message.scriptPath != null && message.hasOwnProperty("scriptPath")) + object.scriptPath = message.scriptPath; + return object; + }; + + /** + * Converts this ApiEndpointHandler to JSON. + * @function toJSON + * @memberof google.appengine.v1.ApiEndpointHandler + * @instance + * @returns {Object.} JSON object + */ + ApiEndpointHandler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiEndpointHandler + * @function getTypeUrl + * @memberof google.appengine.v1.ApiEndpointHandler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiEndpointHandler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ApiEndpointHandler"; + }; + + return ApiEndpointHandler; + })(); + + v1.HealthCheck = (function() { + + /** + * Properties of a HealthCheck. + * @memberof google.appengine.v1 + * @interface IHealthCheck + * @property {boolean|null} [disableHealthCheck] HealthCheck disableHealthCheck + * @property {string|null} [host] HealthCheck host + * @property {number|null} [healthyThreshold] HealthCheck healthyThreshold + * @property {number|null} [unhealthyThreshold] HealthCheck unhealthyThreshold + * @property {number|null} [restartThreshold] HealthCheck restartThreshold + * @property {google.protobuf.IDuration|null} [checkInterval] HealthCheck checkInterval + * @property {google.protobuf.IDuration|null} [timeout] HealthCheck timeout + */ + + /** + * Constructs a new HealthCheck. + * @memberof google.appengine.v1 + * @classdesc Represents a HealthCheck. + * @implements IHealthCheck + * @constructor + * @param {google.appengine.v1.IHealthCheck=} [properties] Properties to set + */ + function HealthCheck(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthCheck disableHealthCheck. + * @member {boolean} disableHealthCheck + * @memberof google.appengine.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.disableHealthCheck = false; + + /** + * HealthCheck host. + * @member {string} host + * @memberof google.appengine.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.host = ""; + + /** + * HealthCheck healthyThreshold. + * @member {number} healthyThreshold + * @memberof google.appengine.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.healthyThreshold = 0; + + /** + * HealthCheck unhealthyThreshold. + * @member {number} unhealthyThreshold + * @memberof google.appengine.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.unhealthyThreshold = 0; + + /** + * HealthCheck restartThreshold. + * @member {number} restartThreshold + * @memberof google.appengine.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.restartThreshold = 0; + + /** + * HealthCheck checkInterval. + * @member {google.protobuf.IDuration|null|undefined} checkInterval + * @memberof google.appengine.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.checkInterval = null; + + /** + * HealthCheck timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.appengine.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.timeout = null; + + /** + * Creates a new HealthCheck instance using the specified properties. + * @function create + * @memberof google.appengine.v1.HealthCheck + * @static + * @param {google.appengine.v1.IHealthCheck=} [properties] Properties to set + * @returns {google.appengine.v1.HealthCheck} HealthCheck instance + */ + HealthCheck.create = function create(properties) { + return new HealthCheck(properties); + }; + + /** + * Encodes the specified HealthCheck message. Does not implicitly {@link google.appengine.v1.HealthCheck.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.HealthCheck + * @static + * @param {google.appengine.v1.IHealthCheck} message HealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disableHealthCheck != null && Object.hasOwnProperty.call(message, "disableHealthCheck")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableHealthCheck); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.host); + if (message.healthyThreshold != null && Object.hasOwnProperty.call(message, "healthyThreshold")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.healthyThreshold); + if (message.unhealthyThreshold != null && Object.hasOwnProperty.call(message, "unhealthyThreshold")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.unhealthyThreshold); + if (message.restartThreshold != null && Object.hasOwnProperty.call(message, "restartThreshold")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.restartThreshold); + if (message.checkInterval != null && Object.hasOwnProperty.call(message, "checkInterval")) + $root.google.protobuf.Duration.encode(message.checkInterval, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HealthCheck message, length delimited. Does not implicitly {@link google.appengine.v1.HealthCheck.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.HealthCheck + * @static + * @param {google.appengine.v1.IHealthCheck} message HealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthCheck message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.HealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.HealthCheck} HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheck.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.appengine.v1.HealthCheck(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.disableHealthCheck = reader.bool(); + break; + } + case 2: { + message.host = reader.string(); + break; + } + case 3: { + message.healthyThreshold = reader.uint32(); + break; + } + case 4: { + message.unhealthyThreshold = reader.uint32(); + break; + } + case 5: { + message.restartThreshold = reader.uint32(); + break; + } + case 6: { + message.checkInterval = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthCheck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.HealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.HealthCheck} HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthCheck message. + * @function verify + * @memberof google.appengine.v1.HealthCheck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthCheck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disableHealthCheck != null && message.hasOwnProperty("disableHealthCheck")) + if (typeof message.disableHealthCheck !== "boolean") + return "disableHealthCheck: boolean expected"; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.healthyThreshold != null && message.hasOwnProperty("healthyThreshold")) + if (!$util.isInteger(message.healthyThreshold)) + return "healthyThreshold: integer expected"; + if (message.unhealthyThreshold != null && message.hasOwnProperty("unhealthyThreshold")) + if (!$util.isInteger(message.unhealthyThreshold)) + return "unhealthyThreshold: integer expected"; + if (message.restartThreshold != null && message.hasOwnProperty("restartThreshold")) + if (!$util.isInteger(message.restartThreshold)) + return "restartThreshold: integer expected"; + if (message.checkInterval != null && message.hasOwnProperty("checkInterval")) { + var error = $root.google.protobuf.Duration.verify(message.checkInterval); + if (error) + return "checkInterval." + error; + } + 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 HealthCheck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.HealthCheck + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.HealthCheck} HealthCheck + */ + HealthCheck.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.HealthCheck) + return object; + var message = new $root.google.appengine.v1.HealthCheck(); + if (object.disableHealthCheck != null) + message.disableHealthCheck = Boolean(object.disableHealthCheck); + if (object.host != null) + message.host = String(object.host); + if (object.healthyThreshold != null) + message.healthyThreshold = object.healthyThreshold >>> 0; + if (object.unhealthyThreshold != null) + message.unhealthyThreshold = object.unhealthyThreshold >>> 0; + if (object.restartThreshold != null) + message.restartThreshold = object.restartThreshold >>> 0; + if (object.checkInterval != null) { + if (typeof object.checkInterval !== "object") + throw TypeError(".google.appengine.v1.HealthCheck.checkInterval: object expected"); + message.checkInterval = $root.google.protobuf.Duration.fromObject(object.checkInterval); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.appengine.v1.HealthCheck.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a HealthCheck message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.HealthCheck + * @static + * @param {google.appengine.v1.HealthCheck} message HealthCheck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthCheck.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disableHealthCheck = false; + object.host = ""; + object.healthyThreshold = 0; + object.unhealthyThreshold = 0; + object.restartThreshold = 0; + object.checkInterval = null; + object.timeout = null; + } + if (message.disableHealthCheck != null && message.hasOwnProperty("disableHealthCheck")) + object.disableHealthCheck = message.disableHealthCheck; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.healthyThreshold != null && message.hasOwnProperty("healthyThreshold")) + object.healthyThreshold = message.healthyThreshold; + if (message.unhealthyThreshold != null && message.hasOwnProperty("unhealthyThreshold")) + object.unhealthyThreshold = message.unhealthyThreshold; + if (message.restartThreshold != null && message.hasOwnProperty("restartThreshold")) + object.restartThreshold = message.restartThreshold; + if (message.checkInterval != null && message.hasOwnProperty("checkInterval")) + object.checkInterval = $root.google.protobuf.Duration.toObject(message.checkInterval, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this HealthCheck to JSON. + * @function toJSON + * @memberof google.appengine.v1.HealthCheck + * @instance + * @returns {Object.} JSON object + */ + HealthCheck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HealthCheck + * @function getTypeUrl + * @memberof google.appengine.v1.HealthCheck + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HealthCheck.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.HealthCheck"; + }; + + return HealthCheck; + })(); + + v1.ReadinessCheck = (function() { + + /** + * Properties of a ReadinessCheck. + * @memberof google.appengine.v1 + * @interface IReadinessCheck + * @property {string|null} [path] ReadinessCheck path + * @property {string|null} [host] ReadinessCheck host + * @property {number|null} [failureThreshold] ReadinessCheck failureThreshold + * @property {number|null} [successThreshold] ReadinessCheck successThreshold + * @property {google.protobuf.IDuration|null} [checkInterval] ReadinessCheck checkInterval + * @property {google.protobuf.IDuration|null} [timeout] ReadinessCheck timeout + * @property {google.protobuf.IDuration|null} [appStartTimeout] ReadinessCheck appStartTimeout + */ + + /** + * Constructs a new ReadinessCheck. + * @memberof google.appengine.v1 + * @classdesc Represents a ReadinessCheck. + * @implements IReadinessCheck + * @constructor + * @param {google.appengine.v1.IReadinessCheck=} [properties] Properties to set + */ + function ReadinessCheck(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadinessCheck path. + * @member {string} path + * @memberof google.appengine.v1.ReadinessCheck + * @instance + */ + ReadinessCheck.prototype.path = ""; + + /** + * ReadinessCheck host. + * @member {string} host + * @memberof google.appengine.v1.ReadinessCheck + * @instance + */ + ReadinessCheck.prototype.host = ""; + + /** + * ReadinessCheck failureThreshold. + * @member {number} failureThreshold + * @memberof google.appengine.v1.ReadinessCheck + * @instance + */ + ReadinessCheck.prototype.failureThreshold = 0; + + /** + * ReadinessCheck successThreshold. + * @member {number} successThreshold + * @memberof google.appengine.v1.ReadinessCheck + * @instance + */ + ReadinessCheck.prototype.successThreshold = 0; + + /** + * ReadinessCheck checkInterval. + * @member {google.protobuf.IDuration|null|undefined} checkInterval + * @memberof google.appengine.v1.ReadinessCheck + * @instance + */ + ReadinessCheck.prototype.checkInterval = null; + + /** + * ReadinessCheck timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.appengine.v1.ReadinessCheck + * @instance + */ + ReadinessCheck.prototype.timeout = null; + + /** + * ReadinessCheck appStartTimeout. + * @member {google.protobuf.IDuration|null|undefined} appStartTimeout + * @memberof google.appengine.v1.ReadinessCheck + * @instance + */ + ReadinessCheck.prototype.appStartTimeout = null; + + /** + * Creates a new ReadinessCheck instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ReadinessCheck + * @static + * @param {google.appengine.v1.IReadinessCheck=} [properties] Properties to set + * @returns {google.appengine.v1.ReadinessCheck} ReadinessCheck instance + */ + ReadinessCheck.create = function create(properties) { + return new ReadinessCheck(properties); + }; + + /** + * Encodes the specified ReadinessCheck message. Does not implicitly {@link google.appengine.v1.ReadinessCheck.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ReadinessCheck + * @static + * @param {google.appengine.v1.IReadinessCheck} message ReadinessCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadinessCheck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.host); + if (message.failureThreshold != null && Object.hasOwnProperty.call(message, "failureThreshold")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.failureThreshold); + if (message.successThreshold != null && Object.hasOwnProperty.call(message, "successThreshold")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.successThreshold); + if (message.checkInterval != null && Object.hasOwnProperty.call(message, "checkInterval")) + $root.google.protobuf.Duration.encode(message.checkInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.appStartTimeout != null && Object.hasOwnProperty.call(message, "appStartTimeout")) + $root.google.protobuf.Duration.encode(message.appStartTimeout, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadinessCheck message, length delimited. Does not implicitly {@link google.appengine.v1.ReadinessCheck.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ReadinessCheck + * @static + * @param {google.appengine.v1.IReadinessCheck} message ReadinessCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadinessCheck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadinessCheck message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ReadinessCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ReadinessCheck} ReadinessCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadinessCheck.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.appengine.v1.ReadinessCheck(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.host = reader.string(); + break; + } + case 3: { + message.failureThreshold = reader.uint32(); + break; + } + case 4: { + message.successThreshold = reader.uint32(); + break; + } + case 5: { + message.checkInterval = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.appStartTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadinessCheck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ReadinessCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ReadinessCheck} ReadinessCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadinessCheck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadinessCheck message. + * @function verify + * @memberof google.appengine.v1.ReadinessCheck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadinessCheck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) + if (!$util.isInteger(message.failureThreshold)) + return "failureThreshold: integer expected"; + if (message.successThreshold != null && message.hasOwnProperty("successThreshold")) + if (!$util.isInteger(message.successThreshold)) + return "successThreshold: integer expected"; + if (message.checkInterval != null && message.hasOwnProperty("checkInterval")) { + var error = $root.google.protobuf.Duration.verify(message.checkInterval); + if (error) + return "checkInterval." + error; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.appStartTimeout != null && message.hasOwnProperty("appStartTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.appStartTimeout); + if (error) + return "appStartTimeout." + error; + } + return null; + }; + + /** + * Creates a ReadinessCheck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ReadinessCheck + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ReadinessCheck} ReadinessCheck + */ + ReadinessCheck.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ReadinessCheck) + return object; + var message = new $root.google.appengine.v1.ReadinessCheck(); + if (object.path != null) + message.path = String(object.path); + if (object.host != null) + message.host = String(object.host); + if (object.failureThreshold != null) + message.failureThreshold = object.failureThreshold >>> 0; + if (object.successThreshold != null) + message.successThreshold = object.successThreshold >>> 0; + if (object.checkInterval != null) { + if (typeof object.checkInterval !== "object") + throw TypeError(".google.appengine.v1.ReadinessCheck.checkInterval: object expected"); + message.checkInterval = $root.google.protobuf.Duration.fromObject(object.checkInterval); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.appengine.v1.ReadinessCheck.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.appStartTimeout != null) { + if (typeof object.appStartTimeout !== "object") + throw TypeError(".google.appengine.v1.ReadinessCheck.appStartTimeout: object expected"); + message.appStartTimeout = $root.google.protobuf.Duration.fromObject(object.appStartTimeout); + } + return message; + }; + + /** + * Creates a plain object from a ReadinessCheck message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ReadinessCheck + * @static + * @param {google.appengine.v1.ReadinessCheck} message ReadinessCheck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadinessCheck.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.path = ""; + object.host = ""; + object.failureThreshold = 0; + object.successThreshold = 0; + object.checkInterval = null; + object.timeout = null; + object.appStartTimeout = null; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) + object.failureThreshold = message.failureThreshold; + if (message.successThreshold != null && message.hasOwnProperty("successThreshold")) + object.successThreshold = message.successThreshold; + if (message.checkInterval != null && message.hasOwnProperty("checkInterval")) + object.checkInterval = $root.google.protobuf.Duration.toObject(message.checkInterval, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.appStartTimeout != null && message.hasOwnProperty("appStartTimeout")) + object.appStartTimeout = $root.google.protobuf.Duration.toObject(message.appStartTimeout, options); + return object; + }; + + /** + * Converts this ReadinessCheck to JSON. + * @function toJSON + * @memberof google.appengine.v1.ReadinessCheck + * @instance + * @returns {Object.} JSON object + */ + ReadinessCheck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadinessCheck + * @function getTypeUrl + * @memberof google.appengine.v1.ReadinessCheck + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadinessCheck.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ReadinessCheck"; + }; + + return ReadinessCheck; + })(); + + v1.LivenessCheck = (function() { + + /** + * Properties of a LivenessCheck. + * @memberof google.appengine.v1 + * @interface ILivenessCheck + * @property {string|null} [path] LivenessCheck path + * @property {string|null} [host] LivenessCheck host + * @property {number|null} [failureThreshold] LivenessCheck failureThreshold + * @property {number|null} [successThreshold] LivenessCheck successThreshold + * @property {google.protobuf.IDuration|null} [checkInterval] LivenessCheck checkInterval + * @property {google.protobuf.IDuration|null} [timeout] LivenessCheck timeout + * @property {google.protobuf.IDuration|null} [initialDelay] LivenessCheck initialDelay + */ + + /** + * Constructs a new LivenessCheck. + * @memberof google.appengine.v1 + * @classdesc Represents a LivenessCheck. + * @implements ILivenessCheck + * @constructor + * @param {google.appengine.v1.ILivenessCheck=} [properties] Properties to set + */ + function LivenessCheck(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LivenessCheck path. + * @member {string} path + * @memberof google.appengine.v1.LivenessCheck + * @instance + */ + LivenessCheck.prototype.path = ""; + + /** + * LivenessCheck host. + * @member {string} host + * @memberof google.appengine.v1.LivenessCheck + * @instance + */ + LivenessCheck.prototype.host = ""; + + /** + * LivenessCheck failureThreshold. + * @member {number} failureThreshold + * @memberof google.appengine.v1.LivenessCheck + * @instance + */ + LivenessCheck.prototype.failureThreshold = 0; + + /** + * LivenessCheck successThreshold. + * @member {number} successThreshold + * @memberof google.appengine.v1.LivenessCheck + * @instance + */ + LivenessCheck.prototype.successThreshold = 0; + + /** + * LivenessCheck checkInterval. + * @member {google.protobuf.IDuration|null|undefined} checkInterval + * @memberof google.appengine.v1.LivenessCheck + * @instance + */ + LivenessCheck.prototype.checkInterval = null; + + /** + * LivenessCheck timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.appengine.v1.LivenessCheck + * @instance + */ + LivenessCheck.prototype.timeout = null; + + /** + * LivenessCheck initialDelay. + * @member {google.protobuf.IDuration|null|undefined} initialDelay + * @memberof google.appengine.v1.LivenessCheck + * @instance + */ + LivenessCheck.prototype.initialDelay = null; + + /** + * Creates a new LivenessCheck instance using the specified properties. + * @function create + * @memberof google.appengine.v1.LivenessCheck + * @static + * @param {google.appengine.v1.ILivenessCheck=} [properties] Properties to set + * @returns {google.appengine.v1.LivenessCheck} LivenessCheck instance + */ + LivenessCheck.create = function create(properties) { + return new LivenessCheck(properties); + }; + + /** + * Encodes the specified LivenessCheck message. Does not implicitly {@link google.appengine.v1.LivenessCheck.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.LivenessCheck + * @static + * @param {google.appengine.v1.ILivenessCheck} message LivenessCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LivenessCheck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.host); + if (message.failureThreshold != null && Object.hasOwnProperty.call(message, "failureThreshold")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.failureThreshold); + if (message.successThreshold != null && Object.hasOwnProperty.call(message, "successThreshold")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.successThreshold); + if (message.checkInterval != null && Object.hasOwnProperty.call(message, "checkInterval")) + $root.google.protobuf.Duration.encode(message.checkInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.initialDelay != null && Object.hasOwnProperty.call(message, "initialDelay")) + $root.google.protobuf.Duration.encode(message.initialDelay, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LivenessCheck message, length delimited. Does not implicitly {@link google.appengine.v1.LivenessCheck.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.LivenessCheck + * @static + * @param {google.appengine.v1.ILivenessCheck} message LivenessCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LivenessCheck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LivenessCheck message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.LivenessCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.LivenessCheck} LivenessCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LivenessCheck.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.appengine.v1.LivenessCheck(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.host = reader.string(); + break; + } + case 3: { + message.failureThreshold = reader.uint32(); + break; + } + case 4: { + message.successThreshold = reader.uint32(); + break; + } + case 5: { + message.checkInterval = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.initialDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LivenessCheck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.LivenessCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.LivenessCheck} LivenessCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LivenessCheck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LivenessCheck message. + * @function verify + * @memberof google.appengine.v1.LivenessCheck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LivenessCheck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) + if (!$util.isInteger(message.failureThreshold)) + return "failureThreshold: integer expected"; + if (message.successThreshold != null && message.hasOwnProperty("successThreshold")) + if (!$util.isInteger(message.successThreshold)) + return "successThreshold: integer expected"; + if (message.checkInterval != null && message.hasOwnProperty("checkInterval")) { + var error = $root.google.protobuf.Duration.verify(message.checkInterval); + if (error) + return "checkInterval." + error; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.initialDelay != null && message.hasOwnProperty("initialDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialDelay); + if (error) + return "initialDelay." + error; + } + return null; + }; + + /** + * Creates a LivenessCheck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.LivenessCheck + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.LivenessCheck} LivenessCheck + */ + LivenessCheck.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.LivenessCheck) + return object; + var message = new $root.google.appengine.v1.LivenessCheck(); + if (object.path != null) + message.path = String(object.path); + if (object.host != null) + message.host = String(object.host); + if (object.failureThreshold != null) + message.failureThreshold = object.failureThreshold >>> 0; + if (object.successThreshold != null) + message.successThreshold = object.successThreshold >>> 0; + if (object.checkInterval != null) { + if (typeof object.checkInterval !== "object") + throw TypeError(".google.appengine.v1.LivenessCheck.checkInterval: object expected"); + message.checkInterval = $root.google.protobuf.Duration.fromObject(object.checkInterval); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.appengine.v1.LivenessCheck.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.initialDelay != null) { + if (typeof object.initialDelay !== "object") + throw TypeError(".google.appengine.v1.LivenessCheck.initialDelay: object expected"); + message.initialDelay = $root.google.protobuf.Duration.fromObject(object.initialDelay); + } + return message; + }; + + /** + * Creates a plain object from a LivenessCheck message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.LivenessCheck + * @static + * @param {google.appengine.v1.LivenessCheck} message LivenessCheck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LivenessCheck.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.path = ""; + object.host = ""; + object.failureThreshold = 0; + object.successThreshold = 0; + object.checkInterval = null; + object.timeout = null; + object.initialDelay = null; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) + object.failureThreshold = message.failureThreshold; + if (message.successThreshold != null && message.hasOwnProperty("successThreshold")) + object.successThreshold = message.successThreshold; + if (message.checkInterval != null && message.hasOwnProperty("checkInterval")) + object.checkInterval = $root.google.protobuf.Duration.toObject(message.checkInterval, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.initialDelay != null && message.hasOwnProperty("initialDelay")) + object.initialDelay = $root.google.protobuf.Duration.toObject(message.initialDelay, options); + return object; + }; + + /** + * Converts this LivenessCheck to JSON. + * @function toJSON + * @memberof google.appengine.v1.LivenessCheck + * @instance + * @returns {Object.} JSON object + */ + LivenessCheck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LivenessCheck + * @function getTypeUrl + * @memberof google.appengine.v1.LivenessCheck + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LivenessCheck.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.LivenessCheck"; + }; + + return LivenessCheck; + })(); + + v1.Library = (function() { + + /** + * Properties of a Library. + * @memberof google.appengine.v1 + * @interface ILibrary + * @property {string|null} [name] Library name + * @property {string|null} [version] Library version + */ + + /** + * Constructs a new Library. + * @memberof google.appengine.v1 + * @classdesc Represents a Library. + * @implements ILibrary + * @constructor + * @param {google.appengine.v1.ILibrary=} [properties] Properties to set + */ + function Library(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Library name. + * @member {string} name + * @memberof google.appengine.v1.Library + * @instance + */ + Library.prototype.name = ""; + + /** + * Library version. + * @member {string} version + * @memberof google.appengine.v1.Library + * @instance + */ + Library.prototype.version = ""; + + /** + * Creates a new Library instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Library + * @static + * @param {google.appengine.v1.ILibrary=} [properties] Properties to set + * @returns {google.appengine.v1.Library} Library instance + */ + Library.create = function create(properties) { + return new Library(properties); + }; + + /** + * Encodes the specified Library message. Does not implicitly {@link google.appengine.v1.Library.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Library + * @static + * @param {google.appengine.v1.ILibrary} message Library message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Library.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified Library message, length delimited. Does not implicitly {@link google.appengine.v1.Library.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Library + * @static + * @param {google.appengine.v1.ILibrary} message Library message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Library.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Library message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Library + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Library} Library + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Library.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.appengine.v1.Library(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Library message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Library + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Library} Library + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Library.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Library message. + * @function verify + * @memberof google.appengine.v1.Library + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Library.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a Library message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Library + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Library} Library + */ + Library.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Library) + return object; + var message = new $root.google.appengine.v1.Library(); + if (object.name != null) + message.name = String(object.name); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a Library message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Library + * @static + * @param {google.appengine.v1.Library} message Library + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Library.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.version = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this Library to JSON. + * @function toJSON + * @memberof google.appengine.v1.Library + * @instance + * @returns {Object.} JSON object + */ + Library.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Library + * @function getTypeUrl + * @memberof google.appengine.v1.Library + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Library.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Library"; + }; + + return Library; + })(); + + /** + * AuthFailAction enum. + * @name google.appengine.v1.AuthFailAction + * @enum {number} + * @property {number} AUTH_FAIL_ACTION_UNSPECIFIED=0 AUTH_FAIL_ACTION_UNSPECIFIED value + * @property {number} AUTH_FAIL_ACTION_REDIRECT=1 AUTH_FAIL_ACTION_REDIRECT value + * @property {number} AUTH_FAIL_ACTION_UNAUTHORIZED=2 AUTH_FAIL_ACTION_UNAUTHORIZED value + */ + v1.AuthFailAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTH_FAIL_ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTH_FAIL_ACTION_REDIRECT"] = 1; + values[valuesById[2] = "AUTH_FAIL_ACTION_UNAUTHORIZED"] = 2; + return values; + })(); + + /** + * LoginRequirement enum. + * @name google.appengine.v1.LoginRequirement + * @enum {number} + * @property {number} LOGIN_UNSPECIFIED=0 LOGIN_UNSPECIFIED value + * @property {number} LOGIN_OPTIONAL=1 LOGIN_OPTIONAL value + * @property {number} LOGIN_ADMIN=2 LOGIN_ADMIN value + * @property {number} LOGIN_REQUIRED=3 LOGIN_REQUIRED value + */ + v1.LoginRequirement = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOGIN_UNSPECIFIED"] = 0; + values[valuesById[1] = "LOGIN_OPTIONAL"] = 1; + values[valuesById[2] = "LOGIN_ADMIN"] = 2; + values[valuesById[3] = "LOGIN_REQUIRED"] = 3; + return values; + })(); + + /** + * SecurityLevel enum. + * @name google.appengine.v1.SecurityLevel + * @enum {number} + * @property {number} SECURE_UNSPECIFIED=0 SECURE_UNSPECIFIED value + * @property {number} SECURE_DEFAULT=0 SECURE_DEFAULT value + * @property {number} SECURE_NEVER=1 SECURE_NEVER value + * @property {number} SECURE_OPTIONAL=2 SECURE_OPTIONAL value + * @property {number} SECURE_ALWAYS=3 SECURE_ALWAYS value + */ + v1.SecurityLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SECURE_UNSPECIFIED"] = 0; + values["SECURE_DEFAULT"] = 0; + values[valuesById[1] = "SECURE_NEVER"] = 1; + values[valuesById[2] = "SECURE_OPTIONAL"] = 2; + values[valuesById[3] = "SECURE_ALWAYS"] = 3; + return values; + })(); + + v1.Applications = (function() { + + /** + * Constructs a new Applications service. + * @memberof google.appengine.v1 + * @classdesc Represents an Applications + * @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 Applications(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Applications.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Applications; + + /** + * Creates new Applications service using the specified rpc implementation. + * @function create + * @memberof google.appengine.v1.Applications + * @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 {Applications} RPC service. Useful where requests and/or responses are streamed. + */ + Applications.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.appengine.v1.Applications|getApplication}. + * @memberof google.appengine.v1.Applications + * @typedef GetApplicationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.Application} [response] Application + */ + + /** + * Calls GetApplication. + * @function getApplication + * @memberof google.appengine.v1.Applications + * @instance + * @param {google.appengine.v1.IGetApplicationRequest} request GetApplicationRequest message or plain object + * @param {google.appengine.v1.Applications.GetApplicationCallback} callback Node-style callback called with the error, if any, and Application + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Applications.prototype.getApplication = function getApplication(request, callback) { + return this.rpcCall(getApplication, $root.google.appengine.v1.GetApplicationRequest, $root.google.appengine.v1.Application, request, callback); + }, "name", { value: "GetApplication" }); + + /** + * Calls GetApplication. + * @function getApplication + * @memberof google.appengine.v1.Applications + * @instance + * @param {google.appengine.v1.IGetApplicationRequest} request GetApplicationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Applications|createApplication}. + * @memberof google.appengine.v1.Applications + * @typedef CreateApplicationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateApplication. + * @function createApplication + * @memberof google.appengine.v1.Applications + * @instance + * @param {google.appengine.v1.ICreateApplicationRequest} request CreateApplicationRequest message or plain object + * @param {google.appengine.v1.Applications.CreateApplicationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Applications.prototype.createApplication = function createApplication(request, callback) { + return this.rpcCall(createApplication, $root.google.appengine.v1.CreateApplicationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateApplication" }); + + /** + * Calls CreateApplication. + * @function createApplication + * @memberof google.appengine.v1.Applications + * @instance + * @param {google.appengine.v1.ICreateApplicationRequest} request CreateApplicationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Applications|updateApplication}. + * @memberof google.appengine.v1.Applications + * @typedef UpdateApplicationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateApplication. + * @function updateApplication + * @memberof google.appengine.v1.Applications + * @instance + * @param {google.appengine.v1.IUpdateApplicationRequest} request UpdateApplicationRequest message or plain object + * @param {google.appengine.v1.Applications.UpdateApplicationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Applications.prototype.updateApplication = function updateApplication(request, callback) { + return this.rpcCall(updateApplication, $root.google.appengine.v1.UpdateApplicationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateApplication" }); + + /** + * Calls UpdateApplication. + * @function updateApplication + * @memberof google.appengine.v1.Applications + * @instance + * @param {google.appengine.v1.IUpdateApplicationRequest} request UpdateApplicationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Applications|repairApplication}. + * @memberof google.appengine.v1.Applications + * @typedef RepairApplicationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RepairApplication. + * @function repairApplication + * @memberof google.appengine.v1.Applications + * @instance + * @param {google.appengine.v1.IRepairApplicationRequest} request RepairApplicationRequest message or plain object + * @param {google.appengine.v1.Applications.RepairApplicationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Applications.prototype.repairApplication = function repairApplication(request, callback) { + return this.rpcCall(repairApplication, $root.google.appengine.v1.RepairApplicationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RepairApplication" }); + + /** + * Calls RepairApplication. + * @function repairApplication + * @memberof google.appengine.v1.Applications + * @instance + * @param {google.appengine.v1.IRepairApplicationRequest} request RepairApplicationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Applications; + })(); + + v1.GetApplicationRequest = (function() { + + /** + * Properties of a GetApplicationRequest. + * @memberof google.appengine.v1 + * @interface IGetApplicationRequest + * @property {string|null} [name] GetApplicationRequest name + */ + + /** + * Constructs a new GetApplicationRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a GetApplicationRequest. + * @implements IGetApplicationRequest + * @constructor + * @param {google.appengine.v1.IGetApplicationRequest=} [properties] Properties to set + */ + function GetApplicationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetApplicationRequest name. + * @member {string} name + * @memberof google.appengine.v1.GetApplicationRequest + * @instance + */ + GetApplicationRequest.prototype.name = ""; + + /** + * Creates a new GetApplicationRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.GetApplicationRequest + * @static + * @param {google.appengine.v1.IGetApplicationRequest=} [properties] Properties to set + * @returns {google.appengine.v1.GetApplicationRequest} GetApplicationRequest instance + */ + GetApplicationRequest.create = function create(properties) { + return new GetApplicationRequest(properties); + }; + + /** + * Encodes the specified GetApplicationRequest message. Does not implicitly {@link google.appengine.v1.GetApplicationRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.GetApplicationRequest + * @static + * @param {google.appengine.v1.IGetApplicationRequest} message GetApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApplicationRequest.encode = function encode(message, writer) { + 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 GetApplicationRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetApplicationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.GetApplicationRequest + * @static + * @param {google.appengine.v1.IGetApplicationRequest} message GetApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApplicationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApplicationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.GetApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.GetApplicationRequest} GetApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApplicationRequest.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.appengine.v1.GetApplicationRequest(); + 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 GetApplicationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.GetApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.GetApplicationRequest} GetApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApplicationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApplicationRequest message. + * @function verify + * @memberof google.appengine.v1.GetApplicationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApplicationRequest.verify = function verify(message) { + if (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 GetApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.GetApplicationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.GetApplicationRequest} GetApplicationRequest + */ + GetApplicationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.GetApplicationRequest) + return object; + var message = new $root.google.appengine.v1.GetApplicationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApplicationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.GetApplicationRequest + * @static + * @param {google.appengine.v1.GetApplicationRequest} message GetApplicationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApplicationRequest.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 GetApplicationRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.GetApplicationRequest + * @instance + * @returns {Object.} JSON object + */ + GetApplicationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApplicationRequest + * @function getTypeUrl + * @memberof google.appengine.v1.GetApplicationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApplicationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.GetApplicationRequest"; + }; + + return GetApplicationRequest; + })(); + + v1.CreateApplicationRequest = (function() { + + /** + * Properties of a CreateApplicationRequest. + * @memberof google.appengine.v1 + * @interface ICreateApplicationRequest + * @property {google.appengine.v1.IApplication|null} [application] CreateApplicationRequest application + */ + + /** + * Constructs a new CreateApplicationRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a CreateApplicationRequest. + * @implements ICreateApplicationRequest + * @constructor + * @param {google.appengine.v1.ICreateApplicationRequest=} [properties] Properties to set + */ + function CreateApplicationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateApplicationRequest application. + * @member {google.appengine.v1.IApplication|null|undefined} application + * @memberof google.appengine.v1.CreateApplicationRequest + * @instance + */ + CreateApplicationRequest.prototype.application = null; + + /** + * Creates a new CreateApplicationRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.CreateApplicationRequest + * @static + * @param {google.appengine.v1.ICreateApplicationRequest=} [properties] Properties to set + * @returns {google.appengine.v1.CreateApplicationRequest} CreateApplicationRequest instance + */ + CreateApplicationRequest.create = function create(properties) { + return new CreateApplicationRequest(properties); + }; + + /** + * Encodes the specified CreateApplicationRequest message. Does not implicitly {@link google.appengine.v1.CreateApplicationRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.CreateApplicationRequest + * @static + * @param {google.appengine.v1.ICreateApplicationRequest} message CreateApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApplicationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.application != null && Object.hasOwnProperty.call(message, "application")) + $root.google.appengine.v1.Application.encode(message.application, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateApplicationRequest message, length delimited. Does not implicitly {@link google.appengine.v1.CreateApplicationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.CreateApplicationRequest + * @static + * @param {google.appengine.v1.ICreateApplicationRequest} message CreateApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApplicationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApplicationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.CreateApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.CreateApplicationRequest} CreateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApplicationRequest.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.appengine.v1.CreateApplicationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.application = $root.google.appengine.v1.Application.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApplicationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.CreateApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.CreateApplicationRequest} CreateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApplicationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApplicationRequest message. + * @function verify + * @memberof google.appengine.v1.CreateApplicationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApplicationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.application != null && message.hasOwnProperty("application")) { + var error = $root.google.appengine.v1.Application.verify(message.application); + if (error) + return "application." + error; + } + return null; + }; + + /** + * Creates a CreateApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.CreateApplicationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.CreateApplicationRequest} CreateApplicationRequest + */ + CreateApplicationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.CreateApplicationRequest) + return object; + var message = new $root.google.appengine.v1.CreateApplicationRequest(); + if (object.application != null) { + if (typeof object.application !== "object") + throw TypeError(".google.appengine.v1.CreateApplicationRequest.application: object expected"); + message.application = $root.google.appengine.v1.Application.fromObject(object.application); + } + return message; + }; + + /** + * Creates a plain object from a CreateApplicationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.CreateApplicationRequest + * @static + * @param {google.appengine.v1.CreateApplicationRequest} message CreateApplicationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApplicationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.application = null; + if (message.application != null && message.hasOwnProperty("application")) + object.application = $root.google.appengine.v1.Application.toObject(message.application, options); + return object; + }; + + /** + * Converts this CreateApplicationRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.CreateApplicationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApplicationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApplicationRequest + * @function getTypeUrl + * @memberof google.appengine.v1.CreateApplicationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApplicationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.CreateApplicationRequest"; + }; + + return CreateApplicationRequest; + })(); + + v1.UpdateApplicationRequest = (function() { + + /** + * Properties of an UpdateApplicationRequest. + * @memberof google.appengine.v1 + * @interface IUpdateApplicationRequest + * @property {string|null} [name] UpdateApplicationRequest name + * @property {google.appengine.v1.IApplication|null} [application] UpdateApplicationRequest application + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApplicationRequest updateMask + */ + + /** + * Constructs a new UpdateApplicationRequest. + * @memberof google.appengine.v1 + * @classdesc Represents an UpdateApplicationRequest. + * @implements IUpdateApplicationRequest + * @constructor + * @param {google.appengine.v1.IUpdateApplicationRequest=} [properties] Properties to set + */ + function UpdateApplicationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApplicationRequest name. + * @member {string} name + * @memberof google.appengine.v1.UpdateApplicationRequest + * @instance + */ + UpdateApplicationRequest.prototype.name = ""; + + /** + * UpdateApplicationRequest application. + * @member {google.appengine.v1.IApplication|null|undefined} application + * @memberof google.appengine.v1.UpdateApplicationRequest + * @instance + */ + UpdateApplicationRequest.prototype.application = null; + + /** + * UpdateApplicationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.appengine.v1.UpdateApplicationRequest + * @instance + */ + UpdateApplicationRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateApplicationRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.UpdateApplicationRequest + * @static + * @param {google.appengine.v1.IUpdateApplicationRequest=} [properties] Properties to set + * @returns {google.appengine.v1.UpdateApplicationRequest} UpdateApplicationRequest instance + */ + UpdateApplicationRequest.create = function create(properties) { + return new UpdateApplicationRequest(properties); + }; + + /** + * Encodes the specified UpdateApplicationRequest message. Does not implicitly {@link google.appengine.v1.UpdateApplicationRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.UpdateApplicationRequest + * @static + * @param {google.appengine.v1.IUpdateApplicationRequest} message UpdateApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.application != null && Object.hasOwnProperty.call(message, "application")) + $root.google.appengine.v1.Application.encode(message.application, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateApplicationRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateApplicationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.UpdateApplicationRequest + * @static + * @param {google.appengine.v1.IUpdateApplicationRequest} message UpdateApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApplicationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.UpdateApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.UpdateApplicationRequest} UpdateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationRequest.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.appengine.v1.UpdateApplicationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.application = $root.google.appengine.v1.Application.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApplicationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.UpdateApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.UpdateApplicationRequest} UpdateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApplicationRequest message. + * @function verify + * @memberof google.appengine.v1.UpdateApplicationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApplicationRequest.verify = function verify(message) { + if (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.application != null && message.hasOwnProperty("application")) { + var error = $root.google.appengine.v1.Application.verify(message.application); + if (error) + return "application." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.UpdateApplicationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.UpdateApplicationRequest} UpdateApplicationRequest + */ + UpdateApplicationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.UpdateApplicationRequest) + return object; + var message = new $root.google.appengine.v1.UpdateApplicationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.application != null) { + if (typeof object.application !== "object") + throw TypeError(".google.appengine.v1.UpdateApplicationRequest.application: object expected"); + message.application = $root.google.appengine.v1.Application.fromObject(object.application); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.appengine.v1.UpdateApplicationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateApplicationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.UpdateApplicationRequest + * @static + * @param {google.appengine.v1.UpdateApplicationRequest} message UpdateApplicationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApplicationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.application = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.application != null && message.hasOwnProperty("application")) + object.application = $root.google.appengine.v1.Application.toObject(message.application, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateApplicationRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.UpdateApplicationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApplicationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApplicationRequest + * @function getTypeUrl + * @memberof google.appengine.v1.UpdateApplicationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApplicationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.UpdateApplicationRequest"; + }; + + return UpdateApplicationRequest; + })(); + + v1.RepairApplicationRequest = (function() { + + /** + * Properties of a RepairApplicationRequest. + * @memberof google.appengine.v1 + * @interface IRepairApplicationRequest + * @property {string|null} [name] RepairApplicationRequest name + */ + + /** + * Constructs a new RepairApplicationRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a RepairApplicationRequest. + * @implements IRepairApplicationRequest + * @constructor + * @param {google.appengine.v1.IRepairApplicationRequest=} [properties] Properties to set + */ + function RepairApplicationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RepairApplicationRequest name. + * @member {string} name + * @memberof google.appengine.v1.RepairApplicationRequest + * @instance + */ + RepairApplicationRequest.prototype.name = ""; + + /** + * Creates a new RepairApplicationRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.RepairApplicationRequest + * @static + * @param {google.appengine.v1.IRepairApplicationRequest=} [properties] Properties to set + * @returns {google.appengine.v1.RepairApplicationRequest} RepairApplicationRequest instance + */ + RepairApplicationRequest.create = function create(properties) { + return new RepairApplicationRequest(properties); + }; + + /** + * Encodes the specified RepairApplicationRequest message. Does not implicitly {@link google.appengine.v1.RepairApplicationRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.RepairApplicationRequest + * @static + * @param {google.appengine.v1.IRepairApplicationRequest} message RepairApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepairApplicationRequest.encode = function encode(message, writer) { + 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 RepairApplicationRequest message, length delimited. Does not implicitly {@link google.appengine.v1.RepairApplicationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.RepairApplicationRequest + * @static + * @param {google.appengine.v1.IRepairApplicationRequest} message RepairApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepairApplicationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RepairApplicationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.RepairApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.RepairApplicationRequest} RepairApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepairApplicationRequest.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.appengine.v1.RepairApplicationRequest(); + 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 RepairApplicationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.RepairApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.RepairApplicationRequest} RepairApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepairApplicationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RepairApplicationRequest message. + * @function verify + * @memberof google.appengine.v1.RepairApplicationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RepairApplicationRequest.verify = function verify(message) { + if (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 RepairApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.RepairApplicationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.RepairApplicationRequest} RepairApplicationRequest + */ + RepairApplicationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.RepairApplicationRequest) + return object; + var message = new $root.google.appengine.v1.RepairApplicationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RepairApplicationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.RepairApplicationRequest + * @static + * @param {google.appengine.v1.RepairApplicationRequest} message RepairApplicationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RepairApplicationRequest.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 RepairApplicationRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.RepairApplicationRequest + * @instance + * @returns {Object.} JSON object + */ + RepairApplicationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RepairApplicationRequest + * @function getTypeUrl + * @memberof google.appengine.v1.RepairApplicationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RepairApplicationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.RepairApplicationRequest"; + }; + + return RepairApplicationRequest; + })(); + + v1.Services = (function() { + + /** + * Constructs a new Services service. + * @memberof google.appengine.v1 + * @classdesc Represents a Services + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Services(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Services.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Services; + + /** + * Creates new Services service using the specified rpc implementation. + * @function create + * @memberof google.appengine.v1.Services + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Services} RPC service. Useful where requests and/or responses are streamed. + */ + Services.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.appengine.v1.Services|listServices}. + * @memberof google.appengine.v1.Services + * @typedef ListServicesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.ListServicesResponse} [response] ListServicesResponse + */ + + /** + * Calls ListServices. + * @function listServices + * @memberof google.appengine.v1.Services + * @instance + * @param {google.appengine.v1.IListServicesRequest} request ListServicesRequest message or plain object + * @param {google.appengine.v1.Services.ListServicesCallback} callback Node-style callback called with the error, if any, and ListServicesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.listServices = function listServices(request, callback) { + return this.rpcCall(listServices, $root.google.appengine.v1.ListServicesRequest, $root.google.appengine.v1.ListServicesResponse, request, callback); + }, "name", { value: "ListServices" }); + + /** + * Calls ListServices. + * @function listServices + * @memberof google.appengine.v1.Services + * @instance + * @param {google.appengine.v1.IListServicesRequest} request ListServicesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Services|getService}. + * @memberof google.appengine.v1.Services + * @typedef GetServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.Service} [response] Service + */ + + /** + * Calls GetService. + * @function getService + * @memberof google.appengine.v1.Services + * @instance + * @param {google.appengine.v1.IGetServiceRequest} request GetServiceRequest message or plain object + * @param {google.appengine.v1.Services.GetServiceCallback} callback Node-style callback called with the error, if any, and Service + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.getService = function getService(request, callback) { + return this.rpcCall(getService, $root.google.appengine.v1.GetServiceRequest, $root.google.appengine.v1.Service, request, callback); + }, "name", { value: "GetService" }); + + /** + * Calls GetService. + * @function getService + * @memberof google.appengine.v1.Services + * @instance + * @param {google.appengine.v1.IGetServiceRequest} request GetServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Services|updateService}. + * @memberof google.appengine.v1.Services + * @typedef UpdateServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateService. + * @function updateService + * @memberof google.appengine.v1.Services + * @instance + * @param {google.appengine.v1.IUpdateServiceRequest} request UpdateServiceRequest message or plain object + * @param {google.appengine.v1.Services.UpdateServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.updateService = function updateService(request, callback) { + return this.rpcCall(updateService, $root.google.appengine.v1.UpdateServiceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateService" }); + + /** + * Calls UpdateService. + * @function updateService + * @memberof google.appengine.v1.Services + * @instance + * @param {google.appengine.v1.IUpdateServiceRequest} request UpdateServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Services|deleteService}. + * @memberof google.appengine.v1.Services + * @typedef DeleteServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteService. + * @function deleteService + * @memberof google.appengine.v1.Services + * @instance + * @param {google.appengine.v1.IDeleteServiceRequest} request DeleteServiceRequest message or plain object + * @param {google.appengine.v1.Services.DeleteServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.deleteService = function deleteService(request, callback) { + return this.rpcCall(deleteService, $root.google.appengine.v1.DeleteServiceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteService" }); + + /** + * Calls DeleteService. + * @function deleteService + * @memberof google.appengine.v1.Services + * @instance + * @param {google.appengine.v1.IDeleteServiceRequest} request DeleteServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Services; + })(); + + v1.ListServicesRequest = (function() { + + /** + * Properties of a ListServicesRequest. + * @memberof google.appengine.v1 + * @interface IListServicesRequest + * @property {string|null} [parent] ListServicesRequest parent + * @property {number|null} [pageSize] ListServicesRequest pageSize + * @property {string|null} [pageToken] ListServicesRequest pageToken + */ + + /** + * Constructs a new ListServicesRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a ListServicesRequest. + * @implements IListServicesRequest + * @constructor + * @param {google.appengine.v1.IListServicesRequest=} [properties] Properties to set + */ + function ListServicesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServicesRequest parent. + * @member {string} parent + * @memberof google.appengine.v1.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.parent = ""; + + /** + * ListServicesRequest pageSize. + * @member {number} pageSize + * @memberof google.appengine.v1.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.pageSize = 0; + + /** + * ListServicesRequest pageToken. + * @member {string} pageToken + * @memberof google.appengine.v1.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListServicesRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListServicesRequest + * @static + * @param {google.appengine.v1.IListServicesRequest=} [properties] Properties to set + * @returns {google.appengine.v1.ListServicesRequest} ListServicesRequest instance + */ + ListServicesRequest.create = function create(properties) { + return new ListServicesRequest(properties); + }; + + /** + * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.appengine.v1.ListServicesRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListServicesRequest + * @static + * @param {google.appengine.v1.IListServicesRequest} message ListServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListServicesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListServicesRequest + * @static + * @param {google.appengine.v1.IListServicesRequest} message ListServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListServicesRequest} ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.ListServicesRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListServicesRequest} ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServicesRequest message. + * @function verify + * @memberof google.appengine.v1.ListServicesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServicesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListServicesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListServicesRequest} ListServicesRequest + */ + ListServicesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListServicesRequest) + return object; + var message = new $root.google.appengine.v1.ListServicesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListServicesRequest + * @static + * @param {google.appengine.v1.ListServicesRequest} message ListServicesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServicesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListServicesRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListServicesRequest + * @instance + * @returns {Object.} JSON object + */ + ListServicesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServicesRequest + * @function getTypeUrl + * @memberof google.appengine.v1.ListServicesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServicesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListServicesRequest"; + }; + + return ListServicesRequest; + })(); + + v1.ListServicesResponse = (function() { + + /** + * Properties of a ListServicesResponse. + * @memberof google.appengine.v1 + * @interface IListServicesResponse + * @property {Array.|null} [services] ListServicesResponse services + * @property {string|null} [nextPageToken] ListServicesResponse nextPageToken + */ + + /** + * Constructs a new ListServicesResponse. + * @memberof google.appengine.v1 + * @classdesc Represents a ListServicesResponse. + * @implements IListServicesResponse + * @constructor + * @param {google.appengine.v1.IListServicesResponse=} [properties] Properties to set + */ + function ListServicesResponse(properties) { + this.services = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServicesResponse services. + * @member {Array.} services + * @memberof google.appengine.v1.ListServicesResponse + * @instance + */ + ListServicesResponse.prototype.services = $util.emptyArray; + + /** + * ListServicesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.appengine.v1.ListServicesResponse + * @instance + */ + ListServicesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListServicesResponse instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListServicesResponse + * @static + * @param {google.appengine.v1.IListServicesResponse=} [properties] Properties to set + * @returns {google.appengine.v1.ListServicesResponse} ListServicesResponse instance + */ + ListServicesResponse.create = function create(properties) { + return new ListServicesResponse(properties); + }; + + /** + * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.appengine.v1.ListServicesResponse.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListServicesResponse + * @static + * @param {google.appengine.v1.IListServicesResponse} message ListServicesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.services != null && message.services.length) + for (var i = 0; i < message.services.length; ++i) + $root.google.appengine.v1.Service.encode(message.services[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListServicesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListServicesResponse + * @static + * @param {google.appengine.v1.IListServicesResponse} message ListServicesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListServicesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListServicesResponse} ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.ListServicesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.services && message.services.length)) + message.services = []; + message.services.push($root.google.appengine.v1.Service.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListServicesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListServicesResponse} ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServicesResponse message. + * @function verify + * @memberof google.appengine.v1.ListServicesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServicesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.services != null && message.hasOwnProperty("services")) { + if (!Array.isArray(message.services)) + return "services: array expected"; + for (var i = 0; i < message.services.length; ++i) { + var error = $root.google.appengine.v1.Service.verify(message.services[i]); + if (error) + return "services." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListServicesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListServicesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListServicesResponse} ListServicesResponse + */ + ListServicesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListServicesResponse) + return object; + var message = new $root.google.appengine.v1.ListServicesResponse(); + if (object.services) { + if (!Array.isArray(object.services)) + throw TypeError(".google.appengine.v1.ListServicesResponse.services: array expected"); + message.services = []; + for (var i = 0; i < object.services.length; ++i) { + if (typeof object.services[i] !== "object") + throw TypeError(".google.appengine.v1.ListServicesResponse.services: object expected"); + message.services[i] = $root.google.appengine.v1.Service.fromObject(object.services[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListServicesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListServicesResponse + * @static + * @param {google.appengine.v1.ListServicesResponse} message ListServicesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServicesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.services = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.services && message.services.length) { + object.services = []; + for (var j = 0; j < message.services.length; ++j) + object.services[j] = $root.google.appengine.v1.Service.toObject(message.services[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListServicesResponse to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListServicesResponse + * @instance + * @returns {Object.} JSON object + */ + ListServicesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServicesResponse + * @function getTypeUrl + * @memberof google.appengine.v1.ListServicesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServicesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListServicesResponse"; + }; + + return ListServicesResponse; + })(); + + v1.GetServiceRequest = (function() { + + /** + * Properties of a GetServiceRequest. + * @memberof google.appengine.v1 + * @interface IGetServiceRequest + * @property {string|null} [name] GetServiceRequest name + */ + + /** + * Constructs a new GetServiceRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a GetServiceRequest. + * @implements IGetServiceRequest + * @constructor + * @param {google.appengine.v1.IGetServiceRequest=} [properties] Properties to set + */ + function GetServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetServiceRequest name. + * @member {string} name + * @memberof google.appengine.v1.GetServiceRequest + * @instance + */ + GetServiceRequest.prototype.name = ""; + + /** + * Creates a new GetServiceRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.GetServiceRequest + * @static + * @param {google.appengine.v1.IGetServiceRequest=} [properties] Properties to set + * @returns {google.appengine.v1.GetServiceRequest} GetServiceRequest instance + */ + GetServiceRequest.create = function create(properties) { + return new GetServiceRequest(properties); + }; + + /** + * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.appengine.v1.GetServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.GetServiceRequest + * @static + * @param {google.appengine.v1.IGetServiceRequest} message GetServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.GetServiceRequest + * @static + * @param {google.appengine.v1.IGetServiceRequest} message GetServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.GetServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.GetServiceRequest} GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.GetServiceRequest(); + 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 GetServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.GetServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.GetServiceRequest} GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetServiceRequest message. + * @function verify + * @memberof google.appengine.v1.GetServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.GetServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.GetServiceRequest} GetServiceRequest + */ + GetServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.GetServiceRequest) + return object; + var message = new $root.google.appengine.v1.GetServiceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.GetServiceRequest + * @static + * @param {google.appengine.v1.GetServiceRequest} message GetServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetServiceRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.GetServiceRequest + * @instance + * @returns {Object.} JSON object + */ + GetServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetServiceRequest + * @function getTypeUrl + * @memberof google.appengine.v1.GetServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.GetServiceRequest"; + }; + + return GetServiceRequest; + })(); + + v1.UpdateServiceRequest = (function() { + + /** + * Properties of an UpdateServiceRequest. + * @memberof google.appengine.v1 + * @interface IUpdateServiceRequest + * @property {string|null} [name] UpdateServiceRequest name + * @property {google.appengine.v1.IService|null} [service] UpdateServiceRequest service + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServiceRequest updateMask + * @property {boolean|null} [migrateTraffic] UpdateServiceRequest migrateTraffic + */ + + /** + * Constructs a new UpdateServiceRequest. + * @memberof google.appengine.v1 + * @classdesc Represents an UpdateServiceRequest. + * @implements IUpdateServiceRequest + * @constructor + * @param {google.appengine.v1.IUpdateServiceRequest=} [properties] Properties to set + */ + function UpdateServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateServiceRequest name. + * @member {string} name + * @memberof google.appengine.v1.UpdateServiceRequest + * @instance + */ + UpdateServiceRequest.prototype.name = ""; + + /** + * UpdateServiceRequest service. + * @member {google.appengine.v1.IService|null|undefined} service + * @memberof google.appengine.v1.UpdateServiceRequest + * @instance + */ + UpdateServiceRequest.prototype.service = null; + + /** + * UpdateServiceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.appengine.v1.UpdateServiceRequest + * @instance + */ + UpdateServiceRequest.prototype.updateMask = null; + + /** + * UpdateServiceRequest migrateTraffic. + * @member {boolean} migrateTraffic + * @memberof google.appengine.v1.UpdateServiceRequest + * @instance + */ + UpdateServiceRequest.prototype.migrateTraffic = false; + + /** + * Creates a new UpdateServiceRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.UpdateServiceRequest + * @static + * @param {google.appengine.v1.IUpdateServiceRequest=} [properties] Properties to set + * @returns {google.appengine.v1.UpdateServiceRequest} UpdateServiceRequest instance + */ + UpdateServiceRequest.create = function create(properties) { + return new UpdateServiceRequest(properties); + }; + + /** + * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.appengine.v1.UpdateServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.UpdateServiceRequest + * @static + * @param {google.appengine.v1.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + $root.google.appengine.v1.Service.encode(message.service, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.migrateTraffic != null && Object.hasOwnProperty.call(message, "migrateTraffic")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.migrateTraffic); + return writer; + }; + + /** + * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.UpdateServiceRequest + * @static + * @param {google.appengine.v1.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.UpdateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.UpdateServiceRequest} UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.UpdateServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.service = $root.google.appengine.v1.Service.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 4: { + message.migrateTraffic = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.UpdateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.UpdateServiceRequest} UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateServiceRequest message. + * @function verify + * @memberof google.appengine.v1.UpdateServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.service != null && message.hasOwnProperty("service")) { + var error = $root.google.appengine.v1.Service.verify(message.service); + if (error) + return "service." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.migrateTraffic != null && message.hasOwnProperty("migrateTraffic")) + if (typeof message.migrateTraffic !== "boolean") + return "migrateTraffic: boolean expected"; + return null; + }; + + /** + * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.UpdateServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.UpdateServiceRequest} UpdateServiceRequest + */ + UpdateServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.UpdateServiceRequest) + return object; + var message = new $root.google.appengine.v1.UpdateServiceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.service != null) { + if (typeof object.service !== "object") + throw TypeError(".google.appengine.v1.UpdateServiceRequest.service: object expected"); + message.service = $root.google.appengine.v1.Service.fromObject(object.service); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.appengine.v1.UpdateServiceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.migrateTraffic != null) + message.migrateTraffic = Boolean(object.migrateTraffic); + return message; + }; + + /** + * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.UpdateServiceRequest + * @static + * @param {google.appengine.v1.UpdateServiceRequest} message UpdateServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.service = null; + object.updateMask = null; + object.migrateTraffic = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.service != null && message.hasOwnProperty("service")) + object.service = $root.google.appengine.v1.Service.toObject(message.service, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.migrateTraffic != null && message.hasOwnProperty("migrateTraffic")) + object.migrateTraffic = message.migrateTraffic; + return object; + }; + + /** + * Converts this UpdateServiceRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.UpdateServiceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateServiceRequest + * @function getTypeUrl + * @memberof google.appengine.v1.UpdateServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.UpdateServiceRequest"; + }; + + return UpdateServiceRequest; + })(); + + v1.DeleteServiceRequest = (function() { + + /** + * Properties of a DeleteServiceRequest. + * @memberof google.appengine.v1 + * @interface IDeleteServiceRequest + * @property {string|null} [name] DeleteServiceRequest name + */ + + /** + * Constructs a new DeleteServiceRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a DeleteServiceRequest. + * @implements IDeleteServiceRequest + * @constructor + * @param {google.appengine.v1.IDeleteServiceRequest=} [properties] Properties to set + */ + function DeleteServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteServiceRequest name. + * @member {string} name + * @memberof google.appengine.v1.DeleteServiceRequest + * @instance + */ + DeleteServiceRequest.prototype.name = ""; + + /** + * Creates a new DeleteServiceRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.DeleteServiceRequest + * @static + * @param {google.appengine.v1.IDeleteServiceRequest=} [properties] Properties to set + * @returns {google.appengine.v1.DeleteServiceRequest} DeleteServiceRequest instance + */ + DeleteServiceRequest.create = function create(properties) { + return new DeleteServiceRequest(properties); + }; + + /** + * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.appengine.v1.DeleteServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.DeleteServiceRequest + * @static + * @param {google.appengine.v1.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.DeleteServiceRequest + * @static + * @param {google.appengine.v1.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.DeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.DeleteServiceRequest} DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.DeleteServiceRequest(); + 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 DeleteServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.DeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.DeleteServiceRequest} DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteServiceRequest message. + * @function verify + * @memberof google.appengine.v1.DeleteServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.DeleteServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.DeleteServiceRequest} DeleteServiceRequest + */ + DeleteServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.DeleteServiceRequest) + return object; + var message = new $root.google.appengine.v1.DeleteServiceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.DeleteServiceRequest + * @static + * @param {google.appengine.v1.DeleteServiceRequest} message DeleteServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteServiceRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.DeleteServiceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteServiceRequest + * @function getTypeUrl + * @memberof google.appengine.v1.DeleteServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.DeleteServiceRequest"; + }; + + return DeleteServiceRequest; + })(); + + v1.Versions = (function() { + + /** + * Constructs a new Versions service. + * @memberof google.appengine.v1 + * @classdesc Represents a Versions + * @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 Versions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Versions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Versions; + + /** + * Creates new Versions service using the specified rpc implementation. + * @function create + * @memberof google.appengine.v1.Versions + * @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 {Versions} RPC service. Useful where requests and/or responses are streamed. + */ + Versions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.appengine.v1.Versions|listVersions}. + * @memberof google.appengine.v1.Versions + * @typedef ListVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.ListVersionsResponse} [response] ListVersionsResponse + */ + + /** + * Calls ListVersions. + * @function listVersions + * @memberof google.appengine.v1.Versions + * @instance + * @param {google.appengine.v1.IListVersionsRequest} request ListVersionsRequest message or plain object + * @param {google.appengine.v1.Versions.ListVersionsCallback} callback Node-style callback called with the error, if any, and ListVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.listVersions = function listVersions(request, callback) { + return this.rpcCall(listVersions, $root.google.appengine.v1.ListVersionsRequest, $root.google.appengine.v1.ListVersionsResponse, request, callback); + }, "name", { value: "ListVersions" }); + + /** + * Calls ListVersions. + * @function listVersions + * @memberof google.appengine.v1.Versions + * @instance + * @param {google.appengine.v1.IListVersionsRequest} request ListVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Versions|getVersion}. + * @memberof google.appengine.v1.Versions + * @typedef GetVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.Version} [response] Version + */ + + /** + * Calls GetVersion. + * @function getVersion + * @memberof google.appengine.v1.Versions + * @instance + * @param {google.appengine.v1.IGetVersionRequest} request GetVersionRequest message or plain object + * @param {google.appengine.v1.Versions.GetVersionCallback} callback Node-style callback called with the error, if any, and Version + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.getVersion = function getVersion(request, callback) { + return this.rpcCall(getVersion, $root.google.appengine.v1.GetVersionRequest, $root.google.appengine.v1.Version, request, callback); + }, "name", { value: "GetVersion" }); + + /** + * Calls GetVersion. + * @function getVersion + * @memberof google.appengine.v1.Versions + * @instance + * @param {google.appengine.v1.IGetVersionRequest} request GetVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Versions|createVersion}. + * @memberof google.appengine.v1.Versions + * @typedef CreateVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateVersion. + * @function createVersion + * @memberof google.appengine.v1.Versions + * @instance + * @param {google.appengine.v1.ICreateVersionRequest} request CreateVersionRequest message or plain object + * @param {google.appengine.v1.Versions.CreateVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.createVersion = function createVersion(request, callback) { + return this.rpcCall(createVersion, $root.google.appengine.v1.CreateVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateVersion" }); + + /** + * Calls CreateVersion. + * @function createVersion + * @memberof google.appengine.v1.Versions + * @instance + * @param {google.appengine.v1.ICreateVersionRequest} request CreateVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Versions|updateVersion}. + * @memberof google.appengine.v1.Versions + * @typedef UpdateVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateVersion. + * @function updateVersion + * @memberof google.appengine.v1.Versions + * @instance + * @param {google.appengine.v1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object + * @param {google.appengine.v1.Versions.UpdateVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.updateVersion = function updateVersion(request, callback) { + return this.rpcCall(updateVersion, $root.google.appengine.v1.UpdateVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateVersion" }); + + /** + * Calls UpdateVersion. + * @function updateVersion + * @memberof google.appengine.v1.Versions + * @instance + * @param {google.appengine.v1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Versions|deleteVersion}. + * @memberof google.appengine.v1.Versions + * @typedef DeleteVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteVersion. + * @function deleteVersion + * @memberof google.appengine.v1.Versions + * @instance + * @param {google.appengine.v1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object + * @param {google.appengine.v1.Versions.DeleteVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Versions.prototype.deleteVersion = function deleteVersion(request, callback) { + return this.rpcCall(deleteVersion, $root.google.appengine.v1.DeleteVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteVersion" }); + + /** + * Calls DeleteVersion. + * @function deleteVersion + * @memberof google.appengine.v1.Versions + * @instance + * @param {google.appengine.v1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Versions; + })(); + + v1.ListVersionsRequest = (function() { + + /** + * Properties of a ListVersionsRequest. + * @memberof google.appengine.v1 + * @interface IListVersionsRequest + * @property {string|null} [parent] ListVersionsRequest parent + * @property {google.appengine.v1.VersionView|null} [view] ListVersionsRequest view + * @property {number|null} [pageSize] ListVersionsRequest pageSize + * @property {string|null} [pageToken] ListVersionsRequest pageToken + */ + + /** + * Constructs a new ListVersionsRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a ListVersionsRequest. + * @implements IListVersionsRequest + * @constructor + * @param {google.appengine.v1.IListVersionsRequest=} [properties] Properties to set + */ + function ListVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVersionsRequest parent. + * @member {string} parent + * @memberof google.appengine.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.parent = ""; + + /** + * ListVersionsRequest view. + * @member {google.appengine.v1.VersionView} view + * @memberof google.appengine.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.view = 0; + + /** + * ListVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.appengine.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.pageSize = 0; + + /** + * ListVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.appengine.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListVersionsRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListVersionsRequest + * @static + * @param {google.appengine.v1.IListVersionsRequest=} [properties] Properties to set + * @returns {google.appengine.v1.ListVersionsRequest} ListVersionsRequest instance + */ + ListVersionsRequest.create = function create(properties) { + return new ListVersionsRequest(properties); + }; + + /** + * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.appengine.v1.ListVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListVersionsRequest + * @static + * @param {google.appengine.v1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListVersionsRequest + * @static + * @param {google.appengine.v1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListVersionsRequest} ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsRequest.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.appengine.v1.ListVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListVersionsRequest} ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVersionsRequest message. + * @function verify + * @memberof google.appengine.v1.ListVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVersionsRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + break; + } + 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 ListVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListVersionsRequest} ListVersionsRequest + */ + ListVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListVersionsRequest) + return object; + var message = new $root.google.appengine.v1.ListVersionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BASIC": + case 0: + message.view = 0; + break; + case "FULL": + case 1: + message.view = 1; + break; + } + 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 ListVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListVersionsRequest + * @static + * @param {google.appengine.v1.ListVersionsRequest} message ListVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "BASIC" : 0; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.appengine.v1.VersionView[message.view] === undefined ? message.view : $root.google.appengine.v1.VersionView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListVersionsRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVersionsRequest + * @function getTypeUrl + * @memberof google.appengine.v1.ListVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListVersionsRequest"; + }; + + return ListVersionsRequest; + })(); + + v1.ListVersionsResponse = (function() { + + /** + * Properties of a ListVersionsResponse. + * @memberof google.appengine.v1 + * @interface IListVersionsResponse + * @property {Array.|null} [versions] ListVersionsResponse versions + * @property {string|null} [nextPageToken] ListVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListVersionsResponse. + * @memberof google.appengine.v1 + * @classdesc Represents a ListVersionsResponse. + * @implements IListVersionsResponse + * @constructor + * @param {google.appengine.v1.IListVersionsResponse=} [properties] Properties to set + */ + function ListVersionsResponse(properties) { + this.versions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVersionsResponse versions. + * @member {Array.} versions + * @memberof google.appengine.v1.ListVersionsResponse + * @instance + */ + ListVersionsResponse.prototype.versions = $util.emptyArray; + + /** + * ListVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.appengine.v1.ListVersionsResponse + * @instance + */ + ListVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListVersionsResponse instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListVersionsResponse + * @static + * @param {google.appengine.v1.IListVersionsResponse=} [properties] Properties to set + * @returns {google.appengine.v1.ListVersionsResponse} ListVersionsResponse instance + */ + ListVersionsResponse.create = function create(properties) { + return new ListVersionsResponse(properties); + }; + + /** + * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.appengine.v1.ListVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListVersionsResponse + * @static + * @param {google.appengine.v1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + $root.google.appengine.v1.Version.encode(message.versions[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 ListVersionsResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListVersionsResponse + * @static + * @param {google.appengine.v1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListVersionsResponse} ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsResponse.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.appengine.v1.ListVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.google.appengine.v1.Version.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListVersionsResponse} ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVersionsResponse message. + * @function verify + * @memberof google.appengine.v1.ListVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) { + var error = $root.google.appengine.v1.Version.verify(message.versions[i]); + if (error) + return "versions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListVersionsResponse} ListVersionsResponse + */ + ListVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListVersionsResponse) + return object; + var message = new $root.google.appengine.v1.ListVersionsResponse(); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".google.appengine.v1.ListVersionsResponse.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".google.appengine.v1.ListVersionsResponse.versions: object expected"); + message.versions[i] = $root.google.appengine.v1.Version.fromObject(object.versions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListVersionsResponse + * @static + * @param {google.appengine.v1.ListVersionsResponse} message ListVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.google.appengine.v1.Version.toObject(message.versions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListVersionsResponse to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVersionsResponse + * @function getTypeUrl + * @memberof google.appengine.v1.ListVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListVersionsResponse"; + }; + + return ListVersionsResponse; + })(); + + /** + * VersionView enum. + * @name google.appengine.v1.VersionView + * @enum {number} + * @property {number} BASIC=0 BASIC value + * @property {number} FULL=1 FULL value + */ + v1.VersionView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BASIC"] = 0; + values[valuesById[1] = "FULL"] = 1; + return values; + })(); + + v1.GetVersionRequest = (function() { + + /** + * Properties of a GetVersionRequest. + * @memberof google.appengine.v1 + * @interface IGetVersionRequest + * @property {string|null} [name] GetVersionRequest name + * @property {google.appengine.v1.VersionView|null} [view] GetVersionRequest view + */ + + /** + * Constructs a new GetVersionRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a GetVersionRequest. + * @implements IGetVersionRequest + * @constructor + * @param {google.appengine.v1.IGetVersionRequest=} [properties] Properties to set + */ + function GetVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVersionRequest name. + * @member {string} name + * @memberof google.appengine.v1.GetVersionRequest + * @instance + */ + GetVersionRequest.prototype.name = ""; + + /** + * GetVersionRequest view. + * @member {google.appengine.v1.VersionView} view + * @memberof google.appengine.v1.GetVersionRequest + * @instance + */ + GetVersionRequest.prototype.view = 0; + + /** + * Creates a new GetVersionRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.GetVersionRequest + * @static + * @param {google.appengine.v1.IGetVersionRequest=} [properties] Properties to set + * @returns {google.appengine.v1.GetVersionRequest} GetVersionRequest instance + */ + GetVersionRequest.create = function create(properties) { + return new GetVersionRequest(properties); + }; + + /** + * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.appengine.v1.GetVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.GetVersionRequest + * @static + * @param {google.appengine.v1.IGetVersionRequest} message GetVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetVersionRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.GetVersionRequest + * @static + * @param {google.appengine.v1.IGetVersionRequest} message GetVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.GetVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.GetVersionRequest} GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVersionRequest.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.appengine.v1.GetVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.GetVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.GetVersionRequest} GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVersionRequest message. + * @function verify + * @memberof google.appengine.v1.GetVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a GetVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.GetVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.GetVersionRequest} GetVersionRequest + */ + GetVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.GetVersionRequest) + return object; + var message = new $root.google.appengine.v1.GetVersionRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BASIC": + case 0: + message.view = 0; + break; + case "FULL": + case 1: + message.view = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.GetVersionRequest + * @static + * @param {google.appengine.v1.GetVersionRequest} message GetVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "BASIC" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.appengine.v1.VersionView[message.view] === undefined ? message.view : $root.google.appengine.v1.VersionView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetVersionRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.GetVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetVersionRequest + * @function getTypeUrl + * @memberof google.appengine.v1.GetVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.GetVersionRequest"; + }; + + return GetVersionRequest; + })(); + + v1.CreateVersionRequest = (function() { + + /** + * Properties of a CreateVersionRequest. + * @memberof google.appengine.v1 + * @interface ICreateVersionRequest + * @property {string|null} [parent] CreateVersionRequest parent + * @property {google.appengine.v1.IVersion|null} [version] CreateVersionRequest version + */ + + /** + * Constructs a new CreateVersionRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a CreateVersionRequest. + * @implements ICreateVersionRequest + * @constructor + * @param {google.appengine.v1.ICreateVersionRequest=} [properties] Properties to set + */ + function CreateVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateVersionRequest parent. + * @member {string} parent + * @memberof google.appengine.v1.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.parent = ""; + + /** + * CreateVersionRequest version. + * @member {google.appengine.v1.IVersion|null|undefined} version + * @memberof google.appengine.v1.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.version = null; + + /** + * Creates a new CreateVersionRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.CreateVersionRequest + * @static + * @param {google.appengine.v1.ICreateVersionRequest=} [properties] Properties to set + * @returns {google.appengine.v1.CreateVersionRequest} CreateVersionRequest instance + */ + CreateVersionRequest.create = function create(properties) { + return new CreateVersionRequest(properties); + }; + + /** + * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.appengine.v1.CreateVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.CreateVersionRequest + * @static + * @param {google.appengine.v1.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionRequest.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.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.appengine.v1.Version.encode(message.version, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.appengine.v1.CreateVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.CreateVersionRequest + * @static + * @param {google.appengine.v1.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.CreateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.CreateVersionRequest} CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionRequest.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.appengine.v1.CreateVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.version = $root.google.appengine.v1.Version.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.CreateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.CreateVersionRequest} CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateVersionRequest message. + * @function verify + * @memberof google.appengine.v1.CreateVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateVersionRequest.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.version != null && message.hasOwnProperty("version")) { + var error = $root.google.appengine.v1.Version.verify(message.version); + if (error) + return "version." + error; + } + return null; + }; + + /** + * Creates a CreateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.CreateVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.CreateVersionRequest} CreateVersionRequest + */ + CreateVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.CreateVersionRequest) + return object; + var message = new $root.google.appengine.v1.CreateVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.appengine.v1.CreateVersionRequest.version: object expected"); + message.version = $root.google.appengine.v1.Version.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.CreateVersionRequest + * @static + * @param {google.appengine.v1.CreateVersionRequest} message CreateVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.version = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.appengine.v1.Version.toObject(message.version, options); + return object; + }; + + /** + * Converts this CreateVersionRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.CreateVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateVersionRequest + * @function getTypeUrl + * @memberof google.appengine.v1.CreateVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.CreateVersionRequest"; + }; + + return CreateVersionRequest; + })(); + + v1.UpdateVersionRequest = (function() { + + /** + * Properties of an UpdateVersionRequest. + * @memberof google.appengine.v1 + * @interface IUpdateVersionRequest + * @property {string|null} [name] UpdateVersionRequest name + * @property {google.appengine.v1.IVersion|null} [version] UpdateVersionRequest version + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateVersionRequest updateMask + */ + + /** + * Constructs a new UpdateVersionRequest. + * @memberof google.appengine.v1 + * @classdesc Represents an UpdateVersionRequest. + * @implements IUpdateVersionRequest + * @constructor + * @param {google.appengine.v1.IUpdateVersionRequest=} [properties] Properties to set + */ + function UpdateVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateVersionRequest name. + * @member {string} name + * @memberof google.appengine.v1.UpdateVersionRequest + * @instance + */ + UpdateVersionRequest.prototype.name = ""; + + /** + * UpdateVersionRequest version. + * @member {google.appengine.v1.IVersion|null|undefined} version + * @memberof google.appengine.v1.UpdateVersionRequest + * @instance + */ + UpdateVersionRequest.prototype.version = null; + + /** + * UpdateVersionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.appengine.v1.UpdateVersionRequest + * @instance + */ + UpdateVersionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateVersionRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.UpdateVersionRequest + * @static + * @param {google.appengine.v1.IUpdateVersionRequest=} [properties] Properties to set + * @returns {google.appengine.v1.UpdateVersionRequest} UpdateVersionRequest instance + */ + UpdateVersionRequest.create = function create(properties) { + return new UpdateVersionRequest(properties); + }; + + /** + * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.appengine.v1.UpdateVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.UpdateVersionRequest + * @static + * @param {google.appengine.v1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.appengine.v1.Version.encode(message.version, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateVersionRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.UpdateVersionRequest + * @static + * @param {google.appengine.v1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.UpdateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.UpdateVersionRequest} UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVersionRequest.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.appengine.v1.UpdateVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.version = $root.google.appengine.v1.Version.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.UpdateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.UpdateVersionRequest} UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateVersionRequest message. + * @function verify + * @memberof google.appengine.v1.UpdateVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.google.appengine.v1.Version.verify(message.version); + if (error) + return "version." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.UpdateVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.UpdateVersionRequest} UpdateVersionRequest + */ + UpdateVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.UpdateVersionRequest) + return object; + var message = new $root.google.appengine.v1.UpdateVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.appengine.v1.UpdateVersionRequest.version: object expected"); + message.version = $root.google.appengine.v1.Version.fromObject(object.version); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.appengine.v1.UpdateVersionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.UpdateVersionRequest + * @static + * @param {google.appengine.v1.UpdateVersionRequest} message UpdateVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.version = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.appengine.v1.Version.toObject(message.version, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateVersionRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.UpdateVersionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateVersionRequest + * @function getTypeUrl + * @memberof google.appengine.v1.UpdateVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.UpdateVersionRequest"; + }; + + return UpdateVersionRequest; + })(); + + v1.DeleteVersionRequest = (function() { + + /** + * Properties of a DeleteVersionRequest. + * @memberof google.appengine.v1 + * @interface IDeleteVersionRequest + * @property {string|null} [name] DeleteVersionRequest name + */ + + /** + * Constructs a new DeleteVersionRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a DeleteVersionRequest. + * @implements IDeleteVersionRequest + * @constructor + * @param {google.appengine.v1.IDeleteVersionRequest=} [properties] Properties to set + */ + function DeleteVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteVersionRequest name. + * @member {string} name + * @memberof google.appengine.v1.DeleteVersionRequest + * @instance + */ + DeleteVersionRequest.prototype.name = ""; + + /** + * Creates a new DeleteVersionRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.DeleteVersionRequest + * @static + * @param {google.appengine.v1.IDeleteVersionRequest=} [properties] Properties to set + * @returns {google.appengine.v1.DeleteVersionRequest} DeleteVersionRequest instance + */ + DeleteVersionRequest.create = function create(properties) { + return new DeleteVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.appengine.v1.DeleteVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.DeleteVersionRequest + * @static + * @param {google.appengine.v1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVersionRequest.encode = function encode(message, writer) { + 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 DeleteVersionRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.DeleteVersionRequest + * @static + * @param {google.appengine.v1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.DeleteVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.DeleteVersionRequest} DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVersionRequest.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.appengine.v1.DeleteVersionRequest(); + 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 DeleteVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.DeleteVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.DeleteVersionRequest} DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteVersionRequest message. + * @function verify + * @memberof google.appengine.v1.DeleteVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteVersionRequest.verify = function verify(message) { + if (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 DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.DeleteVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.DeleteVersionRequest} DeleteVersionRequest + */ + DeleteVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.DeleteVersionRequest) + return object; + var message = new $root.google.appengine.v1.DeleteVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.DeleteVersionRequest + * @static + * @param {google.appengine.v1.DeleteVersionRequest} message DeleteVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteVersionRequest.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 DeleteVersionRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.DeleteVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteVersionRequest + * @function getTypeUrl + * @memberof google.appengine.v1.DeleteVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.DeleteVersionRequest"; + }; + + return DeleteVersionRequest; + })(); + + v1.Instances = (function() { + + /** + * Constructs a new Instances service. + * @memberof google.appengine.v1 + * @classdesc Represents an Instances + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Instances(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Instances.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Instances; + + /** + * Creates new Instances service using the specified rpc implementation. + * @function create + * @memberof google.appengine.v1.Instances + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Instances} RPC service. Useful where requests and/or responses are streamed. + */ + Instances.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.appengine.v1.Instances|listInstances}. + * @memberof google.appengine.v1.Instances + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.appengine.v1.Instances + * @instance + * @param {google.appengine.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.appengine.v1.Instances.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.appengine.v1.ListInstancesRequest, $root.google.appengine.v1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.appengine.v1.Instances + * @instance + * @param {google.appengine.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Instances|getInstance}. + * @memberof google.appengine.v1.Instances + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.appengine.v1.Instances + * @instance + * @param {google.appengine.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.appengine.v1.Instances.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.appengine.v1.GetInstanceRequest, $root.google.appengine.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.appengine.v1.Instances + * @instance + * @param {google.appengine.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Instances|deleteInstance}. + * @memberof google.appengine.v1.Instances + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.appengine.v1.Instances + * @instance + * @param {google.appengine.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.appengine.v1.Instances.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.appengine.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.appengine.v1.Instances + * @instance + * @param {google.appengine.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Instances|debugInstance}. + * @memberof google.appengine.v1.Instances + * @typedef DebugInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DebugInstance. + * @function debugInstance + * @memberof google.appengine.v1.Instances + * @instance + * @param {google.appengine.v1.IDebugInstanceRequest} request DebugInstanceRequest message or plain object + * @param {google.appengine.v1.Instances.DebugInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.debugInstance = function debugInstance(request, callback) { + return this.rpcCall(debugInstance, $root.google.appengine.v1.DebugInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DebugInstance" }); + + /** + * Calls DebugInstance. + * @function debugInstance + * @memberof google.appengine.v1.Instances + * @instance + * @param {google.appengine.v1.IDebugInstanceRequest} request DebugInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Instances; + })(); + + v1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.appengine.v1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.appengine.v1.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.appengine.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.appengine.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.appengine.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListInstancesRequest + * @static + * @param {google.appengine.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.appengine.v1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.appengine.v1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListInstancesRequest + * @static + * @param {google.appengine.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListInstancesRequest + * @static + * @param {google.appengine.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.ListInstancesRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.appengine.v1.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListInstancesRequest) + return object; + var message = new $root.google.appengine.v1.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListInstancesRequest + * @static + * @param {google.appengine.v1.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.appengine.v1.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v1.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.appengine.v1 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.appengine.v1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.appengine.v1.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.appengine.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.appengine.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListInstancesResponse + * @static + * @param {google.appengine.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.appengine.v1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.appengine.v1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListInstancesResponse + * @static + * @param {google.appengine.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.appengine.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListInstancesResponse + * @static + * @param {google.appengine.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.appengine.v1.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.appengine.v1.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.appengine.v1.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListInstancesResponse) + return object; + var message = new $root.google.appengine.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.appengine.v1.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.appengine.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.appengine.v1.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListInstancesResponse + * @static + * @param {google.appengine.v1.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.appengine.v1.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.appengine.v1.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.appengine.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.appengine.v1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.appengine.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.GetInstanceRequest + * @static + * @param {google.appengine.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.appengine.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.appengine.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.GetInstanceRequest + * @static + * @param {google.appengine.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.GetInstanceRequest + * @static + * @param {google.appengine.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.GetInstanceRequest(); + 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 GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.appengine.v1.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.GetInstanceRequest) + return object; + var message = new $root.google.appengine.v1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.GetInstanceRequest + * @static + * @param {google.appengine.v1.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.appengine.v1.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.appengine.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.appengine.v1.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.appengine.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.DeleteInstanceRequest + * @static + * @param {google.appengine.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.appengine.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.appengine.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.DeleteInstanceRequest + * @static + * @param {google.appengine.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.DeleteInstanceRequest + * @static + * @param {google.appengine.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.DeleteInstanceRequest(); + 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 DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.appengine.v1.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.appengine.v1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.DeleteInstanceRequest + * @static + * @param {google.appengine.v1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.appengine.v1.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1.DebugInstanceRequest = (function() { + + /** + * Properties of a DebugInstanceRequest. + * @memberof google.appengine.v1 + * @interface IDebugInstanceRequest + * @property {string|null} [name] DebugInstanceRequest name + * @property {string|null} [sshKey] DebugInstanceRequest sshKey + */ + + /** + * Constructs a new DebugInstanceRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a DebugInstanceRequest. + * @implements IDebugInstanceRequest + * @constructor + * @param {google.appengine.v1.IDebugInstanceRequest=} [properties] Properties to set + */ + function DebugInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DebugInstanceRequest name. + * @member {string} name + * @memberof google.appengine.v1.DebugInstanceRequest + * @instance + */ + DebugInstanceRequest.prototype.name = ""; + + /** + * DebugInstanceRequest sshKey. + * @member {string} sshKey + * @memberof google.appengine.v1.DebugInstanceRequest + * @instance + */ + DebugInstanceRequest.prototype.sshKey = ""; + + /** + * Creates a new DebugInstanceRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.DebugInstanceRequest + * @static + * @param {google.appengine.v1.IDebugInstanceRequest=} [properties] Properties to set + * @returns {google.appengine.v1.DebugInstanceRequest} DebugInstanceRequest instance + */ + DebugInstanceRequest.create = function create(properties) { + return new DebugInstanceRequest(properties); + }; + + /** + * Encodes the specified DebugInstanceRequest message. Does not implicitly {@link google.appengine.v1.DebugInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.DebugInstanceRequest + * @static + * @param {google.appengine.v1.IDebugInstanceRequest} message DebugInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DebugInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sshKey != null && Object.hasOwnProperty.call(message, "sshKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sshKey); + return writer; + }; + + /** + * Encodes the specified DebugInstanceRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DebugInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.DebugInstanceRequest + * @static + * @param {google.appengine.v1.IDebugInstanceRequest} message DebugInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DebugInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DebugInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.DebugInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.DebugInstanceRequest} DebugInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DebugInstanceRequest.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.appengine.v1.DebugInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sshKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DebugInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.DebugInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.DebugInstanceRequest} DebugInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DebugInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DebugInstanceRequest message. + * @function verify + * @memberof google.appengine.v1.DebugInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DebugInstanceRequest.verify = function verify(message) { + if (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.sshKey != null && message.hasOwnProperty("sshKey")) + if (!$util.isString(message.sshKey)) + return "sshKey: string expected"; + return null; + }; + + /** + * Creates a DebugInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.DebugInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.DebugInstanceRequest} DebugInstanceRequest + */ + DebugInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.DebugInstanceRequest) + return object; + var message = new $root.google.appengine.v1.DebugInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.sshKey != null) + message.sshKey = String(object.sshKey); + return message; + }; + + /** + * Creates a plain object from a DebugInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.DebugInstanceRequest + * @static + * @param {google.appengine.v1.DebugInstanceRequest} message DebugInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DebugInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sshKey = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sshKey != null && message.hasOwnProperty("sshKey")) + object.sshKey = message.sshKey; + return object; + }; + + /** + * Converts this DebugInstanceRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.DebugInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DebugInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DebugInstanceRequest + * @function getTypeUrl + * @memberof google.appengine.v1.DebugInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DebugInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.DebugInstanceRequest"; + }; + + return DebugInstanceRequest; + })(); + + v1.Firewall = (function() { + + /** + * Constructs a new Firewall service. + * @memberof google.appengine.v1 + * @classdesc Represents a Firewall + * @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 Firewall(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Firewall.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Firewall; + + /** + * Creates new Firewall service using the specified rpc implementation. + * @function create + * @memberof google.appengine.v1.Firewall + * @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 {Firewall} RPC service. Useful where requests and/or responses are streamed. + */ + Firewall.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.appengine.v1.Firewall|listIngressRules}. + * @memberof google.appengine.v1.Firewall + * @typedef ListIngressRulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.ListIngressRulesResponse} [response] ListIngressRulesResponse + */ + + /** + * Calls ListIngressRules. + * @function listIngressRules + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.IListIngressRulesRequest} request ListIngressRulesRequest message or plain object + * @param {google.appengine.v1.Firewall.ListIngressRulesCallback} callback Node-style callback called with the error, if any, and ListIngressRulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewall.prototype.listIngressRules = function listIngressRules(request, callback) { + return this.rpcCall(listIngressRules, $root.google.appengine.v1.ListIngressRulesRequest, $root.google.appengine.v1.ListIngressRulesResponse, request, callback); + }, "name", { value: "ListIngressRules" }); + + /** + * Calls ListIngressRules. + * @function listIngressRules + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.IListIngressRulesRequest} request ListIngressRulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Firewall|batchUpdateIngressRules}. + * @memberof google.appengine.v1.Firewall + * @typedef BatchUpdateIngressRulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.BatchUpdateIngressRulesResponse} [response] BatchUpdateIngressRulesResponse + */ + + /** + * Calls BatchUpdateIngressRules. + * @function batchUpdateIngressRules + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.IBatchUpdateIngressRulesRequest} request BatchUpdateIngressRulesRequest message or plain object + * @param {google.appengine.v1.Firewall.BatchUpdateIngressRulesCallback} callback Node-style callback called with the error, if any, and BatchUpdateIngressRulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewall.prototype.batchUpdateIngressRules = function batchUpdateIngressRules(request, callback) { + return this.rpcCall(batchUpdateIngressRules, $root.google.appengine.v1.BatchUpdateIngressRulesRequest, $root.google.appengine.v1.BatchUpdateIngressRulesResponse, request, callback); + }, "name", { value: "BatchUpdateIngressRules" }); + + /** + * Calls BatchUpdateIngressRules. + * @function batchUpdateIngressRules + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.IBatchUpdateIngressRulesRequest} request BatchUpdateIngressRulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Firewall|createIngressRule}. + * @memberof google.appengine.v1.Firewall + * @typedef CreateIngressRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.FirewallRule} [response] FirewallRule + */ + + /** + * Calls CreateIngressRule. + * @function createIngressRule + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.ICreateIngressRuleRequest} request CreateIngressRuleRequest message or plain object + * @param {google.appengine.v1.Firewall.CreateIngressRuleCallback} callback Node-style callback called with the error, if any, and FirewallRule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewall.prototype.createIngressRule = function createIngressRule(request, callback) { + return this.rpcCall(createIngressRule, $root.google.appengine.v1.CreateIngressRuleRequest, $root.google.appengine.v1.FirewallRule, request, callback); + }, "name", { value: "CreateIngressRule" }); + + /** + * Calls CreateIngressRule. + * @function createIngressRule + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.ICreateIngressRuleRequest} request CreateIngressRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Firewall|getIngressRule}. + * @memberof google.appengine.v1.Firewall + * @typedef GetIngressRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.FirewallRule} [response] FirewallRule + */ + + /** + * Calls GetIngressRule. + * @function getIngressRule + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.IGetIngressRuleRequest} request GetIngressRuleRequest message or plain object + * @param {google.appengine.v1.Firewall.GetIngressRuleCallback} callback Node-style callback called with the error, if any, and FirewallRule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewall.prototype.getIngressRule = function getIngressRule(request, callback) { + return this.rpcCall(getIngressRule, $root.google.appengine.v1.GetIngressRuleRequest, $root.google.appengine.v1.FirewallRule, request, callback); + }, "name", { value: "GetIngressRule" }); + + /** + * Calls GetIngressRule. + * @function getIngressRule + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.IGetIngressRuleRequest} request GetIngressRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Firewall|updateIngressRule}. + * @memberof google.appengine.v1.Firewall + * @typedef UpdateIngressRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.FirewallRule} [response] FirewallRule + */ + + /** + * Calls UpdateIngressRule. + * @function updateIngressRule + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.IUpdateIngressRuleRequest} request UpdateIngressRuleRequest message or plain object + * @param {google.appengine.v1.Firewall.UpdateIngressRuleCallback} callback Node-style callback called with the error, if any, and FirewallRule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewall.prototype.updateIngressRule = function updateIngressRule(request, callback) { + return this.rpcCall(updateIngressRule, $root.google.appengine.v1.UpdateIngressRuleRequest, $root.google.appengine.v1.FirewallRule, request, callback); + }, "name", { value: "UpdateIngressRule" }); + + /** + * Calls UpdateIngressRule. + * @function updateIngressRule + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.IUpdateIngressRuleRequest} request UpdateIngressRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.Firewall|deleteIngressRule}. + * @memberof google.appengine.v1.Firewall + * @typedef DeleteIngressRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteIngressRule. + * @function deleteIngressRule + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.IDeleteIngressRuleRequest} request DeleteIngressRuleRequest message or plain object + * @param {google.appengine.v1.Firewall.DeleteIngressRuleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewall.prototype.deleteIngressRule = function deleteIngressRule(request, callback) { + return this.rpcCall(deleteIngressRule, $root.google.appengine.v1.DeleteIngressRuleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteIngressRule" }); + + /** + * Calls DeleteIngressRule. + * @function deleteIngressRule + * @memberof google.appengine.v1.Firewall + * @instance + * @param {google.appengine.v1.IDeleteIngressRuleRequest} request DeleteIngressRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Firewall; + })(); + + v1.ListIngressRulesRequest = (function() { + + /** + * Properties of a ListIngressRulesRequest. + * @memberof google.appengine.v1 + * @interface IListIngressRulesRequest + * @property {string|null} [parent] ListIngressRulesRequest parent + * @property {number|null} [pageSize] ListIngressRulesRequest pageSize + * @property {string|null} [pageToken] ListIngressRulesRequest pageToken + * @property {string|null} [matchingAddress] ListIngressRulesRequest matchingAddress + */ + + /** + * Constructs a new ListIngressRulesRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a ListIngressRulesRequest. + * @implements IListIngressRulesRequest + * @constructor + * @param {google.appengine.v1.IListIngressRulesRequest=} [properties] Properties to set + */ + function ListIngressRulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListIngressRulesRequest parent. + * @member {string} parent + * @memberof google.appengine.v1.ListIngressRulesRequest + * @instance + */ + ListIngressRulesRequest.prototype.parent = ""; + + /** + * ListIngressRulesRequest pageSize. + * @member {number} pageSize + * @memberof google.appengine.v1.ListIngressRulesRequest + * @instance + */ + ListIngressRulesRequest.prototype.pageSize = 0; + + /** + * ListIngressRulesRequest pageToken. + * @member {string} pageToken + * @memberof google.appengine.v1.ListIngressRulesRequest + * @instance + */ + ListIngressRulesRequest.prototype.pageToken = ""; + + /** + * ListIngressRulesRequest matchingAddress. + * @member {string} matchingAddress + * @memberof google.appengine.v1.ListIngressRulesRequest + * @instance + */ + ListIngressRulesRequest.prototype.matchingAddress = ""; + + /** + * Creates a new ListIngressRulesRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListIngressRulesRequest + * @static + * @param {google.appengine.v1.IListIngressRulesRequest=} [properties] Properties to set + * @returns {google.appengine.v1.ListIngressRulesRequest} ListIngressRulesRequest instance + */ + ListIngressRulesRequest.create = function create(properties) { + return new ListIngressRulesRequest(properties); + }; + + /** + * Encodes the specified ListIngressRulesRequest message. Does not implicitly {@link google.appengine.v1.ListIngressRulesRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListIngressRulesRequest + * @static + * @param {google.appengine.v1.IListIngressRulesRequest} message ListIngressRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIngressRulesRequest.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.matchingAddress != null && Object.hasOwnProperty.call(message, "matchingAddress")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.matchingAddress); + return writer; + }; + + /** + * Encodes the specified ListIngressRulesRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListIngressRulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListIngressRulesRequest + * @static + * @param {google.appengine.v1.IListIngressRulesRequest} message ListIngressRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIngressRulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListIngressRulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListIngressRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListIngressRulesRequest} ListIngressRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIngressRulesRequest.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.appengine.v1.ListIngressRulesRequest(); + 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.matchingAddress = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListIngressRulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListIngressRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListIngressRulesRequest} ListIngressRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIngressRulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListIngressRulesRequest message. + * @function verify + * @memberof google.appengine.v1.ListIngressRulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIngressRulesRequest.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.matchingAddress != null && message.hasOwnProperty("matchingAddress")) + if (!$util.isString(message.matchingAddress)) + return "matchingAddress: string expected"; + return null; + }; + + /** + * Creates a ListIngressRulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListIngressRulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListIngressRulesRequest} ListIngressRulesRequest + */ + ListIngressRulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListIngressRulesRequest) + return object; + var message = new $root.google.appengine.v1.ListIngressRulesRequest(); + 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.matchingAddress != null) + message.matchingAddress = String(object.matchingAddress); + return message; + }; + + /** + * Creates a plain object from a ListIngressRulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListIngressRulesRequest + * @static + * @param {google.appengine.v1.ListIngressRulesRequest} message ListIngressRulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIngressRulesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.matchingAddress = ""; + } + 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.matchingAddress != null && message.hasOwnProperty("matchingAddress")) + object.matchingAddress = message.matchingAddress; + return object; + }; + + /** + * Converts this ListIngressRulesRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListIngressRulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListIngressRulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListIngressRulesRequest + * @function getTypeUrl + * @memberof google.appengine.v1.ListIngressRulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListIngressRulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListIngressRulesRequest"; + }; + + return ListIngressRulesRequest; + })(); + + v1.ListIngressRulesResponse = (function() { + + /** + * Properties of a ListIngressRulesResponse. + * @memberof google.appengine.v1 + * @interface IListIngressRulesResponse + * @property {Array.|null} [ingressRules] ListIngressRulesResponse ingressRules + * @property {string|null} [nextPageToken] ListIngressRulesResponse nextPageToken + */ + + /** + * Constructs a new ListIngressRulesResponse. + * @memberof google.appengine.v1 + * @classdesc Represents a ListIngressRulesResponse. + * @implements IListIngressRulesResponse + * @constructor + * @param {google.appengine.v1.IListIngressRulesResponse=} [properties] Properties to set + */ + function ListIngressRulesResponse(properties) { + this.ingressRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListIngressRulesResponse ingressRules. + * @member {Array.} ingressRules + * @memberof google.appengine.v1.ListIngressRulesResponse + * @instance + */ + ListIngressRulesResponse.prototype.ingressRules = $util.emptyArray; + + /** + * ListIngressRulesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.appengine.v1.ListIngressRulesResponse + * @instance + */ + ListIngressRulesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListIngressRulesResponse instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListIngressRulesResponse + * @static + * @param {google.appengine.v1.IListIngressRulesResponse=} [properties] Properties to set + * @returns {google.appengine.v1.ListIngressRulesResponse} ListIngressRulesResponse instance + */ + ListIngressRulesResponse.create = function create(properties) { + return new ListIngressRulesResponse(properties); + }; + + /** + * Encodes the specified ListIngressRulesResponse message. Does not implicitly {@link google.appengine.v1.ListIngressRulesResponse.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListIngressRulesResponse + * @static + * @param {google.appengine.v1.IListIngressRulesResponse} message ListIngressRulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIngressRulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ingressRules != null && message.ingressRules.length) + for (var i = 0; i < message.ingressRules.length; ++i) + $root.google.appengine.v1.FirewallRule.encode(message.ingressRules[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 ListIngressRulesResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListIngressRulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListIngressRulesResponse + * @static + * @param {google.appengine.v1.IListIngressRulesResponse} message ListIngressRulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIngressRulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListIngressRulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListIngressRulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListIngressRulesResponse} ListIngressRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIngressRulesResponse.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.appengine.v1.ListIngressRulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ingressRules && message.ingressRules.length)) + message.ingressRules = []; + message.ingressRules.push($root.google.appengine.v1.FirewallRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListIngressRulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListIngressRulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListIngressRulesResponse} ListIngressRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIngressRulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListIngressRulesResponse message. + * @function verify + * @memberof google.appengine.v1.ListIngressRulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIngressRulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ingressRules != null && message.hasOwnProperty("ingressRules")) { + if (!Array.isArray(message.ingressRules)) + return "ingressRules: array expected"; + for (var i = 0; i < message.ingressRules.length; ++i) { + var error = $root.google.appengine.v1.FirewallRule.verify(message.ingressRules[i]); + if (error) + return "ingressRules." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListIngressRulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListIngressRulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListIngressRulesResponse} ListIngressRulesResponse + */ + ListIngressRulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListIngressRulesResponse) + return object; + var message = new $root.google.appengine.v1.ListIngressRulesResponse(); + if (object.ingressRules) { + if (!Array.isArray(object.ingressRules)) + throw TypeError(".google.appengine.v1.ListIngressRulesResponse.ingressRules: array expected"); + message.ingressRules = []; + for (var i = 0; i < object.ingressRules.length; ++i) { + if (typeof object.ingressRules[i] !== "object") + throw TypeError(".google.appengine.v1.ListIngressRulesResponse.ingressRules: object expected"); + message.ingressRules[i] = $root.google.appengine.v1.FirewallRule.fromObject(object.ingressRules[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListIngressRulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListIngressRulesResponse + * @static + * @param {google.appengine.v1.ListIngressRulesResponse} message ListIngressRulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIngressRulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ingressRules = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.ingressRules && message.ingressRules.length) { + object.ingressRules = []; + for (var j = 0; j < message.ingressRules.length; ++j) + object.ingressRules[j] = $root.google.appengine.v1.FirewallRule.toObject(message.ingressRules[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListIngressRulesResponse to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListIngressRulesResponse + * @instance + * @returns {Object.} JSON object + */ + ListIngressRulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListIngressRulesResponse + * @function getTypeUrl + * @memberof google.appengine.v1.ListIngressRulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListIngressRulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListIngressRulesResponse"; + }; + + return ListIngressRulesResponse; + })(); + + v1.BatchUpdateIngressRulesRequest = (function() { + + /** + * Properties of a BatchUpdateIngressRulesRequest. + * @memberof google.appengine.v1 + * @interface IBatchUpdateIngressRulesRequest + * @property {string|null} [name] BatchUpdateIngressRulesRequest name + * @property {Array.|null} [ingressRules] BatchUpdateIngressRulesRequest ingressRules + */ + + /** + * Constructs a new BatchUpdateIngressRulesRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a BatchUpdateIngressRulesRequest. + * @implements IBatchUpdateIngressRulesRequest + * @constructor + * @param {google.appengine.v1.IBatchUpdateIngressRulesRequest=} [properties] Properties to set + */ + function BatchUpdateIngressRulesRequest(properties) { + this.ingressRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchUpdateIngressRulesRequest name. + * @member {string} name + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @instance + */ + BatchUpdateIngressRulesRequest.prototype.name = ""; + + /** + * BatchUpdateIngressRulesRequest ingressRules. + * @member {Array.} ingressRules + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @instance + */ + BatchUpdateIngressRulesRequest.prototype.ingressRules = $util.emptyArray; + + /** + * Creates a new BatchUpdateIngressRulesRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @static + * @param {google.appengine.v1.IBatchUpdateIngressRulesRequest=} [properties] Properties to set + * @returns {google.appengine.v1.BatchUpdateIngressRulesRequest} BatchUpdateIngressRulesRequest instance + */ + BatchUpdateIngressRulesRequest.create = function create(properties) { + return new BatchUpdateIngressRulesRequest(properties); + }; + + /** + * Encodes the specified BatchUpdateIngressRulesRequest message. Does not implicitly {@link google.appengine.v1.BatchUpdateIngressRulesRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @static + * @param {google.appengine.v1.IBatchUpdateIngressRulesRequest} message BatchUpdateIngressRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateIngressRulesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ingressRules != null && message.ingressRules.length) + for (var i = 0; i < message.ingressRules.length; ++i) + $root.google.appengine.v1.FirewallRule.encode(message.ingressRules[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchUpdateIngressRulesRequest message, length delimited. Does not implicitly {@link google.appengine.v1.BatchUpdateIngressRulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @static + * @param {google.appengine.v1.IBatchUpdateIngressRulesRequest} message BatchUpdateIngressRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateIngressRulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchUpdateIngressRulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.BatchUpdateIngressRulesRequest} BatchUpdateIngressRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateIngressRulesRequest.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.appengine.v1.BatchUpdateIngressRulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.ingressRules && message.ingressRules.length)) + message.ingressRules = []; + message.ingressRules.push($root.google.appengine.v1.FirewallRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchUpdateIngressRulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.BatchUpdateIngressRulesRequest} BatchUpdateIngressRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateIngressRulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchUpdateIngressRulesRequest message. + * @function verify + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateIngressRulesRequest.verify = function verify(message) { + if (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.ingressRules != null && message.hasOwnProperty("ingressRules")) { + if (!Array.isArray(message.ingressRules)) + return "ingressRules: array expected"; + for (var i = 0; i < message.ingressRules.length; ++i) { + var error = $root.google.appengine.v1.FirewallRule.verify(message.ingressRules[i]); + if (error) + return "ingressRules." + error; + } + } + return null; + }; + + /** + * Creates a BatchUpdateIngressRulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.BatchUpdateIngressRulesRequest} BatchUpdateIngressRulesRequest + */ + BatchUpdateIngressRulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.BatchUpdateIngressRulesRequest) + return object; + var message = new $root.google.appengine.v1.BatchUpdateIngressRulesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ingressRules) { + if (!Array.isArray(object.ingressRules)) + throw TypeError(".google.appengine.v1.BatchUpdateIngressRulesRequest.ingressRules: array expected"); + message.ingressRules = []; + for (var i = 0; i < object.ingressRules.length; ++i) { + if (typeof object.ingressRules[i] !== "object") + throw TypeError(".google.appengine.v1.BatchUpdateIngressRulesRequest.ingressRules: object expected"); + message.ingressRules[i] = $root.google.appengine.v1.FirewallRule.fromObject(object.ingressRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchUpdateIngressRulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @static + * @param {google.appengine.v1.BatchUpdateIngressRulesRequest} message BatchUpdateIngressRulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateIngressRulesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ingressRules = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ingressRules && message.ingressRules.length) { + object.ingressRules = []; + for (var j = 0; j < message.ingressRules.length; ++j) + object.ingressRules[j] = $root.google.appengine.v1.FirewallRule.toObject(message.ingressRules[j], options); + } + return object; + }; + + /** + * Converts this BatchUpdateIngressRulesRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateIngressRulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchUpdateIngressRulesRequest + * @function getTypeUrl + * @memberof google.appengine.v1.BatchUpdateIngressRulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchUpdateIngressRulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.BatchUpdateIngressRulesRequest"; + }; + + return BatchUpdateIngressRulesRequest; + })(); + + v1.BatchUpdateIngressRulesResponse = (function() { + + /** + * Properties of a BatchUpdateIngressRulesResponse. + * @memberof google.appengine.v1 + * @interface IBatchUpdateIngressRulesResponse + * @property {Array.|null} [ingressRules] BatchUpdateIngressRulesResponse ingressRules + */ + + /** + * Constructs a new BatchUpdateIngressRulesResponse. + * @memberof google.appengine.v1 + * @classdesc Represents a BatchUpdateIngressRulesResponse. + * @implements IBatchUpdateIngressRulesResponse + * @constructor + * @param {google.appengine.v1.IBatchUpdateIngressRulesResponse=} [properties] Properties to set + */ + function BatchUpdateIngressRulesResponse(properties) { + this.ingressRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchUpdateIngressRulesResponse ingressRules. + * @member {Array.} ingressRules + * @memberof google.appengine.v1.BatchUpdateIngressRulesResponse + * @instance + */ + BatchUpdateIngressRulesResponse.prototype.ingressRules = $util.emptyArray; + + /** + * Creates a new BatchUpdateIngressRulesResponse instance using the specified properties. + * @function create + * @memberof google.appengine.v1.BatchUpdateIngressRulesResponse + * @static + * @param {google.appengine.v1.IBatchUpdateIngressRulesResponse=} [properties] Properties to set + * @returns {google.appengine.v1.BatchUpdateIngressRulesResponse} BatchUpdateIngressRulesResponse instance + */ + BatchUpdateIngressRulesResponse.create = function create(properties) { + return new BatchUpdateIngressRulesResponse(properties); + }; + + /** + * Encodes the specified BatchUpdateIngressRulesResponse message. Does not implicitly {@link google.appengine.v1.BatchUpdateIngressRulesResponse.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.BatchUpdateIngressRulesResponse + * @static + * @param {google.appengine.v1.IBatchUpdateIngressRulesResponse} message BatchUpdateIngressRulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateIngressRulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ingressRules != null && message.ingressRules.length) + for (var i = 0; i < message.ingressRules.length; ++i) + $root.google.appengine.v1.FirewallRule.encode(message.ingressRules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchUpdateIngressRulesResponse message, length delimited. Does not implicitly {@link google.appengine.v1.BatchUpdateIngressRulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.BatchUpdateIngressRulesResponse + * @static + * @param {google.appengine.v1.IBatchUpdateIngressRulesResponse} message BatchUpdateIngressRulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateIngressRulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchUpdateIngressRulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.BatchUpdateIngressRulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.BatchUpdateIngressRulesResponse} BatchUpdateIngressRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateIngressRulesResponse.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.appengine.v1.BatchUpdateIngressRulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ingressRules && message.ingressRules.length)) + message.ingressRules = []; + message.ingressRules.push($root.google.appengine.v1.FirewallRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchUpdateIngressRulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.BatchUpdateIngressRulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.BatchUpdateIngressRulesResponse} BatchUpdateIngressRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateIngressRulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchUpdateIngressRulesResponse message. + * @function verify + * @memberof google.appengine.v1.BatchUpdateIngressRulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateIngressRulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ingressRules != null && message.hasOwnProperty("ingressRules")) { + if (!Array.isArray(message.ingressRules)) + return "ingressRules: array expected"; + for (var i = 0; i < message.ingressRules.length; ++i) { + var error = $root.google.appengine.v1.FirewallRule.verify(message.ingressRules[i]); + if (error) + return "ingressRules." + error; + } + } + return null; + }; + + /** + * Creates a BatchUpdateIngressRulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.BatchUpdateIngressRulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.BatchUpdateIngressRulesResponse} BatchUpdateIngressRulesResponse + */ + BatchUpdateIngressRulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.BatchUpdateIngressRulesResponse) + return object; + var message = new $root.google.appengine.v1.BatchUpdateIngressRulesResponse(); + if (object.ingressRules) { + if (!Array.isArray(object.ingressRules)) + throw TypeError(".google.appengine.v1.BatchUpdateIngressRulesResponse.ingressRules: array expected"); + message.ingressRules = []; + for (var i = 0; i < object.ingressRules.length; ++i) { + if (typeof object.ingressRules[i] !== "object") + throw TypeError(".google.appengine.v1.BatchUpdateIngressRulesResponse.ingressRules: object expected"); + message.ingressRules[i] = $root.google.appengine.v1.FirewallRule.fromObject(object.ingressRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchUpdateIngressRulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.BatchUpdateIngressRulesResponse + * @static + * @param {google.appengine.v1.BatchUpdateIngressRulesResponse} message BatchUpdateIngressRulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateIngressRulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ingressRules = []; + if (message.ingressRules && message.ingressRules.length) { + object.ingressRules = []; + for (var j = 0; j < message.ingressRules.length; ++j) + object.ingressRules[j] = $root.google.appengine.v1.FirewallRule.toObject(message.ingressRules[j], options); + } + return object; + }; + + /** + * Converts this BatchUpdateIngressRulesResponse to JSON. + * @function toJSON + * @memberof google.appengine.v1.BatchUpdateIngressRulesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateIngressRulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchUpdateIngressRulesResponse + * @function getTypeUrl + * @memberof google.appengine.v1.BatchUpdateIngressRulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchUpdateIngressRulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.BatchUpdateIngressRulesResponse"; + }; + + return BatchUpdateIngressRulesResponse; + })(); + + v1.CreateIngressRuleRequest = (function() { + + /** + * Properties of a CreateIngressRuleRequest. + * @memberof google.appengine.v1 + * @interface ICreateIngressRuleRequest + * @property {string|null} [parent] CreateIngressRuleRequest parent + * @property {google.appengine.v1.IFirewallRule|null} [rule] CreateIngressRuleRequest rule + */ + + /** + * Constructs a new CreateIngressRuleRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a CreateIngressRuleRequest. + * @implements ICreateIngressRuleRequest + * @constructor + * @param {google.appengine.v1.ICreateIngressRuleRequest=} [properties] Properties to set + */ + function CreateIngressRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateIngressRuleRequest parent. + * @member {string} parent + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @instance + */ + CreateIngressRuleRequest.prototype.parent = ""; + + /** + * CreateIngressRuleRequest rule. + * @member {google.appengine.v1.IFirewallRule|null|undefined} rule + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @instance + */ + CreateIngressRuleRequest.prototype.rule = null; + + /** + * Creates a new CreateIngressRuleRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @static + * @param {google.appengine.v1.ICreateIngressRuleRequest=} [properties] Properties to set + * @returns {google.appengine.v1.CreateIngressRuleRequest} CreateIngressRuleRequest instance + */ + CreateIngressRuleRequest.create = function create(properties) { + return new CreateIngressRuleRequest(properties); + }; + + /** + * Encodes the specified CreateIngressRuleRequest message. Does not implicitly {@link google.appengine.v1.CreateIngressRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @static + * @param {google.appengine.v1.ICreateIngressRuleRequest} message CreateIngressRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIngressRuleRequest.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.rule != null && Object.hasOwnProperty.call(message, "rule")) + $root.google.appengine.v1.FirewallRule.encode(message.rule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateIngressRuleRequest message, length delimited. Does not implicitly {@link google.appengine.v1.CreateIngressRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @static + * @param {google.appengine.v1.ICreateIngressRuleRequest} message CreateIngressRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIngressRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateIngressRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.CreateIngressRuleRequest} CreateIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIngressRuleRequest.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.appengine.v1.CreateIngressRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.rule = $root.google.appengine.v1.FirewallRule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateIngressRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.CreateIngressRuleRequest} CreateIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIngressRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateIngressRuleRequest message. + * @function verify + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateIngressRuleRequest.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.rule != null && message.hasOwnProperty("rule")) { + var error = $root.google.appengine.v1.FirewallRule.verify(message.rule); + if (error) + return "rule." + error; + } + return null; + }; + + /** + * Creates a CreateIngressRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.CreateIngressRuleRequest} CreateIngressRuleRequest + */ + CreateIngressRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.CreateIngressRuleRequest) + return object; + var message = new $root.google.appengine.v1.CreateIngressRuleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.rule != null) { + if (typeof object.rule !== "object") + throw TypeError(".google.appengine.v1.CreateIngressRuleRequest.rule: object expected"); + message.rule = $root.google.appengine.v1.FirewallRule.fromObject(object.rule); + } + return message; + }; + + /** + * Creates a plain object from a CreateIngressRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @static + * @param {google.appengine.v1.CreateIngressRuleRequest} message CreateIngressRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateIngressRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.rule = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.rule != null && message.hasOwnProperty("rule")) + object.rule = $root.google.appengine.v1.FirewallRule.toObject(message.rule, options); + return object; + }; + + /** + * Converts this CreateIngressRuleRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateIngressRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateIngressRuleRequest + * @function getTypeUrl + * @memberof google.appengine.v1.CreateIngressRuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateIngressRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.CreateIngressRuleRequest"; + }; + + return CreateIngressRuleRequest; + })(); + + v1.GetIngressRuleRequest = (function() { + + /** + * Properties of a GetIngressRuleRequest. + * @memberof google.appengine.v1 + * @interface IGetIngressRuleRequest + * @property {string|null} [name] GetIngressRuleRequest name + */ + + /** + * Constructs a new GetIngressRuleRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a GetIngressRuleRequest. + * @implements IGetIngressRuleRequest + * @constructor + * @param {google.appengine.v1.IGetIngressRuleRequest=} [properties] Properties to set + */ + function GetIngressRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIngressRuleRequest name. + * @member {string} name + * @memberof google.appengine.v1.GetIngressRuleRequest + * @instance + */ + GetIngressRuleRequest.prototype.name = ""; + + /** + * Creates a new GetIngressRuleRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.GetIngressRuleRequest + * @static + * @param {google.appengine.v1.IGetIngressRuleRequest=} [properties] Properties to set + * @returns {google.appengine.v1.GetIngressRuleRequest} GetIngressRuleRequest instance + */ + GetIngressRuleRequest.create = function create(properties) { + return new GetIngressRuleRequest(properties); + }; + + /** + * Encodes the specified GetIngressRuleRequest message. Does not implicitly {@link google.appengine.v1.GetIngressRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.GetIngressRuleRequest + * @static + * @param {google.appengine.v1.IGetIngressRuleRequest} message GetIngressRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIngressRuleRequest.encode = function encode(message, writer) { + 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 GetIngressRuleRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetIngressRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.GetIngressRuleRequest + * @static + * @param {google.appengine.v1.IGetIngressRuleRequest} message GetIngressRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIngressRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIngressRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.GetIngressRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.GetIngressRuleRequest} GetIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIngressRuleRequest.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.appengine.v1.GetIngressRuleRequest(); + 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 GetIngressRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.GetIngressRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.GetIngressRuleRequest} GetIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIngressRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIngressRuleRequest message. + * @function verify + * @memberof google.appengine.v1.GetIngressRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIngressRuleRequest.verify = function verify(message) { + if (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 GetIngressRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.GetIngressRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.GetIngressRuleRequest} GetIngressRuleRequest + */ + GetIngressRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.GetIngressRuleRequest) + return object; + var message = new $root.google.appengine.v1.GetIngressRuleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetIngressRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.GetIngressRuleRequest + * @static + * @param {google.appengine.v1.GetIngressRuleRequest} message GetIngressRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIngressRuleRequest.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 GetIngressRuleRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.GetIngressRuleRequest + * @instance + * @returns {Object.} JSON object + */ + GetIngressRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIngressRuleRequest + * @function getTypeUrl + * @memberof google.appengine.v1.GetIngressRuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIngressRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.GetIngressRuleRequest"; + }; + + return GetIngressRuleRequest; + })(); + + v1.UpdateIngressRuleRequest = (function() { + + /** + * Properties of an UpdateIngressRuleRequest. + * @memberof google.appengine.v1 + * @interface IUpdateIngressRuleRequest + * @property {string|null} [name] UpdateIngressRuleRequest name + * @property {google.appengine.v1.IFirewallRule|null} [rule] UpdateIngressRuleRequest rule + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateIngressRuleRequest updateMask + */ + + /** + * Constructs a new UpdateIngressRuleRequest. + * @memberof google.appengine.v1 + * @classdesc Represents an UpdateIngressRuleRequest. + * @implements IUpdateIngressRuleRequest + * @constructor + * @param {google.appengine.v1.IUpdateIngressRuleRequest=} [properties] Properties to set + */ + function UpdateIngressRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateIngressRuleRequest name. + * @member {string} name + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @instance + */ + UpdateIngressRuleRequest.prototype.name = ""; + + /** + * UpdateIngressRuleRequest rule. + * @member {google.appengine.v1.IFirewallRule|null|undefined} rule + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @instance + */ + UpdateIngressRuleRequest.prototype.rule = null; + + /** + * UpdateIngressRuleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @instance + */ + UpdateIngressRuleRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateIngressRuleRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @static + * @param {google.appengine.v1.IUpdateIngressRuleRequest=} [properties] Properties to set + * @returns {google.appengine.v1.UpdateIngressRuleRequest} UpdateIngressRuleRequest instance + */ + UpdateIngressRuleRequest.create = function create(properties) { + return new UpdateIngressRuleRequest(properties); + }; + + /** + * Encodes the specified UpdateIngressRuleRequest message. Does not implicitly {@link google.appengine.v1.UpdateIngressRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @static + * @param {google.appengine.v1.IUpdateIngressRuleRequest} message UpdateIngressRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateIngressRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.rule != null && Object.hasOwnProperty.call(message, "rule")) + $root.google.appengine.v1.FirewallRule.encode(message.rule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateIngressRuleRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateIngressRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @static + * @param {google.appengine.v1.IUpdateIngressRuleRequest} message UpdateIngressRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateIngressRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateIngressRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.UpdateIngressRuleRequest} UpdateIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateIngressRuleRequest.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.appengine.v1.UpdateIngressRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.rule = $root.google.appengine.v1.FirewallRule.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateIngressRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.UpdateIngressRuleRequest} UpdateIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateIngressRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateIngressRuleRequest message. + * @function verify + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateIngressRuleRequest.verify = function verify(message) { + if (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.rule != null && message.hasOwnProperty("rule")) { + var error = $root.google.appengine.v1.FirewallRule.verify(message.rule); + if (error) + return "rule." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateIngressRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.UpdateIngressRuleRequest} UpdateIngressRuleRequest + */ + UpdateIngressRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.UpdateIngressRuleRequest) + return object; + var message = new $root.google.appengine.v1.UpdateIngressRuleRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.rule != null) { + if (typeof object.rule !== "object") + throw TypeError(".google.appengine.v1.UpdateIngressRuleRequest.rule: object expected"); + message.rule = $root.google.appengine.v1.FirewallRule.fromObject(object.rule); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.appengine.v1.UpdateIngressRuleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateIngressRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @static + * @param {google.appengine.v1.UpdateIngressRuleRequest} message UpdateIngressRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateIngressRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.rule = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.rule != null && message.hasOwnProperty("rule")) + object.rule = $root.google.appengine.v1.FirewallRule.toObject(message.rule, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateIngressRuleRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateIngressRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateIngressRuleRequest + * @function getTypeUrl + * @memberof google.appengine.v1.UpdateIngressRuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateIngressRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.UpdateIngressRuleRequest"; + }; + + return UpdateIngressRuleRequest; + })(); + + v1.DeleteIngressRuleRequest = (function() { + + /** + * Properties of a DeleteIngressRuleRequest. + * @memberof google.appengine.v1 + * @interface IDeleteIngressRuleRequest + * @property {string|null} [name] DeleteIngressRuleRequest name + */ + + /** + * Constructs a new DeleteIngressRuleRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a DeleteIngressRuleRequest. + * @implements IDeleteIngressRuleRequest + * @constructor + * @param {google.appengine.v1.IDeleteIngressRuleRequest=} [properties] Properties to set + */ + function DeleteIngressRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteIngressRuleRequest name. + * @member {string} name + * @memberof google.appengine.v1.DeleteIngressRuleRequest + * @instance + */ + DeleteIngressRuleRequest.prototype.name = ""; + + /** + * Creates a new DeleteIngressRuleRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.DeleteIngressRuleRequest + * @static + * @param {google.appengine.v1.IDeleteIngressRuleRequest=} [properties] Properties to set + * @returns {google.appengine.v1.DeleteIngressRuleRequest} DeleteIngressRuleRequest instance + */ + DeleteIngressRuleRequest.create = function create(properties) { + return new DeleteIngressRuleRequest(properties); + }; + + /** + * Encodes the specified DeleteIngressRuleRequest message. Does not implicitly {@link google.appengine.v1.DeleteIngressRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.DeleteIngressRuleRequest + * @static + * @param {google.appengine.v1.IDeleteIngressRuleRequest} message DeleteIngressRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIngressRuleRequest.encode = function encode(message, writer) { + 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 DeleteIngressRuleRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteIngressRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.DeleteIngressRuleRequest + * @static + * @param {google.appengine.v1.IDeleteIngressRuleRequest} message DeleteIngressRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIngressRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteIngressRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.DeleteIngressRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.DeleteIngressRuleRequest} DeleteIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIngressRuleRequest.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.appengine.v1.DeleteIngressRuleRequest(); + 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 DeleteIngressRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.DeleteIngressRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.DeleteIngressRuleRequest} DeleteIngressRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIngressRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteIngressRuleRequest message. + * @function verify + * @memberof google.appengine.v1.DeleteIngressRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteIngressRuleRequest.verify = function verify(message) { + if (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 DeleteIngressRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.DeleteIngressRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.DeleteIngressRuleRequest} DeleteIngressRuleRequest + */ + DeleteIngressRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.DeleteIngressRuleRequest) + return object; + var message = new $root.google.appengine.v1.DeleteIngressRuleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteIngressRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.DeleteIngressRuleRequest + * @static + * @param {google.appengine.v1.DeleteIngressRuleRequest} message DeleteIngressRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteIngressRuleRequest.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 DeleteIngressRuleRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.DeleteIngressRuleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteIngressRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteIngressRuleRequest + * @function getTypeUrl + * @memberof google.appengine.v1.DeleteIngressRuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteIngressRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.DeleteIngressRuleRequest"; + }; + + return DeleteIngressRuleRequest; + })(); + + v1.AuthorizedDomains = (function() { + + /** + * Constructs a new AuthorizedDomains service. + * @memberof google.appengine.v1 + * @classdesc Represents an AuthorizedDomains + * @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 AuthorizedDomains(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AuthorizedDomains.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AuthorizedDomains; + + /** + * Creates new AuthorizedDomains service using the specified rpc implementation. + * @function create + * @memberof google.appengine.v1.AuthorizedDomains + * @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 {AuthorizedDomains} RPC service. Useful where requests and/or responses are streamed. + */ + AuthorizedDomains.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedDomains|listAuthorizedDomains}. + * @memberof google.appengine.v1.AuthorizedDomains + * @typedef ListAuthorizedDomainsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.ListAuthorizedDomainsResponse} [response] ListAuthorizedDomainsResponse + */ + + /** + * Calls ListAuthorizedDomains. + * @function listAuthorizedDomains + * @memberof google.appengine.v1.AuthorizedDomains + * @instance + * @param {google.appengine.v1.IListAuthorizedDomainsRequest} request ListAuthorizedDomainsRequest message or plain object + * @param {google.appengine.v1.AuthorizedDomains.ListAuthorizedDomainsCallback} callback Node-style callback called with the error, if any, and ListAuthorizedDomainsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AuthorizedDomains.prototype.listAuthorizedDomains = function listAuthorizedDomains(request, callback) { + return this.rpcCall(listAuthorizedDomains, $root.google.appengine.v1.ListAuthorizedDomainsRequest, $root.google.appengine.v1.ListAuthorizedDomainsResponse, request, callback); + }, "name", { value: "ListAuthorizedDomains" }); + + /** + * Calls ListAuthorizedDomains. + * @function listAuthorizedDomains + * @memberof google.appengine.v1.AuthorizedDomains + * @instance + * @param {google.appengine.v1.IListAuthorizedDomainsRequest} request ListAuthorizedDomainsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AuthorizedDomains; + })(); + + v1.ListAuthorizedDomainsRequest = (function() { + + /** + * Properties of a ListAuthorizedDomainsRequest. + * @memberof google.appengine.v1 + * @interface IListAuthorizedDomainsRequest + * @property {string|null} [parent] ListAuthorizedDomainsRequest parent + * @property {number|null} [pageSize] ListAuthorizedDomainsRequest pageSize + * @property {string|null} [pageToken] ListAuthorizedDomainsRequest pageToken + */ + + /** + * Constructs a new ListAuthorizedDomainsRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a ListAuthorizedDomainsRequest. + * @implements IListAuthorizedDomainsRequest + * @constructor + * @param {google.appengine.v1.IListAuthorizedDomainsRequest=} [properties] Properties to set + */ + function ListAuthorizedDomainsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAuthorizedDomainsRequest parent. + * @member {string} parent + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @instance + */ + ListAuthorizedDomainsRequest.prototype.parent = ""; + + /** + * ListAuthorizedDomainsRequest pageSize. + * @member {number} pageSize + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @instance + */ + ListAuthorizedDomainsRequest.prototype.pageSize = 0; + + /** + * ListAuthorizedDomainsRequest pageToken. + * @member {string} pageToken + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @instance + */ + ListAuthorizedDomainsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAuthorizedDomainsRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @static + * @param {google.appengine.v1.IListAuthorizedDomainsRequest=} [properties] Properties to set + * @returns {google.appengine.v1.ListAuthorizedDomainsRequest} ListAuthorizedDomainsRequest instance + */ + ListAuthorizedDomainsRequest.create = function create(properties) { + return new ListAuthorizedDomainsRequest(properties); + }; + + /** + * Encodes the specified ListAuthorizedDomainsRequest message. Does not implicitly {@link google.appengine.v1.ListAuthorizedDomainsRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @static + * @param {google.appengine.v1.IListAuthorizedDomainsRequest} message ListAuthorizedDomainsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedDomainsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAuthorizedDomainsRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListAuthorizedDomainsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @static + * @param {google.appengine.v1.IListAuthorizedDomainsRequest} message ListAuthorizedDomainsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedDomainsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAuthorizedDomainsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListAuthorizedDomainsRequest} ListAuthorizedDomainsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedDomainsRequest.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.appengine.v1.ListAuthorizedDomainsRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAuthorizedDomainsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListAuthorizedDomainsRequest} ListAuthorizedDomainsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedDomainsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAuthorizedDomainsRequest message. + * @function verify + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAuthorizedDomainsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAuthorizedDomainsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListAuthorizedDomainsRequest} ListAuthorizedDomainsRequest + */ + ListAuthorizedDomainsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListAuthorizedDomainsRequest) + return object; + var message = new $root.google.appengine.v1.ListAuthorizedDomainsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAuthorizedDomainsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @static + * @param {google.appengine.v1.ListAuthorizedDomainsRequest} message ListAuthorizedDomainsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAuthorizedDomainsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAuthorizedDomainsRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAuthorizedDomainsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAuthorizedDomainsRequest + * @function getTypeUrl + * @memberof google.appengine.v1.ListAuthorizedDomainsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAuthorizedDomainsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListAuthorizedDomainsRequest"; + }; + + return ListAuthorizedDomainsRequest; + })(); + + v1.ListAuthorizedDomainsResponse = (function() { + + /** + * Properties of a ListAuthorizedDomainsResponse. + * @memberof google.appengine.v1 + * @interface IListAuthorizedDomainsResponse + * @property {Array.|null} [domains] ListAuthorizedDomainsResponse domains + * @property {string|null} [nextPageToken] ListAuthorizedDomainsResponse nextPageToken + */ + + /** + * Constructs a new ListAuthorizedDomainsResponse. + * @memberof google.appengine.v1 + * @classdesc Represents a ListAuthorizedDomainsResponse. + * @implements IListAuthorizedDomainsResponse + * @constructor + * @param {google.appengine.v1.IListAuthorizedDomainsResponse=} [properties] Properties to set + */ + function ListAuthorizedDomainsResponse(properties) { + this.domains = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAuthorizedDomainsResponse domains. + * @member {Array.} domains + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @instance + */ + ListAuthorizedDomainsResponse.prototype.domains = $util.emptyArray; + + /** + * ListAuthorizedDomainsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @instance + */ + ListAuthorizedDomainsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAuthorizedDomainsResponse instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @static + * @param {google.appengine.v1.IListAuthorizedDomainsResponse=} [properties] Properties to set + * @returns {google.appengine.v1.ListAuthorizedDomainsResponse} ListAuthorizedDomainsResponse instance + */ + ListAuthorizedDomainsResponse.create = function create(properties) { + return new ListAuthorizedDomainsResponse(properties); + }; + + /** + * Encodes the specified ListAuthorizedDomainsResponse message. Does not implicitly {@link google.appengine.v1.ListAuthorizedDomainsResponse.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @static + * @param {google.appengine.v1.IListAuthorizedDomainsResponse} message ListAuthorizedDomainsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedDomainsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.domains != null && message.domains.length) + for (var i = 0; i < message.domains.length; ++i) + $root.google.appengine.v1.AuthorizedDomain.encode(message.domains[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 ListAuthorizedDomainsResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListAuthorizedDomainsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @static + * @param {google.appengine.v1.IListAuthorizedDomainsResponse} message ListAuthorizedDomainsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedDomainsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAuthorizedDomainsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListAuthorizedDomainsResponse} ListAuthorizedDomainsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedDomainsResponse.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.appengine.v1.ListAuthorizedDomainsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.domains && message.domains.length)) + message.domains = []; + message.domains.push($root.google.appengine.v1.AuthorizedDomain.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAuthorizedDomainsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListAuthorizedDomainsResponse} ListAuthorizedDomainsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedDomainsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAuthorizedDomainsResponse message. + * @function verify + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAuthorizedDomainsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.domains != null && message.hasOwnProperty("domains")) { + if (!Array.isArray(message.domains)) + return "domains: array expected"; + for (var i = 0; i < message.domains.length; ++i) { + var error = $root.google.appengine.v1.AuthorizedDomain.verify(message.domains[i]); + if (error) + return "domains." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAuthorizedDomainsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListAuthorizedDomainsResponse} ListAuthorizedDomainsResponse + */ + ListAuthorizedDomainsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListAuthorizedDomainsResponse) + return object; + var message = new $root.google.appengine.v1.ListAuthorizedDomainsResponse(); + if (object.domains) { + if (!Array.isArray(object.domains)) + throw TypeError(".google.appengine.v1.ListAuthorizedDomainsResponse.domains: array expected"); + message.domains = []; + for (var i = 0; i < object.domains.length; ++i) { + if (typeof object.domains[i] !== "object") + throw TypeError(".google.appengine.v1.ListAuthorizedDomainsResponse.domains: object expected"); + message.domains[i] = $root.google.appengine.v1.AuthorizedDomain.fromObject(object.domains[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAuthorizedDomainsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @static + * @param {google.appengine.v1.ListAuthorizedDomainsResponse} message ListAuthorizedDomainsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAuthorizedDomainsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.domains = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.domains && message.domains.length) { + object.domains = []; + for (var j = 0; j < message.domains.length; ++j) + object.domains[j] = $root.google.appengine.v1.AuthorizedDomain.toObject(message.domains[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAuthorizedDomainsResponse to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAuthorizedDomainsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAuthorizedDomainsResponse + * @function getTypeUrl + * @memberof google.appengine.v1.ListAuthorizedDomainsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAuthorizedDomainsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListAuthorizedDomainsResponse"; + }; + + return ListAuthorizedDomainsResponse; + })(); + + v1.AuthorizedCertificates = (function() { + + /** + * Constructs a new AuthorizedCertificates service. + * @memberof google.appengine.v1 + * @classdesc Represents an AuthorizedCertificates + * @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 AuthorizedCertificates(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AuthorizedCertificates.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AuthorizedCertificates; + + /** + * Creates new AuthorizedCertificates service using the specified rpc implementation. + * @function create + * @memberof google.appengine.v1.AuthorizedCertificates + * @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 {AuthorizedCertificates} RPC service. Useful where requests and/or responses are streamed. + */ + AuthorizedCertificates.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedCertificates|listAuthorizedCertificates}. + * @memberof google.appengine.v1.AuthorizedCertificates + * @typedef ListAuthorizedCertificatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.ListAuthorizedCertificatesResponse} [response] ListAuthorizedCertificatesResponse + */ + + /** + * Calls ListAuthorizedCertificates. + * @function listAuthorizedCertificates + * @memberof google.appengine.v1.AuthorizedCertificates + * @instance + * @param {google.appengine.v1.IListAuthorizedCertificatesRequest} request ListAuthorizedCertificatesRequest message or plain object + * @param {google.appengine.v1.AuthorizedCertificates.ListAuthorizedCertificatesCallback} callback Node-style callback called with the error, if any, and ListAuthorizedCertificatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AuthorizedCertificates.prototype.listAuthorizedCertificates = function listAuthorizedCertificates(request, callback) { + return this.rpcCall(listAuthorizedCertificates, $root.google.appengine.v1.ListAuthorizedCertificatesRequest, $root.google.appengine.v1.ListAuthorizedCertificatesResponse, request, callback); + }, "name", { value: "ListAuthorizedCertificates" }); + + /** + * Calls ListAuthorizedCertificates. + * @function listAuthorizedCertificates + * @memberof google.appengine.v1.AuthorizedCertificates + * @instance + * @param {google.appengine.v1.IListAuthorizedCertificatesRequest} request ListAuthorizedCertificatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedCertificates|getAuthorizedCertificate}. + * @memberof google.appengine.v1.AuthorizedCertificates + * @typedef GetAuthorizedCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.AuthorizedCertificate} [response] AuthorizedCertificate + */ + + /** + * Calls GetAuthorizedCertificate. + * @function getAuthorizedCertificate + * @memberof google.appengine.v1.AuthorizedCertificates + * @instance + * @param {google.appengine.v1.IGetAuthorizedCertificateRequest} request GetAuthorizedCertificateRequest message or plain object + * @param {google.appengine.v1.AuthorizedCertificates.GetAuthorizedCertificateCallback} callback Node-style callback called with the error, if any, and AuthorizedCertificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AuthorizedCertificates.prototype.getAuthorizedCertificate = function getAuthorizedCertificate(request, callback) { + return this.rpcCall(getAuthorizedCertificate, $root.google.appengine.v1.GetAuthorizedCertificateRequest, $root.google.appengine.v1.AuthorizedCertificate, request, callback); + }, "name", { value: "GetAuthorizedCertificate" }); + + /** + * Calls GetAuthorizedCertificate. + * @function getAuthorizedCertificate + * @memberof google.appengine.v1.AuthorizedCertificates + * @instance + * @param {google.appengine.v1.IGetAuthorizedCertificateRequest} request GetAuthorizedCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedCertificates|createAuthorizedCertificate}. + * @memberof google.appengine.v1.AuthorizedCertificates + * @typedef CreateAuthorizedCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.AuthorizedCertificate} [response] AuthorizedCertificate + */ + + /** + * Calls CreateAuthorizedCertificate. + * @function createAuthorizedCertificate + * @memberof google.appengine.v1.AuthorizedCertificates + * @instance + * @param {google.appengine.v1.ICreateAuthorizedCertificateRequest} request CreateAuthorizedCertificateRequest message or plain object + * @param {google.appengine.v1.AuthorizedCertificates.CreateAuthorizedCertificateCallback} callback Node-style callback called with the error, if any, and AuthorizedCertificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AuthorizedCertificates.prototype.createAuthorizedCertificate = function createAuthorizedCertificate(request, callback) { + return this.rpcCall(createAuthorizedCertificate, $root.google.appengine.v1.CreateAuthorizedCertificateRequest, $root.google.appengine.v1.AuthorizedCertificate, request, callback); + }, "name", { value: "CreateAuthorizedCertificate" }); + + /** + * Calls CreateAuthorizedCertificate. + * @function createAuthorizedCertificate + * @memberof google.appengine.v1.AuthorizedCertificates + * @instance + * @param {google.appengine.v1.ICreateAuthorizedCertificateRequest} request CreateAuthorizedCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedCertificates|updateAuthorizedCertificate}. + * @memberof google.appengine.v1.AuthorizedCertificates + * @typedef UpdateAuthorizedCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.AuthorizedCertificate} [response] AuthorizedCertificate + */ + + /** + * Calls UpdateAuthorizedCertificate. + * @function updateAuthorizedCertificate + * @memberof google.appengine.v1.AuthorizedCertificates + * @instance + * @param {google.appengine.v1.IUpdateAuthorizedCertificateRequest} request UpdateAuthorizedCertificateRequest message or plain object + * @param {google.appengine.v1.AuthorizedCertificates.UpdateAuthorizedCertificateCallback} callback Node-style callback called with the error, if any, and AuthorizedCertificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AuthorizedCertificates.prototype.updateAuthorizedCertificate = function updateAuthorizedCertificate(request, callback) { + return this.rpcCall(updateAuthorizedCertificate, $root.google.appengine.v1.UpdateAuthorizedCertificateRequest, $root.google.appengine.v1.AuthorizedCertificate, request, callback); + }, "name", { value: "UpdateAuthorizedCertificate" }); + + /** + * Calls UpdateAuthorizedCertificate. + * @function updateAuthorizedCertificate + * @memberof google.appengine.v1.AuthorizedCertificates + * @instance + * @param {google.appengine.v1.IUpdateAuthorizedCertificateRequest} request UpdateAuthorizedCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.AuthorizedCertificates|deleteAuthorizedCertificate}. + * @memberof google.appengine.v1.AuthorizedCertificates + * @typedef DeleteAuthorizedCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAuthorizedCertificate. + * @function deleteAuthorizedCertificate + * @memberof google.appengine.v1.AuthorizedCertificates + * @instance + * @param {google.appengine.v1.IDeleteAuthorizedCertificateRequest} request DeleteAuthorizedCertificateRequest message or plain object + * @param {google.appengine.v1.AuthorizedCertificates.DeleteAuthorizedCertificateCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AuthorizedCertificates.prototype.deleteAuthorizedCertificate = function deleteAuthorizedCertificate(request, callback) { + return this.rpcCall(deleteAuthorizedCertificate, $root.google.appengine.v1.DeleteAuthorizedCertificateRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAuthorizedCertificate" }); + + /** + * Calls DeleteAuthorizedCertificate. + * @function deleteAuthorizedCertificate + * @memberof google.appengine.v1.AuthorizedCertificates + * @instance + * @param {google.appengine.v1.IDeleteAuthorizedCertificateRequest} request DeleteAuthorizedCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AuthorizedCertificates; + })(); + + v1.ListAuthorizedCertificatesRequest = (function() { + + /** + * Properties of a ListAuthorizedCertificatesRequest. + * @memberof google.appengine.v1 + * @interface IListAuthorizedCertificatesRequest + * @property {string|null} [parent] ListAuthorizedCertificatesRequest parent + * @property {google.appengine.v1.AuthorizedCertificateView|null} [view] ListAuthorizedCertificatesRequest view + * @property {number|null} [pageSize] ListAuthorizedCertificatesRequest pageSize + * @property {string|null} [pageToken] ListAuthorizedCertificatesRequest pageToken + */ + + /** + * Constructs a new ListAuthorizedCertificatesRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a ListAuthorizedCertificatesRequest. + * @implements IListAuthorizedCertificatesRequest + * @constructor + * @param {google.appengine.v1.IListAuthorizedCertificatesRequest=} [properties] Properties to set + */ + function ListAuthorizedCertificatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAuthorizedCertificatesRequest parent. + * @member {string} parent + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @instance + */ + ListAuthorizedCertificatesRequest.prototype.parent = ""; + + /** + * ListAuthorizedCertificatesRequest view. + * @member {google.appengine.v1.AuthorizedCertificateView} view + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @instance + */ + ListAuthorizedCertificatesRequest.prototype.view = 0; + + /** + * ListAuthorizedCertificatesRequest pageSize. + * @member {number} pageSize + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @instance + */ + ListAuthorizedCertificatesRequest.prototype.pageSize = 0; + + /** + * ListAuthorizedCertificatesRequest pageToken. + * @member {string} pageToken + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @instance + */ + ListAuthorizedCertificatesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAuthorizedCertificatesRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @static + * @param {google.appengine.v1.IListAuthorizedCertificatesRequest=} [properties] Properties to set + * @returns {google.appengine.v1.ListAuthorizedCertificatesRequest} ListAuthorizedCertificatesRequest instance + */ + ListAuthorizedCertificatesRequest.create = function create(properties) { + return new ListAuthorizedCertificatesRequest(properties); + }; + + /** + * Encodes the specified ListAuthorizedCertificatesRequest message. Does not implicitly {@link google.appengine.v1.ListAuthorizedCertificatesRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @static + * @param {google.appengine.v1.IListAuthorizedCertificatesRequest} message ListAuthorizedCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedCertificatesRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListAuthorizedCertificatesRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListAuthorizedCertificatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @static + * @param {google.appengine.v1.IListAuthorizedCertificatesRequest} message ListAuthorizedCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAuthorizedCertificatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListAuthorizedCertificatesRequest} ListAuthorizedCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedCertificatesRequest.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.appengine.v1.ListAuthorizedCertificatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.view = reader.int32(); + 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 ListAuthorizedCertificatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListAuthorizedCertificatesRequest} ListAuthorizedCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAuthorizedCertificatesRequest message. + * @function verify + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAuthorizedCertificatesRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + break; + } + 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 ListAuthorizedCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListAuthorizedCertificatesRequest} ListAuthorizedCertificatesRequest + */ + ListAuthorizedCertificatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListAuthorizedCertificatesRequest) + return object; + var message = new $root.google.appengine.v1.ListAuthorizedCertificatesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BASIC_CERTIFICATE": + case 0: + message.view = 0; + break; + case "FULL_CERTIFICATE": + case 1: + message.view = 1; + break; + } + 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 ListAuthorizedCertificatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @static + * @param {google.appengine.v1.ListAuthorizedCertificatesRequest} message ListAuthorizedCertificatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAuthorizedCertificatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "BASIC_CERTIFICATE" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.appengine.v1.AuthorizedCertificateView[message.view] === undefined ? message.view : $root.google.appengine.v1.AuthorizedCertificateView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListAuthorizedCertificatesRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAuthorizedCertificatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAuthorizedCertificatesRequest + * @function getTypeUrl + * @memberof google.appengine.v1.ListAuthorizedCertificatesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAuthorizedCertificatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListAuthorizedCertificatesRequest"; + }; + + return ListAuthorizedCertificatesRequest; + })(); + + v1.ListAuthorizedCertificatesResponse = (function() { + + /** + * Properties of a ListAuthorizedCertificatesResponse. + * @memberof google.appengine.v1 + * @interface IListAuthorizedCertificatesResponse + * @property {Array.|null} [certificates] ListAuthorizedCertificatesResponse certificates + * @property {string|null} [nextPageToken] ListAuthorizedCertificatesResponse nextPageToken + */ + + /** + * Constructs a new ListAuthorizedCertificatesResponse. + * @memberof google.appengine.v1 + * @classdesc Represents a ListAuthorizedCertificatesResponse. + * @implements IListAuthorizedCertificatesResponse + * @constructor + * @param {google.appengine.v1.IListAuthorizedCertificatesResponse=} [properties] Properties to set + */ + function ListAuthorizedCertificatesResponse(properties) { + this.certificates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAuthorizedCertificatesResponse certificates. + * @member {Array.} certificates + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @instance + */ + ListAuthorizedCertificatesResponse.prototype.certificates = $util.emptyArray; + + /** + * ListAuthorizedCertificatesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @instance + */ + ListAuthorizedCertificatesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAuthorizedCertificatesResponse instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @static + * @param {google.appengine.v1.IListAuthorizedCertificatesResponse=} [properties] Properties to set + * @returns {google.appengine.v1.ListAuthorizedCertificatesResponse} ListAuthorizedCertificatesResponse instance + */ + ListAuthorizedCertificatesResponse.create = function create(properties) { + return new ListAuthorizedCertificatesResponse(properties); + }; + + /** + * Encodes the specified ListAuthorizedCertificatesResponse message. Does not implicitly {@link google.appengine.v1.ListAuthorizedCertificatesResponse.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @static + * @param {google.appengine.v1.IListAuthorizedCertificatesResponse} message ListAuthorizedCertificatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedCertificatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificates != null && message.certificates.length) + for (var i = 0; i < message.certificates.length; ++i) + $root.google.appengine.v1.AuthorizedCertificate.encode(message.certificates[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 ListAuthorizedCertificatesResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListAuthorizedCertificatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @static + * @param {google.appengine.v1.IListAuthorizedCertificatesResponse} message ListAuthorizedCertificatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthorizedCertificatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAuthorizedCertificatesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListAuthorizedCertificatesResponse} ListAuthorizedCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedCertificatesResponse.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.appengine.v1.ListAuthorizedCertificatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.certificates && message.certificates.length)) + message.certificates = []; + message.certificates.push($root.google.appengine.v1.AuthorizedCertificate.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAuthorizedCertificatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListAuthorizedCertificatesResponse} ListAuthorizedCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthorizedCertificatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAuthorizedCertificatesResponse message. + * @function verify + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAuthorizedCertificatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificates != null && message.hasOwnProperty("certificates")) { + if (!Array.isArray(message.certificates)) + return "certificates: array expected"; + for (var i = 0; i < message.certificates.length; ++i) { + var error = $root.google.appengine.v1.AuthorizedCertificate.verify(message.certificates[i]); + if (error) + return "certificates." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAuthorizedCertificatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListAuthorizedCertificatesResponse} ListAuthorizedCertificatesResponse + */ + ListAuthorizedCertificatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListAuthorizedCertificatesResponse) + return object; + var message = new $root.google.appengine.v1.ListAuthorizedCertificatesResponse(); + if (object.certificates) { + if (!Array.isArray(object.certificates)) + throw TypeError(".google.appengine.v1.ListAuthorizedCertificatesResponse.certificates: array expected"); + message.certificates = []; + for (var i = 0; i < object.certificates.length; ++i) { + if (typeof object.certificates[i] !== "object") + throw TypeError(".google.appengine.v1.ListAuthorizedCertificatesResponse.certificates: object expected"); + message.certificates[i] = $root.google.appengine.v1.AuthorizedCertificate.fromObject(object.certificates[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAuthorizedCertificatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @static + * @param {google.appengine.v1.ListAuthorizedCertificatesResponse} message ListAuthorizedCertificatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAuthorizedCertificatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.certificates = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.certificates && message.certificates.length) { + object.certificates = []; + for (var j = 0; j < message.certificates.length; ++j) + object.certificates[j] = $root.google.appengine.v1.AuthorizedCertificate.toObject(message.certificates[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAuthorizedCertificatesResponse to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAuthorizedCertificatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAuthorizedCertificatesResponse + * @function getTypeUrl + * @memberof google.appengine.v1.ListAuthorizedCertificatesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAuthorizedCertificatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListAuthorizedCertificatesResponse"; + }; + + return ListAuthorizedCertificatesResponse; + })(); + + v1.GetAuthorizedCertificateRequest = (function() { + + /** + * Properties of a GetAuthorizedCertificateRequest. + * @memberof google.appengine.v1 + * @interface IGetAuthorizedCertificateRequest + * @property {string|null} [name] GetAuthorizedCertificateRequest name + * @property {google.appengine.v1.AuthorizedCertificateView|null} [view] GetAuthorizedCertificateRequest view + */ + + /** + * Constructs a new GetAuthorizedCertificateRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a GetAuthorizedCertificateRequest. + * @implements IGetAuthorizedCertificateRequest + * @constructor + * @param {google.appengine.v1.IGetAuthorizedCertificateRequest=} [properties] Properties to set + */ + function GetAuthorizedCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAuthorizedCertificateRequest name. + * @member {string} name + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @instance + */ + GetAuthorizedCertificateRequest.prototype.name = ""; + + /** + * GetAuthorizedCertificateRequest view. + * @member {google.appengine.v1.AuthorizedCertificateView} view + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @instance + */ + GetAuthorizedCertificateRequest.prototype.view = 0; + + /** + * Creates a new GetAuthorizedCertificateRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.IGetAuthorizedCertificateRequest=} [properties] Properties to set + * @returns {google.appengine.v1.GetAuthorizedCertificateRequest} GetAuthorizedCertificateRequest instance + */ + GetAuthorizedCertificateRequest.create = function create(properties) { + return new GetAuthorizedCertificateRequest(properties); + }; + + /** + * Encodes the specified GetAuthorizedCertificateRequest message. Does not implicitly {@link google.appengine.v1.GetAuthorizedCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.IGetAuthorizedCertificateRequest} message GetAuthorizedCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAuthorizedCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetAuthorizedCertificateRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetAuthorizedCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.IGetAuthorizedCertificateRequest} message GetAuthorizedCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAuthorizedCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAuthorizedCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.GetAuthorizedCertificateRequest} GetAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAuthorizedCertificateRequest.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.appengine.v1.GetAuthorizedCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAuthorizedCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.GetAuthorizedCertificateRequest} GetAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAuthorizedCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAuthorizedCertificateRequest message. + * @function verify + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAuthorizedCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a GetAuthorizedCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.GetAuthorizedCertificateRequest} GetAuthorizedCertificateRequest + */ + GetAuthorizedCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.GetAuthorizedCertificateRequest) + return object; + var message = new $root.google.appengine.v1.GetAuthorizedCertificateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BASIC_CERTIFICATE": + case 0: + message.view = 0; + break; + case "FULL_CERTIFICATE": + case 1: + message.view = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetAuthorizedCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.GetAuthorizedCertificateRequest} message GetAuthorizedCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAuthorizedCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "BASIC_CERTIFICATE" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.appengine.v1.AuthorizedCertificateView[message.view] === undefined ? message.view : $root.google.appengine.v1.AuthorizedCertificateView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetAuthorizedCertificateRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + GetAuthorizedCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAuthorizedCertificateRequest + * @function getTypeUrl + * @memberof google.appengine.v1.GetAuthorizedCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAuthorizedCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.GetAuthorizedCertificateRequest"; + }; + + return GetAuthorizedCertificateRequest; + })(); + + /** + * AuthorizedCertificateView enum. + * @name google.appengine.v1.AuthorizedCertificateView + * @enum {number} + * @property {number} BASIC_CERTIFICATE=0 BASIC_CERTIFICATE value + * @property {number} FULL_CERTIFICATE=1 FULL_CERTIFICATE value + */ + v1.AuthorizedCertificateView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BASIC_CERTIFICATE"] = 0; + values[valuesById[1] = "FULL_CERTIFICATE"] = 1; + return values; + })(); + + v1.CreateAuthorizedCertificateRequest = (function() { + + /** + * Properties of a CreateAuthorizedCertificateRequest. + * @memberof google.appengine.v1 + * @interface ICreateAuthorizedCertificateRequest + * @property {string|null} [parent] CreateAuthorizedCertificateRequest parent + * @property {google.appengine.v1.IAuthorizedCertificate|null} [certificate] CreateAuthorizedCertificateRequest certificate + */ + + /** + * Constructs a new CreateAuthorizedCertificateRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a CreateAuthorizedCertificateRequest. + * @implements ICreateAuthorizedCertificateRequest + * @constructor + * @param {google.appengine.v1.ICreateAuthorizedCertificateRequest=} [properties] Properties to set + */ + function CreateAuthorizedCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAuthorizedCertificateRequest parent. + * @member {string} parent + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @instance + */ + CreateAuthorizedCertificateRequest.prototype.parent = ""; + + /** + * CreateAuthorizedCertificateRequest certificate. + * @member {google.appengine.v1.IAuthorizedCertificate|null|undefined} certificate + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @instance + */ + CreateAuthorizedCertificateRequest.prototype.certificate = null; + + /** + * Creates a new CreateAuthorizedCertificateRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.ICreateAuthorizedCertificateRequest=} [properties] Properties to set + * @returns {google.appengine.v1.CreateAuthorizedCertificateRequest} CreateAuthorizedCertificateRequest instance + */ + CreateAuthorizedCertificateRequest.create = function create(properties) { + return new CreateAuthorizedCertificateRequest(properties); + }; + + /** + * Encodes the specified CreateAuthorizedCertificateRequest message. Does not implicitly {@link google.appengine.v1.CreateAuthorizedCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.ICreateAuthorizedCertificateRequest} message CreateAuthorizedCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthorizedCertificateRequest.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.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + $root.google.appengine.v1.AuthorizedCertificate.encode(message.certificate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAuthorizedCertificateRequest message, length delimited. Does not implicitly {@link google.appengine.v1.CreateAuthorizedCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.ICreateAuthorizedCertificateRequest} message CreateAuthorizedCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthorizedCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAuthorizedCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.CreateAuthorizedCertificateRequest} CreateAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthorizedCertificateRequest.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.appengine.v1.CreateAuthorizedCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.certificate = $root.google.appengine.v1.AuthorizedCertificate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAuthorizedCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.CreateAuthorizedCertificateRequest} CreateAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthorizedCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAuthorizedCertificateRequest message. + * @function verify + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAuthorizedCertificateRequest.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.certificate != null && message.hasOwnProperty("certificate")) { + var error = $root.google.appengine.v1.AuthorizedCertificate.verify(message.certificate); + if (error) + return "certificate." + error; + } + return null; + }; + + /** + * Creates a CreateAuthorizedCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.CreateAuthorizedCertificateRequest} CreateAuthorizedCertificateRequest + */ + CreateAuthorizedCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.CreateAuthorizedCertificateRequest) + return object; + var message = new $root.google.appengine.v1.CreateAuthorizedCertificateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.certificate != null) { + if (typeof object.certificate !== "object") + throw TypeError(".google.appengine.v1.CreateAuthorizedCertificateRequest.certificate: object expected"); + message.certificate = $root.google.appengine.v1.AuthorizedCertificate.fromObject(object.certificate); + } + return message; + }; + + /** + * Creates a plain object from a CreateAuthorizedCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.CreateAuthorizedCertificateRequest} message CreateAuthorizedCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAuthorizedCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.certificate = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.certificate != null && message.hasOwnProperty("certificate")) + object.certificate = $root.google.appengine.v1.AuthorizedCertificate.toObject(message.certificate, options); + return object; + }; + + /** + * Converts this CreateAuthorizedCertificateRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAuthorizedCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAuthorizedCertificateRequest + * @function getTypeUrl + * @memberof google.appengine.v1.CreateAuthorizedCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAuthorizedCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.CreateAuthorizedCertificateRequest"; + }; + + return CreateAuthorizedCertificateRequest; + })(); + + v1.UpdateAuthorizedCertificateRequest = (function() { + + /** + * Properties of an UpdateAuthorizedCertificateRequest. + * @memberof google.appengine.v1 + * @interface IUpdateAuthorizedCertificateRequest + * @property {string|null} [name] UpdateAuthorizedCertificateRequest name + * @property {google.appengine.v1.IAuthorizedCertificate|null} [certificate] UpdateAuthorizedCertificateRequest certificate + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAuthorizedCertificateRequest updateMask + */ + + /** + * Constructs a new UpdateAuthorizedCertificateRequest. + * @memberof google.appengine.v1 + * @classdesc Represents an UpdateAuthorizedCertificateRequest. + * @implements IUpdateAuthorizedCertificateRequest + * @constructor + * @param {google.appengine.v1.IUpdateAuthorizedCertificateRequest=} [properties] Properties to set + */ + function UpdateAuthorizedCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAuthorizedCertificateRequest name. + * @member {string} name + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @instance + */ + UpdateAuthorizedCertificateRequest.prototype.name = ""; + + /** + * UpdateAuthorizedCertificateRequest certificate. + * @member {google.appengine.v1.IAuthorizedCertificate|null|undefined} certificate + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @instance + */ + UpdateAuthorizedCertificateRequest.prototype.certificate = null; + + /** + * UpdateAuthorizedCertificateRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @instance + */ + UpdateAuthorizedCertificateRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAuthorizedCertificateRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.IUpdateAuthorizedCertificateRequest=} [properties] Properties to set + * @returns {google.appengine.v1.UpdateAuthorizedCertificateRequest} UpdateAuthorizedCertificateRequest instance + */ + UpdateAuthorizedCertificateRequest.create = function create(properties) { + return new UpdateAuthorizedCertificateRequest(properties); + }; + + /** + * Encodes the specified UpdateAuthorizedCertificateRequest message. Does not implicitly {@link google.appengine.v1.UpdateAuthorizedCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.IUpdateAuthorizedCertificateRequest} message UpdateAuthorizedCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthorizedCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + $root.google.appengine.v1.AuthorizedCertificate.encode(message.certificate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAuthorizedCertificateRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateAuthorizedCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.IUpdateAuthorizedCertificateRequest} message UpdateAuthorizedCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthorizedCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAuthorizedCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.UpdateAuthorizedCertificateRequest} UpdateAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthorizedCertificateRequest.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.appengine.v1.UpdateAuthorizedCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.certificate = $root.google.appengine.v1.AuthorizedCertificate.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAuthorizedCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.UpdateAuthorizedCertificateRequest} UpdateAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthorizedCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAuthorizedCertificateRequest message. + * @function verify + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAuthorizedCertificateRequest.verify = function verify(message) { + if (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.certificate != null && message.hasOwnProperty("certificate")) { + var error = $root.google.appengine.v1.AuthorizedCertificate.verify(message.certificate); + if (error) + return "certificate." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAuthorizedCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.UpdateAuthorizedCertificateRequest} UpdateAuthorizedCertificateRequest + */ + UpdateAuthorizedCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.UpdateAuthorizedCertificateRequest) + return object; + var message = new $root.google.appengine.v1.UpdateAuthorizedCertificateRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.certificate != null) { + if (typeof object.certificate !== "object") + throw TypeError(".google.appengine.v1.UpdateAuthorizedCertificateRequest.certificate: object expected"); + message.certificate = $root.google.appengine.v1.AuthorizedCertificate.fromObject(object.certificate); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.appengine.v1.UpdateAuthorizedCertificateRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAuthorizedCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.UpdateAuthorizedCertificateRequest} message UpdateAuthorizedCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAuthorizedCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.certificate = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.certificate != null && message.hasOwnProperty("certificate")) + object.certificate = $root.google.appengine.v1.AuthorizedCertificate.toObject(message.certificate, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAuthorizedCertificateRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAuthorizedCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAuthorizedCertificateRequest + * @function getTypeUrl + * @memberof google.appengine.v1.UpdateAuthorizedCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAuthorizedCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.UpdateAuthorizedCertificateRequest"; + }; + + return UpdateAuthorizedCertificateRequest; + })(); + + v1.DeleteAuthorizedCertificateRequest = (function() { + + /** + * Properties of a DeleteAuthorizedCertificateRequest. + * @memberof google.appengine.v1 + * @interface IDeleteAuthorizedCertificateRequest + * @property {string|null} [name] DeleteAuthorizedCertificateRequest name + */ + + /** + * Constructs a new DeleteAuthorizedCertificateRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a DeleteAuthorizedCertificateRequest. + * @implements IDeleteAuthorizedCertificateRequest + * @constructor + * @param {google.appengine.v1.IDeleteAuthorizedCertificateRequest=} [properties] Properties to set + */ + function DeleteAuthorizedCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAuthorizedCertificateRequest name. + * @member {string} name + * @memberof google.appengine.v1.DeleteAuthorizedCertificateRequest + * @instance + */ + DeleteAuthorizedCertificateRequest.prototype.name = ""; + + /** + * Creates a new DeleteAuthorizedCertificateRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.DeleteAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.IDeleteAuthorizedCertificateRequest=} [properties] Properties to set + * @returns {google.appengine.v1.DeleteAuthorizedCertificateRequest} DeleteAuthorizedCertificateRequest instance + */ + DeleteAuthorizedCertificateRequest.create = function create(properties) { + return new DeleteAuthorizedCertificateRequest(properties); + }; + + /** + * Encodes the specified DeleteAuthorizedCertificateRequest message. Does not implicitly {@link google.appengine.v1.DeleteAuthorizedCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.DeleteAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.IDeleteAuthorizedCertificateRequest} message DeleteAuthorizedCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAuthorizedCertificateRequest.encode = function encode(message, writer) { + 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 DeleteAuthorizedCertificateRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteAuthorizedCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.DeleteAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.IDeleteAuthorizedCertificateRequest} message DeleteAuthorizedCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAuthorizedCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAuthorizedCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.DeleteAuthorizedCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.DeleteAuthorizedCertificateRequest} DeleteAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAuthorizedCertificateRequest.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.appengine.v1.DeleteAuthorizedCertificateRequest(); + 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 DeleteAuthorizedCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.DeleteAuthorizedCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.DeleteAuthorizedCertificateRequest} DeleteAuthorizedCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAuthorizedCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAuthorizedCertificateRequest message. + * @function verify + * @memberof google.appengine.v1.DeleteAuthorizedCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAuthorizedCertificateRequest.verify = function verify(message) { + if (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 DeleteAuthorizedCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.DeleteAuthorizedCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.DeleteAuthorizedCertificateRequest} DeleteAuthorizedCertificateRequest + */ + DeleteAuthorizedCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.DeleteAuthorizedCertificateRequest) + return object; + var message = new $root.google.appengine.v1.DeleteAuthorizedCertificateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAuthorizedCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.DeleteAuthorizedCertificateRequest + * @static + * @param {google.appengine.v1.DeleteAuthorizedCertificateRequest} message DeleteAuthorizedCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAuthorizedCertificateRequest.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 DeleteAuthorizedCertificateRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.DeleteAuthorizedCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAuthorizedCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAuthorizedCertificateRequest + * @function getTypeUrl + * @memberof google.appengine.v1.DeleteAuthorizedCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAuthorizedCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.DeleteAuthorizedCertificateRequest"; + }; + + return DeleteAuthorizedCertificateRequest; + })(); + + v1.DomainMappings = (function() { + + /** + * Constructs a new DomainMappings service. + * @memberof google.appengine.v1 + * @classdesc Represents a DomainMappings + * @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 DomainMappings(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DomainMappings.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DomainMappings; + + /** + * Creates new DomainMappings service using the specified rpc implementation. + * @function create + * @memberof google.appengine.v1.DomainMappings + * @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 {DomainMappings} RPC service. Useful where requests and/or responses are streamed. + */ + DomainMappings.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.appengine.v1.DomainMappings|listDomainMappings}. + * @memberof google.appengine.v1.DomainMappings + * @typedef ListDomainMappingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.ListDomainMappingsResponse} [response] ListDomainMappingsResponse + */ + + /** + * Calls ListDomainMappings. + * @function listDomainMappings + * @memberof google.appengine.v1.DomainMappings + * @instance + * @param {google.appengine.v1.IListDomainMappingsRequest} request ListDomainMappingsRequest message or plain object + * @param {google.appengine.v1.DomainMappings.ListDomainMappingsCallback} callback Node-style callback called with the error, if any, and ListDomainMappingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DomainMappings.prototype.listDomainMappings = function listDomainMappings(request, callback) { + return this.rpcCall(listDomainMappings, $root.google.appengine.v1.ListDomainMappingsRequest, $root.google.appengine.v1.ListDomainMappingsResponse, request, callback); + }, "name", { value: "ListDomainMappings" }); + + /** + * Calls ListDomainMappings. + * @function listDomainMappings + * @memberof google.appengine.v1.DomainMappings + * @instance + * @param {google.appengine.v1.IListDomainMappingsRequest} request ListDomainMappingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.DomainMappings|getDomainMapping}. + * @memberof google.appengine.v1.DomainMappings + * @typedef GetDomainMappingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.appengine.v1.DomainMapping} [response] DomainMapping + */ + + /** + * Calls GetDomainMapping. + * @function getDomainMapping + * @memberof google.appengine.v1.DomainMappings + * @instance + * @param {google.appengine.v1.IGetDomainMappingRequest} request GetDomainMappingRequest message or plain object + * @param {google.appengine.v1.DomainMappings.GetDomainMappingCallback} callback Node-style callback called with the error, if any, and DomainMapping + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DomainMappings.prototype.getDomainMapping = function getDomainMapping(request, callback) { + return this.rpcCall(getDomainMapping, $root.google.appengine.v1.GetDomainMappingRequest, $root.google.appengine.v1.DomainMapping, request, callback); + }, "name", { value: "GetDomainMapping" }); + + /** + * Calls GetDomainMapping. + * @function getDomainMapping + * @memberof google.appengine.v1.DomainMappings + * @instance + * @param {google.appengine.v1.IGetDomainMappingRequest} request GetDomainMappingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.DomainMappings|createDomainMapping}. + * @memberof google.appengine.v1.DomainMappings + * @typedef CreateDomainMappingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDomainMapping. + * @function createDomainMapping + * @memberof google.appengine.v1.DomainMappings + * @instance + * @param {google.appengine.v1.ICreateDomainMappingRequest} request CreateDomainMappingRequest message or plain object + * @param {google.appengine.v1.DomainMappings.CreateDomainMappingCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DomainMappings.prototype.createDomainMapping = function createDomainMapping(request, callback) { + return this.rpcCall(createDomainMapping, $root.google.appengine.v1.CreateDomainMappingRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDomainMapping" }); + + /** + * Calls CreateDomainMapping. + * @function createDomainMapping + * @memberof google.appengine.v1.DomainMappings + * @instance + * @param {google.appengine.v1.ICreateDomainMappingRequest} request CreateDomainMappingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.DomainMappings|updateDomainMapping}. + * @memberof google.appengine.v1.DomainMappings + * @typedef UpdateDomainMappingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDomainMapping. + * @function updateDomainMapping + * @memberof google.appengine.v1.DomainMappings + * @instance + * @param {google.appengine.v1.IUpdateDomainMappingRequest} request UpdateDomainMappingRequest message or plain object + * @param {google.appengine.v1.DomainMappings.UpdateDomainMappingCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DomainMappings.prototype.updateDomainMapping = function updateDomainMapping(request, callback) { + return this.rpcCall(updateDomainMapping, $root.google.appengine.v1.UpdateDomainMappingRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDomainMapping" }); + + /** + * Calls UpdateDomainMapping. + * @function updateDomainMapping + * @memberof google.appengine.v1.DomainMappings + * @instance + * @param {google.appengine.v1.IUpdateDomainMappingRequest} request UpdateDomainMappingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.appengine.v1.DomainMappings|deleteDomainMapping}. + * @memberof google.appengine.v1.DomainMappings + * @typedef DeleteDomainMappingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDomainMapping. + * @function deleteDomainMapping + * @memberof google.appengine.v1.DomainMappings + * @instance + * @param {google.appengine.v1.IDeleteDomainMappingRequest} request DeleteDomainMappingRequest message or plain object + * @param {google.appengine.v1.DomainMappings.DeleteDomainMappingCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DomainMappings.prototype.deleteDomainMapping = function deleteDomainMapping(request, callback) { + return this.rpcCall(deleteDomainMapping, $root.google.appengine.v1.DeleteDomainMappingRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDomainMapping" }); + + /** + * Calls DeleteDomainMapping. + * @function deleteDomainMapping + * @memberof google.appengine.v1.DomainMappings + * @instance + * @param {google.appengine.v1.IDeleteDomainMappingRequest} request DeleteDomainMappingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DomainMappings; + })(); + + v1.ListDomainMappingsRequest = (function() { + + /** + * Properties of a ListDomainMappingsRequest. + * @memberof google.appengine.v1 + * @interface IListDomainMappingsRequest + * @property {string|null} [parent] ListDomainMappingsRequest parent + * @property {number|null} [pageSize] ListDomainMappingsRequest pageSize + * @property {string|null} [pageToken] ListDomainMappingsRequest pageToken + */ + + /** + * Constructs a new ListDomainMappingsRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a ListDomainMappingsRequest. + * @implements IListDomainMappingsRequest + * @constructor + * @param {google.appengine.v1.IListDomainMappingsRequest=} [properties] Properties to set + */ + function ListDomainMappingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDomainMappingsRequest parent. + * @member {string} parent + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @instance + */ + ListDomainMappingsRequest.prototype.parent = ""; + + /** + * ListDomainMappingsRequest pageSize. + * @member {number} pageSize + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @instance + */ + ListDomainMappingsRequest.prototype.pageSize = 0; + + /** + * ListDomainMappingsRequest pageToken. + * @member {string} pageToken + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @instance + */ + ListDomainMappingsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDomainMappingsRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @static + * @param {google.appengine.v1.IListDomainMappingsRequest=} [properties] Properties to set + * @returns {google.appengine.v1.ListDomainMappingsRequest} ListDomainMappingsRequest instance + */ + ListDomainMappingsRequest.create = function create(properties) { + return new ListDomainMappingsRequest(properties); + }; + + /** + * Encodes the specified ListDomainMappingsRequest message. Does not implicitly {@link google.appengine.v1.ListDomainMappingsRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @static + * @param {google.appengine.v1.IListDomainMappingsRequest} message ListDomainMappingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDomainMappingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDomainMappingsRequest message, length delimited. Does not implicitly {@link google.appengine.v1.ListDomainMappingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @static + * @param {google.appengine.v1.IListDomainMappingsRequest} message ListDomainMappingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDomainMappingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDomainMappingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListDomainMappingsRequest} ListDomainMappingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDomainMappingsRequest.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.appengine.v1.ListDomainMappingsRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDomainMappingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListDomainMappingsRequest} ListDomainMappingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDomainMappingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDomainMappingsRequest message. + * @function verify + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDomainMappingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListDomainMappingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListDomainMappingsRequest} ListDomainMappingsRequest + */ + ListDomainMappingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListDomainMappingsRequest) + return object; + var message = new $root.google.appengine.v1.ListDomainMappingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListDomainMappingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @static + * @param {google.appengine.v1.ListDomainMappingsRequest} message ListDomainMappingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDomainMappingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDomainMappingsRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDomainMappingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDomainMappingsRequest + * @function getTypeUrl + * @memberof google.appengine.v1.ListDomainMappingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDomainMappingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListDomainMappingsRequest"; + }; + + return ListDomainMappingsRequest; + })(); + + v1.ListDomainMappingsResponse = (function() { + + /** + * Properties of a ListDomainMappingsResponse. + * @memberof google.appengine.v1 + * @interface IListDomainMappingsResponse + * @property {Array.|null} [domainMappings] ListDomainMappingsResponse domainMappings + * @property {string|null} [nextPageToken] ListDomainMappingsResponse nextPageToken + */ + + /** + * Constructs a new ListDomainMappingsResponse. + * @memberof google.appengine.v1 + * @classdesc Represents a ListDomainMappingsResponse. + * @implements IListDomainMappingsResponse + * @constructor + * @param {google.appengine.v1.IListDomainMappingsResponse=} [properties] Properties to set + */ + function ListDomainMappingsResponse(properties) { + this.domainMappings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDomainMappingsResponse domainMappings. + * @member {Array.} domainMappings + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @instance + */ + ListDomainMappingsResponse.prototype.domainMappings = $util.emptyArray; + + /** + * ListDomainMappingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @instance + */ + ListDomainMappingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDomainMappingsResponse instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @static + * @param {google.appengine.v1.IListDomainMappingsResponse=} [properties] Properties to set + * @returns {google.appengine.v1.ListDomainMappingsResponse} ListDomainMappingsResponse instance + */ + ListDomainMappingsResponse.create = function create(properties) { + return new ListDomainMappingsResponse(properties); + }; + + /** + * Encodes the specified ListDomainMappingsResponse message. Does not implicitly {@link google.appengine.v1.ListDomainMappingsResponse.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @static + * @param {google.appengine.v1.IListDomainMappingsResponse} message ListDomainMappingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDomainMappingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.domainMappings != null && message.domainMappings.length) + for (var i = 0; i < message.domainMappings.length; ++i) + $root.google.appengine.v1.DomainMapping.encode(message.domainMappings[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 ListDomainMappingsResponse message, length delimited. Does not implicitly {@link google.appengine.v1.ListDomainMappingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @static + * @param {google.appengine.v1.IListDomainMappingsResponse} message ListDomainMappingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDomainMappingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDomainMappingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ListDomainMappingsResponse} ListDomainMappingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDomainMappingsResponse.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.appengine.v1.ListDomainMappingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.domainMappings && message.domainMappings.length)) + message.domainMappings = []; + message.domainMappings.push($root.google.appengine.v1.DomainMapping.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDomainMappingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ListDomainMappingsResponse} ListDomainMappingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDomainMappingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDomainMappingsResponse message. + * @function verify + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDomainMappingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.domainMappings != null && message.hasOwnProperty("domainMappings")) { + if (!Array.isArray(message.domainMappings)) + return "domainMappings: array expected"; + for (var i = 0; i < message.domainMappings.length; ++i) { + var error = $root.google.appengine.v1.DomainMapping.verify(message.domainMappings[i]); + if (error) + return "domainMappings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDomainMappingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ListDomainMappingsResponse} ListDomainMappingsResponse + */ + ListDomainMappingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ListDomainMappingsResponse) + return object; + var message = new $root.google.appengine.v1.ListDomainMappingsResponse(); + if (object.domainMappings) { + if (!Array.isArray(object.domainMappings)) + throw TypeError(".google.appengine.v1.ListDomainMappingsResponse.domainMappings: array expected"); + message.domainMappings = []; + for (var i = 0; i < object.domainMappings.length; ++i) { + if (typeof object.domainMappings[i] !== "object") + throw TypeError(".google.appengine.v1.ListDomainMappingsResponse.domainMappings: object expected"); + message.domainMappings[i] = $root.google.appengine.v1.DomainMapping.fromObject(object.domainMappings[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDomainMappingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @static + * @param {google.appengine.v1.ListDomainMappingsResponse} message ListDomainMappingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDomainMappingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.domainMappings = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.domainMappings && message.domainMappings.length) { + object.domainMappings = []; + for (var j = 0; j < message.domainMappings.length; ++j) + object.domainMappings[j] = $root.google.appengine.v1.DomainMapping.toObject(message.domainMappings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDomainMappingsResponse to JSON. + * @function toJSON + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDomainMappingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDomainMappingsResponse + * @function getTypeUrl + * @memberof google.appengine.v1.ListDomainMappingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDomainMappingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ListDomainMappingsResponse"; + }; + + return ListDomainMappingsResponse; + })(); + + v1.GetDomainMappingRequest = (function() { + + /** + * Properties of a GetDomainMappingRequest. + * @memberof google.appengine.v1 + * @interface IGetDomainMappingRequest + * @property {string|null} [name] GetDomainMappingRequest name + */ + + /** + * Constructs a new GetDomainMappingRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a GetDomainMappingRequest. + * @implements IGetDomainMappingRequest + * @constructor + * @param {google.appengine.v1.IGetDomainMappingRequest=} [properties] Properties to set + */ + function GetDomainMappingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDomainMappingRequest name. + * @member {string} name + * @memberof google.appengine.v1.GetDomainMappingRequest + * @instance + */ + GetDomainMappingRequest.prototype.name = ""; + + /** + * Creates a new GetDomainMappingRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.GetDomainMappingRequest + * @static + * @param {google.appengine.v1.IGetDomainMappingRequest=} [properties] Properties to set + * @returns {google.appengine.v1.GetDomainMappingRequest} GetDomainMappingRequest instance + */ + GetDomainMappingRequest.create = function create(properties) { + return new GetDomainMappingRequest(properties); + }; + + /** + * Encodes the specified GetDomainMappingRequest message. Does not implicitly {@link google.appengine.v1.GetDomainMappingRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.GetDomainMappingRequest + * @static + * @param {google.appengine.v1.IGetDomainMappingRequest} message GetDomainMappingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDomainMappingRequest.encode = function encode(message, writer) { + 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 GetDomainMappingRequest message, length delimited. Does not implicitly {@link google.appengine.v1.GetDomainMappingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.GetDomainMappingRequest + * @static + * @param {google.appengine.v1.IGetDomainMappingRequest} message GetDomainMappingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDomainMappingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDomainMappingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.GetDomainMappingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.GetDomainMappingRequest} GetDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDomainMappingRequest.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.appengine.v1.GetDomainMappingRequest(); + 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 GetDomainMappingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.GetDomainMappingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.GetDomainMappingRequest} GetDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDomainMappingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDomainMappingRequest message. + * @function verify + * @memberof google.appengine.v1.GetDomainMappingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDomainMappingRequest.verify = function verify(message) { + if (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 GetDomainMappingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.GetDomainMappingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.GetDomainMappingRequest} GetDomainMappingRequest + */ + GetDomainMappingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.GetDomainMappingRequest) + return object; + var message = new $root.google.appengine.v1.GetDomainMappingRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDomainMappingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.GetDomainMappingRequest + * @static + * @param {google.appengine.v1.GetDomainMappingRequest} message GetDomainMappingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDomainMappingRequest.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 GetDomainMappingRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.GetDomainMappingRequest + * @instance + * @returns {Object.} JSON object + */ + GetDomainMappingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDomainMappingRequest + * @function getTypeUrl + * @memberof google.appengine.v1.GetDomainMappingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDomainMappingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.GetDomainMappingRequest"; + }; + + return GetDomainMappingRequest; + })(); + + /** + * DomainOverrideStrategy enum. + * @name google.appengine.v1.DomainOverrideStrategy + * @enum {number} + * @property {number} UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY=0 UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY value + * @property {number} STRICT=1 STRICT value + * @property {number} OVERRIDE=2 OVERRIDE value + */ + v1.DomainOverrideStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY"] = 0; + values[valuesById[1] = "STRICT"] = 1; + values[valuesById[2] = "OVERRIDE"] = 2; + return values; + })(); + + v1.CreateDomainMappingRequest = (function() { + + /** + * Properties of a CreateDomainMappingRequest. + * @memberof google.appengine.v1 + * @interface ICreateDomainMappingRequest + * @property {string|null} [parent] CreateDomainMappingRequest parent + * @property {google.appengine.v1.IDomainMapping|null} [domainMapping] CreateDomainMappingRequest domainMapping + * @property {google.appengine.v1.DomainOverrideStrategy|null} [overrideStrategy] CreateDomainMappingRequest overrideStrategy + */ + + /** + * Constructs a new CreateDomainMappingRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a CreateDomainMappingRequest. + * @implements ICreateDomainMappingRequest + * @constructor + * @param {google.appengine.v1.ICreateDomainMappingRequest=} [properties] Properties to set + */ + function CreateDomainMappingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDomainMappingRequest parent. + * @member {string} parent + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @instance + */ + CreateDomainMappingRequest.prototype.parent = ""; + + /** + * CreateDomainMappingRequest domainMapping. + * @member {google.appengine.v1.IDomainMapping|null|undefined} domainMapping + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @instance + */ + CreateDomainMappingRequest.prototype.domainMapping = null; + + /** + * CreateDomainMappingRequest overrideStrategy. + * @member {google.appengine.v1.DomainOverrideStrategy} overrideStrategy + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @instance + */ + CreateDomainMappingRequest.prototype.overrideStrategy = 0; + + /** + * Creates a new CreateDomainMappingRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @static + * @param {google.appengine.v1.ICreateDomainMappingRequest=} [properties] Properties to set + * @returns {google.appengine.v1.CreateDomainMappingRequest} CreateDomainMappingRequest instance + */ + CreateDomainMappingRequest.create = function create(properties) { + return new CreateDomainMappingRequest(properties); + }; + + /** + * Encodes the specified CreateDomainMappingRequest message. Does not implicitly {@link google.appengine.v1.CreateDomainMappingRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @static + * @param {google.appengine.v1.ICreateDomainMappingRequest} message CreateDomainMappingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDomainMappingRequest.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.domainMapping != null && Object.hasOwnProperty.call(message, "domainMapping")) + $root.google.appengine.v1.DomainMapping.encode(message.domainMapping, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.overrideStrategy != null && Object.hasOwnProperty.call(message, "overrideStrategy")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.overrideStrategy); + return writer; + }; + + /** + * Encodes the specified CreateDomainMappingRequest message, length delimited. Does not implicitly {@link google.appengine.v1.CreateDomainMappingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @static + * @param {google.appengine.v1.ICreateDomainMappingRequest} message CreateDomainMappingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDomainMappingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDomainMappingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.CreateDomainMappingRequest} CreateDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDomainMappingRequest.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.appengine.v1.CreateDomainMappingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.domainMapping = $root.google.appengine.v1.DomainMapping.decode(reader, reader.uint32()); + break; + } + case 4: { + message.overrideStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDomainMappingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.CreateDomainMappingRequest} CreateDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDomainMappingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDomainMappingRequest message. + * @function verify + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDomainMappingRequest.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.domainMapping != null && message.hasOwnProperty("domainMapping")) { + var error = $root.google.appengine.v1.DomainMapping.verify(message.domainMapping); + if (error) + return "domainMapping." + error; + } + if (message.overrideStrategy != null && message.hasOwnProperty("overrideStrategy")) + switch (message.overrideStrategy) { + default: + return "overrideStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CreateDomainMappingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.CreateDomainMappingRequest} CreateDomainMappingRequest + */ + CreateDomainMappingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.CreateDomainMappingRequest) + return object; + var message = new $root.google.appengine.v1.CreateDomainMappingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.domainMapping != null) { + if (typeof object.domainMapping !== "object") + throw TypeError(".google.appengine.v1.CreateDomainMappingRequest.domainMapping: object expected"); + message.domainMapping = $root.google.appengine.v1.DomainMapping.fromObject(object.domainMapping); + } + switch (object.overrideStrategy) { + default: + if (typeof object.overrideStrategy === "number") { + message.overrideStrategy = object.overrideStrategy; + break; + } + break; + case "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY": + case 0: + message.overrideStrategy = 0; + break; + case "STRICT": + case 1: + message.overrideStrategy = 1; + break; + case "OVERRIDE": + case 2: + message.overrideStrategy = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CreateDomainMappingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @static + * @param {google.appengine.v1.CreateDomainMappingRequest} message CreateDomainMappingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDomainMappingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.domainMapping = null; + object.overrideStrategy = options.enums === String ? "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.domainMapping != null && message.hasOwnProperty("domainMapping")) + object.domainMapping = $root.google.appengine.v1.DomainMapping.toObject(message.domainMapping, options); + if (message.overrideStrategy != null && message.hasOwnProperty("overrideStrategy")) + object.overrideStrategy = options.enums === String ? $root.google.appengine.v1.DomainOverrideStrategy[message.overrideStrategy] === undefined ? message.overrideStrategy : $root.google.appengine.v1.DomainOverrideStrategy[message.overrideStrategy] : message.overrideStrategy; + return object; + }; + + /** + * Converts this CreateDomainMappingRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDomainMappingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDomainMappingRequest + * @function getTypeUrl + * @memberof google.appengine.v1.CreateDomainMappingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDomainMappingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.CreateDomainMappingRequest"; + }; + + return CreateDomainMappingRequest; + })(); + + v1.UpdateDomainMappingRequest = (function() { + + /** + * Properties of an UpdateDomainMappingRequest. + * @memberof google.appengine.v1 + * @interface IUpdateDomainMappingRequest + * @property {string|null} [name] UpdateDomainMappingRequest name + * @property {google.appengine.v1.IDomainMapping|null} [domainMapping] UpdateDomainMappingRequest domainMapping + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDomainMappingRequest updateMask + */ + + /** + * Constructs a new UpdateDomainMappingRequest. + * @memberof google.appengine.v1 + * @classdesc Represents an UpdateDomainMappingRequest. + * @implements IUpdateDomainMappingRequest + * @constructor + * @param {google.appengine.v1.IUpdateDomainMappingRequest=} [properties] Properties to set + */ + function UpdateDomainMappingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDomainMappingRequest name. + * @member {string} name + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @instance + */ + UpdateDomainMappingRequest.prototype.name = ""; + + /** + * UpdateDomainMappingRequest domainMapping. + * @member {google.appengine.v1.IDomainMapping|null|undefined} domainMapping + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @instance + */ + UpdateDomainMappingRequest.prototype.domainMapping = null; + + /** + * UpdateDomainMappingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @instance + */ + UpdateDomainMappingRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDomainMappingRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @static + * @param {google.appengine.v1.IUpdateDomainMappingRequest=} [properties] Properties to set + * @returns {google.appengine.v1.UpdateDomainMappingRequest} UpdateDomainMappingRequest instance + */ + UpdateDomainMappingRequest.create = function create(properties) { + return new UpdateDomainMappingRequest(properties); + }; + + /** + * Encodes the specified UpdateDomainMappingRequest message. Does not implicitly {@link google.appengine.v1.UpdateDomainMappingRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @static + * @param {google.appengine.v1.IUpdateDomainMappingRequest} message UpdateDomainMappingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDomainMappingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.domainMapping != null && Object.hasOwnProperty.call(message, "domainMapping")) + $root.google.appengine.v1.DomainMapping.encode(message.domainMapping, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDomainMappingRequest message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateDomainMappingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @static + * @param {google.appengine.v1.IUpdateDomainMappingRequest} message UpdateDomainMappingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDomainMappingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDomainMappingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.UpdateDomainMappingRequest} UpdateDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDomainMappingRequest.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.appengine.v1.UpdateDomainMappingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.domainMapping = $root.google.appengine.v1.DomainMapping.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDomainMappingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.UpdateDomainMappingRequest} UpdateDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDomainMappingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDomainMappingRequest message. + * @function verify + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDomainMappingRequest.verify = function verify(message) { + if (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.domainMapping != null && message.hasOwnProperty("domainMapping")) { + var error = $root.google.appengine.v1.DomainMapping.verify(message.domainMapping); + if (error) + return "domainMapping." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDomainMappingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.UpdateDomainMappingRequest} UpdateDomainMappingRequest + */ + UpdateDomainMappingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.UpdateDomainMappingRequest) + return object; + var message = new $root.google.appengine.v1.UpdateDomainMappingRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.domainMapping != null) { + if (typeof object.domainMapping !== "object") + throw TypeError(".google.appengine.v1.UpdateDomainMappingRequest.domainMapping: object expected"); + message.domainMapping = $root.google.appengine.v1.DomainMapping.fromObject(object.domainMapping); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.appengine.v1.UpdateDomainMappingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDomainMappingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @static + * @param {google.appengine.v1.UpdateDomainMappingRequest} message UpdateDomainMappingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDomainMappingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.domainMapping = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.domainMapping != null && message.hasOwnProperty("domainMapping")) + object.domainMapping = $root.google.appengine.v1.DomainMapping.toObject(message.domainMapping, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDomainMappingRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDomainMappingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDomainMappingRequest + * @function getTypeUrl + * @memberof google.appengine.v1.UpdateDomainMappingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDomainMappingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.UpdateDomainMappingRequest"; + }; + + return UpdateDomainMappingRequest; + })(); + + v1.DeleteDomainMappingRequest = (function() { + + /** + * Properties of a DeleteDomainMappingRequest. + * @memberof google.appengine.v1 + * @interface IDeleteDomainMappingRequest + * @property {string|null} [name] DeleteDomainMappingRequest name + */ + + /** + * Constructs a new DeleteDomainMappingRequest. + * @memberof google.appengine.v1 + * @classdesc Represents a DeleteDomainMappingRequest. + * @implements IDeleteDomainMappingRequest + * @constructor + * @param {google.appengine.v1.IDeleteDomainMappingRequest=} [properties] Properties to set + */ + function DeleteDomainMappingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDomainMappingRequest name. + * @member {string} name + * @memberof google.appengine.v1.DeleteDomainMappingRequest + * @instance + */ + DeleteDomainMappingRequest.prototype.name = ""; + + /** + * Creates a new DeleteDomainMappingRequest instance using the specified properties. + * @function create + * @memberof google.appengine.v1.DeleteDomainMappingRequest + * @static + * @param {google.appengine.v1.IDeleteDomainMappingRequest=} [properties] Properties to set + * @returns {google.appengine.v1.DeleteDomainMappingRequest} DeleteDomainMappingRequest instance + */ + DeleteDomainMappingRequest.create = function create(properties) { + return new DeleteDomainMappingRequest(properties); + }; + + /** + * Encodes the specified DeleteDomainMappingRequest message. Does not implicitly {@link google.appengine.v1.DeleteDomainMappingRequest.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.DeleteDomainMappingRequest + * @static + * @param {google.appengine.v1.IDeleteDomainMappingRequest} message DeleteDomainMappingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDomainMappingRequest.encode = function encode(message, writer) { + 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 DeleteDomainMappingRequest message, length delimited. Does not implicitly {@link google.appengine.v1.DeleteDomainMappingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.DeleteDomainMappingRequest + * @static + * @param {google.appengine.v1.IDeleteDomainMappingRequest} message DeleteDomainMappingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDomainMappingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDomainMappingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.DeleteDomainMappingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.DeleteDomainMappingRequest} DeleteDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDomainMappingRequest.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.appengine.v1.DeleteDomainMappingRequest(); + 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 DeleteDomainMappingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.DeleteDomainMappingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.DeleteDomainMappingRequest} DeleteDomainMappingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDomainMappingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDomainMappingRequest message. + * @function verify + * @memberof google.appengine.v1.DeleteDomainMappingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDomainMappingRequest.verify = function verify(message) { + if (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 DeleteDomainMappingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.DeleteDomainMappingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.DeleteDomainMappingRequest} DeleteDomainMappingRequest + */ + DeleteDomainMappingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.DeleteDomainMappingRequest) + return object; + var message = new $root.google.appengine.v1.DeleteDomainMappingRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDomainMappingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.DeleteDomainMappingRequest + * @static + * @param {google.appengine.v1.DeleteDomainMappingRequest} message DeleteDomainMappingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDomainMappingRequest.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 DeleteDomainMappingRequest to JSON. + * @function toJSON + * @memberof google.appengine.v1.DeleteDomainMappingRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDomainMappingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDomainMappingRequest + * @function getTypeUrl + * @memberof google.appengine.v1.DeleteDomainMappingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDomainMappingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.DeleteDomainMappingRequest"; + }; + + return DeleteDomainMappingRequest; + })(); + + v1.Application = (function() { + + /** + * Properties of an Application. + * @memberof google.appengine.v1 + * @interface IApplication + * @property {string|null} [name] Application name + * @property {string|null} [id] Application id + * @property {Array.|null} [dispatchRules] Application dispatchRules + * @property {string|null} [authDomain] Application authDomain + * @property {string|null} [locationId] Application locationId + * @property {string|null} [codeBucket] Application codeBucket + * @property {google.protobuf.IDuration|null} [defaultCookieExpiration] Application defaultCookieExpiration + * @property {google.appengine.v1.Application.ServingStatus|null} [servingStatus] Application servingStatus + * @property {string|null} [defaultHostname] Application defaultHostname + * @property {string|null} [defaultBucket] Application defaultBucket + * @property {string|null} [serviceAccount] Application serviceAccount + * @property {google.appengine.v1.Application.IIdentityAwareProxy|null} [iap] Application iap + * @property {string|null} [gcrDomain] Application gcrDomain + * @property {google.appengine.v1.Application.DatabaseType|null} [databaseType] Application databaseType + * @property {google.appengine.v1.Application.IFeatureSettings|null} [featureSettings] Application featureSettings + */ + + /** + * Constructs a new Application. + * @memberof google.appengine.v1 + * @classdesc Represents an Application. + * @implements IApplication + * @constructor + * @param {google.appengine.v1.IApplication=} [properties] Properties to set + */ + function Application(properties) { + this.dispatchRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Application name. + * @member {string} name + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.name = ""; + + /** + * Application id. + * @member {string} id + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.id = ""; + + /** + * Application dispatchRules. + * @member {Array.} dispatchRules + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.dispatchRules = $util.emptyArray; + + /** + * Application authDomain. + * @member {string} authDomain + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.authDomain = ""; + + /** + * Application locationId. + * @member {string} locationId + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.locationId = ""; + + /** + * Application codeBucket. + * @member {string} codeBucket + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.codeBucket = ""; + + /** + * Application defaultCookieExpiration. + * @member {google.protobuf.IDuration|null|undefined} defaultCookieExpiration + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.defaultCookieExpiration = null; + + /** + * Application servingStatus. + * @member {google.appengine.v1.Application.ServingStatus} servingStatus + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.servingStatus = 0; + + /** + * Application defaultHostname. + * @member {string} defaultHostname + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.defaultHostname = ""; + + /** + * Application defaultBucket. + * @member {string} defaultBucket + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.defaultBucket = ""; + + /** + * Application serviceAccount. + * @member {string} serviceAccount + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.serviceAccount = ""; + + /** + * Application iap. + * @member {google.appengine.v1.Application.IIdentityAwareProxy|null|undefined} iap + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.iap = null; + + /** + * Application gcrDomain. + * @member {string} gcrDomain + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.gcrDomain = ""; + + /** + * Application databaseType. + * @member {google.appengine.v1.Application.DatabaseType} databaseType + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.databaseType = 0; + + /** + * Application featureSettings. + * @member {google.appengine.v1.Application.IFeatureSettings|null|undefined} featureSettings + * @memberof google.appengine.v1.Application + * @instance + */ + Application.prototype.featureSettings = null; + + /** + * Creates a new Application instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Application + * @static + * @param {google.appengine.v1.IApplication=} [properties] Properties to set + * @returns {google.appengine.v1.Application} Application instance + */ + Application.create = function create(properties) { + return new Application(properties); + }; + + /** + * Encodes the specified Application message. Does not implicitly {@link google.appengine.v1.Application.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Application + * @static + * @param {google.appengine.v1.IApplication} message Application message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Application.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.dispatchRules != null && message.dispatchRules.length) + for (var i = 0; i < message.dispatchRules.length; ++i) + $root.google.appengine.v1.UrlDispatchRule.encode(message.dispatchRules[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.authDomain != null && Object.hasOwnProperty.call(message, "authDomain")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.authDomain); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.locationId); + if (message.codeBucket != null && Object.hasOwnProperty.call(message, "codeBucket")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.codeBucket); + if (message.defaultCookieExpiration != null && Object.hasOwnProperty.call(message, "defaultCookieExpiration")) + $root.google.protobuf.Duration.encode(message.defaultCookieExpiration, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.servingStatus != null && Object.hasOwnProperty.call(message, "servingStatus")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.servingStatus); + if (message.defaultHostname != null && Object.hasOwnProperty.call(message, "defaultHostname")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.defaultHostname); + if (message.defaultBucket != null && Object.hasOwnProperty.call(message, "defaultBucket")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.defaultBucket); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.serviceAccount); + if (message.iap != null && Object.hasOwnProperty.call(message, "iap")) + $root.google.appengine.v1.Application.IdentityAwareProxy.encode(message.iap, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.gcrDomain != null && Object.hasOwnProperty.call(message, "gcrDomain")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.gcrDomain); + if (message.databaseType != null && Object.hasOwnProperty.call(message, "databaseType")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.databaseType); + if (message.featureSettings != null && Object.hasOwnProperty.call(message, "featureSettings")) + $root.google.appengine.v1.Application.FeatureSettings.encode(message.featureSettings, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Application message, length delimited. Does not implicitly {@link google.appengine.v1.Application.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Application + * @static + * @param {google.appengine.v1.IApplication} message Application message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Application.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Application message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Application + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Application} Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Application.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.appengine.v1.Application(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + if (!(message.dispatchRules && message.dispatchRules.length)) + message.dispatchRules = []; + message.dispatchRules.push($root.google.appengine.v1.UrlDispatchRule.decode(reader, reader.uint32())); + break; + } + case 6: { + message.authDomain = reader.string(); + break; + } + case 7: { + message.locationId = reader.string(); + break; + } + case 8: { + message.codeBucket = reader.string(); + break; + } + case 9: { + message.defaultCookieExpiration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 10: { + message.servingStatus = reader.int32(); + break; + } + case 11: { + message.defaultHostname = reader.string(); + break; + } + case 12: { + message.defaultBucket = reader.string(); + break; + } + case 13: { + message.serviceAccount = reader.string(); + break; + } + case 14: { + message.iap = $root.google.appengine.v1.Application.IdentityAwareProxy.decode(reader, reader.uint32()); + break; + } + case 16: { + message.gcrDomain = reader.string(); + break; + } + case 17: { + message.databaseType = reader.int32(); + break; + } + case 18: { + message.featureSettings = $root.google.appengine.v1.Application.FeatureSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Application message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Application + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Application} Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Application.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Application message. + * @function verify + * @memberof google.appengine.v1.Application + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Application.verify = function verify(message) { + if (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.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.dispatchRules != null && message.hasOwnProperty("dispatchRules")) { + if (!Array.isArray(message.dispatchRules)) + return "dispatchRules: array expected"; + for (var i = 0; i < message.dispatchRules.length; ++i) { + var error = $root.google.appengine.v1.UrlDispatchRule.verify(message.dispatchRules[i]); + if (error) + return "dispatchRules." + error; + } + } + if (message.authDomain != null && message.hasOwnProperty("authDomain")) + if (!$util.isString(message.authDomain)) + return "authDomain: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + if (message.codeBucket != null && message.hasOwnProperty("codeBucket")) + if (!$util.isString(message.codeBucket)) + return "codeBucket: string expected"; + if (message.defaultCookieExpiration != null && message.hasOwnProperty("defaultCookieExpiration")) { + var error = $root.google.protobuf.Duration.verify(message.defaultCookieExpiration); + if (error) + return "defaultCookieExpiration." + error; + } + if (message.servingStatus != null && message.hasOwnProperty("servingStatus")) + switch (message.servingStatus) { + default: + return "servingStatus: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.defaultHostname != null && message.hasOwnProperty("defaultHostname")) + if (!$util.isString(message.defaultHostname)) + return "defaultHostname: string expected"; + if (message.defaultBucket != null && message.hasOwnProperty("defaultBucket")) + if (!$util.isString(message.defaultBucket)) + return "defaultBucket: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.iap != null && message.hasOwnProperty("iap")) { + var error = $root.google.appengine.v1.Application.IdentityAwareProxy.verify(message.iap); + if (error) + return "iap." + error; + } + if (message.gcrDomain != null && message.hasOwnProperty("gcrDomain")) + if (!$util.isString(message.gcrDomain)) + return "gcrDomain: string expected"; + if (message.databaseType != null && message.hasOwnProperty("databaseType")) + switch (message.databaseType) { + default: + return "databaseType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.featureSettings != null && message.hasOwnProperty("featureSettings")) { + var error = $root.google.appengine.v1.Application.FeatureSettings.verify(message.featureSettings); + if (error) + return "featureSettings." + error; + } + return null; + }; + + /** + * Creates an Application message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Application + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Application} Application + */ + Application.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Application) + return object; + var message = new $root.google.appengine.v1.Application(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + if (object.dispatchRules) { + if (!Array.isArray(object.dispatchRules)) + throw TypeError(".google.appengine.v1.Application.dispatchRules: array expected"); + message.dispatchRules = []; + for (var i = 0; i < object.dispatchRules.length; ++i) { + if (typeof object.dispatchRules[i] !== "object") + throw TypeError(".google.appengine.v1.Application.dispatchRules: object expected"); + message.dispatchRules[i] = $root.google.appengine.v1.UrlDispatchRule.fromObject(object.dispatchRules[i]); + } + } + if (object.authDomain != null) + message.authDomain = String(object.authDomain); + if (object.locationId != null) + message.locationId = String(object.locationId); + if (object.codeBucket != null) + message.codeBucket = String(object.codeBucket); + if (object.defaultCookieExpiration != null) { + if (typeof object.defaultCookieExpiration !== "object") + throw TypeError(".google.appengine.v1.Application.defaultCookieExpiration: object expected"); + message.defaultCookieExpiration = $root.google.protobuf.Duration.fromObject(object.defaultCookieExpiration); + } + switch (object.servingStatus) { + default: + if (typeof object.servingStatus === "number") { + message.servingStatus = object.servingStatus; + break; + } + break; + case "UNSPECIFIED": + case 0: + message.servingStatus = 0; + break; + case "SERVING": + case 1: + message.servingStatus = 1; + break; + case "USER_DISABLED": + case 2: + message.servingStatus = 2; + break; + case "SYSTEM_DISABLED": + case 3: + message.servingStatus = 3; + break; + } + if (object.defaultHostname != null) + message.defaultHostname = String(object.defaultHostname); + if (object.defaultBucket != null) + message.defaultBucket = String(object.defaultBucket); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.iap != null) { + if (typeof object.iap !== "object") + throw TypeError(".google.appengine.v1.Application.iap: object expected"); + message.iap = $root.google.appengine.v1.Application.IdentityAwareProxy.fromObject(object.iap); + } + if (object.gcrDomain != null) + message.gcrDomain = String(object.gcrDomain); + switch (object.databaseType) { + default: + if (typeof object.databaseType === "number") { + message.databaseType = object.databaseType; + break; + } + break; + case "DATABASE_TYPE_UNSPECIFIED": + case 0: + message.databaseType = 0; + break; + case "CLOUD_DATASTORE": + case 1: + message.databaseType = 1; + break; + case "CLOUD_FIRESTORE": + case 2: + message.databaseType = 2; + break; + case "CLOUD_DATASTORE_COMPATIBILITY": + case 3: + message.databaseType = 3; + break; + } + if (object.featureSettings != null) { + if (typeof object.featureSettings !== "object") + throw TypeError(".google.appengine.v1.Application.featureSettings: object expected"); + message.featureSettings = $root.google.appengine.v1.Application.FeatureSettings.fromObject(object.featureSettings); + } + return message; + }; + + /** + * Creates a plain object from an Application message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Application + * @static + * @param {google.appengine.v1.Application} message Application + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Application.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dispatchRules = []; + if (options.defaults) { + object.name = ""; + object.id = ""; + object.authDomain = ""; + object.locationId = ""; + object.codeBucket = ""; + object.defaultCookieExpiration = null; + object.servingStatus = options.enums === String ? "UNSPECIFIED" : 0; + object.defaultHostname = ""; + object.defaultBucket = ""; + object.serviceAccount = ""; + object.iap = null; + object.gcrDomain = ""; + object.databaseType = options.enums === String ? "DATABASE_TYPE_UNSPECIFIED" : 0; + object.featureSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.dispatchRules && message.dispatchRules.length) { + object.dispatchRules = []; + for (var j = 0; j < message.dispatchRules.length; ++j) + object.dispatchRules[j] = $root.google.appengine.v1.UrlDispatchRule.toObject(message.dispatchRules[j], options); + } + if (message.authDomain != null && message.hasOwnProperty("authDomain")) + object.authDomain = message.authDomain; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + if (message.codeBucket != null && message.hasOwnProperty("codeBucket")) + object.codeBucket = message.codeBucket; + if (message.defaultCookieExpiration != null && message.hasOwnProperty("defaultCookieExpiration")) + object.defaultCookieExpiration = $root.google.protobuf.Duration.toObject(message.defaultCookieExpiration, options); + if (message.servingStatus != null && message.hasOwnProperty("servingStatus")) + object.servingStatus = options.enums === String ? $root.google.appengine.v1.Application.ServingStatus[message.servingStatus] === undefined ? message.servingStatus : $root.google.appengine.v1.Application.ServingStatus[message.servingStatus] : message.servingStatus; + if (message.defaultHostname != null && message.hasOwnProperty("defaultHostname")) + object.defaultHostname = message.defaultHostname; + if (message.defaultBucket != null && message.hasOwnProperty("defaultBucket")) + object.defaultBucket = message.defaultBucket; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.iap != null && message.hasOwnProperty("iap")) + object.iap = $root.google.appengine.v1.Application.IdentityAwareProxy.toObject(message.iap, options); + if (message.gcrDomain != null && message.hasOwnProperty("gcrDomain")) + object.gcrDomain = message.gcrDomain; + if (message.databaseType != null && message.hasOwnProperty("databaseType")) + object.databaseType = options.enums === String ? $root.google.appengine.v1.Application.DatabaseType[message.databaseType] === undefined ? message.databaseType : $root.google.appengine.v1.Application.DatabaseType[message.databaseType] : message.databaseType; + if (message.featureSettings != null && message.hasOwnProperty("featureSettings")) + object.featureSettings = $root.google.appengine.v1.Application.FeatureSettings.toObject(message.featureSettings, options); + return object; + }; + + /** + * Converts this Application to JSON. + * @function toJSON + * @memberof google.appengine.v1.Application + * @instance + * @returns {Object.} JSON object + */ + Application.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Application + * @function getTypeUrl + * @memberof google.appengine.v1.Application + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Application.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Application"; + }; + + /** + * ServingStatus enum. + * @name google.appengine.v1.Application.ServingStatus + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} SERVING=1 SERVING value + * @property {number} USER_DISABLED=2 USER_DISABLED value + * @property {number} SYSTEM_DISABLED=3 SYSTEM_DISABLED value + */ + Application.ServingStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVING"] = 1; + values[valuesById[2] = "USER_DISABLED"] = 2; + values[valuesById[3] = "SYSTEM_DISABLED"] = 3; + return values; + })(); + + Application.IdentityAwareProxy = (function() { + + /** + * Properties of an IdentityAwareProxy. + * @memberof google.appengine.v1.Application + * @interface IIdentityAwareProxy + * @property {boolean|null} [enabled] IdentityAwareProxy enabled + * @property {string|null} [oauth2ClientId] IdentityAwareProxy oauth2ClientId + * @property {string|null} [oauth2ClientSecret] IdentityAwareProxy oauth2ClientSecret + * @property {string|null} [oauth2ClientSecretSha256] IdentityAwareProxy oauth2ClientSecretSha256 + */ + + /** + * Constructs a new IdentityAwareProxy. + * @memberof google.appengine.v1.Application + * @classdesc Represents an IdentityAwareProxy. + * @implements IIdentityAwareProxy + * @constructor + * @param {google.appengine.v1.Application.IIdentityAwareProxy=} [properties] Properties to set + */ + function IdentityAwareProxy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityAwareProxy enabled. + * @member {boolean} enabled + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @instance + */ + IdentityAwareProxy.prototype.enabled = false; + + /** + * IdentityAwareProxy oauth2ClientId. + * @member {string} oauth2ClientId + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @instance + */ + IdentityAwareProxy.prototype.oauth2ClientId = ""; + + /** + * IdentityAwareProxy oauth2ClientSecret. + * @member {string} oauth2ClientSecret + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @instance + */ + IdentityAwareProxy.prototype.oauth2ClientSecret = ""; + + /** + * IdentityAwareProxy oauth2ClientSecretSha256. + * @member {string} oauth2ClientSecretSha256 + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @instance + */ + IdentityAwareProxy.prototype.oauth2ClientSecretSha256 = ""; + + /** + * Creates a new IdentityAwareProxy instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @static + * @param {google.appengine.v1.Application.IIdentityAwareProxy=} [properties] Properties to set + * @returns {google.appengine.v1.Application.IdentityAwareProxy} IdentityAwareProxy instance + */ + IdentityAwareProxy.create = function create(properties) { + return new IdentityAwareProxy(properties); + }; + + /** + * Encodes the specified IdentityAwareProxy message. Does not implicitly {@link google.appengine.v1.Application.IdentityAwareProxy.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @static + * @param {google.appengine.v1.Application.IIdentityAwareProxy} message IdentityAwareProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityAwareProxy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.oauth2ClientId != null && Object.hasOwnProperty.call(message, "oauth2ClientId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.oauth2ClientId); + if (message.oauth2ClientSecret != null && Object.hasOwnProperty.call(message, "oauth2ClientSecret")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.oauth2ClientSecret); + if (message.oauth2ClientSecretSha256 != null && Object.hasOwnProperty.call(message, "oauth2ClientSecretSha256")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.oauth2ClientSecretSha256); + return writer; + }; + + /** + * Encodes the specified IdentityAwareProxy message, length delimited. Does not implicitly {@link google.appengine.v1.Application.IdentityAwareProxy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @static + * @param {google.appengine.v1.Application.IIdentityAwareProxy} message IdentityAwareProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityAwareProxy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityAwareProxy message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Application.IdentityAwareProxy} IdentityAwareProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityAwareProxy.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.appengine.v1.Application.IdentityAwareProxy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.oauth2ClientId = reader.string(); + break; + } + case 3: { + message.oauth2ClientSecret = reader.string(); + break; + } + case 4: { + message.oauth2ClientSecretSha256 = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityAwareProxy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Application.IdentityAwareProxy} IdentityAwareProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityAwareProxy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityAwareProxy message. + * @function verify + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityAwareProxy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.oauth2ClientId != null && message.hasOwnProperty("oauth2ClientId")) + if (!$util.isString(message.oauth2ClientId)) + return "oauth2ClientId: string expected"; + if (message.oauth2ClientSecret != null && message.hasOwnProperty("oauth2ClientSecret")) + if (!$util.isString(message.oauth2ClientSecret)) + return "oauth2ClientSecret: string expected"; + if (message.oauth2ClientSecretSha256 != null && message.hasOwnProperty("oauth2ClientSecretSha256")) + if (!$util.isString(message.oauth2ClientSecretSha256)) + return "oauth2ClientSecretSha256: string expected"; + return null; + }; + + /** + * Creates an IdentityAwareProxy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Application.IdentityAwareProxy} IdentityAwareProxy + */ + IdentityAwareProxy.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Application.IdentityAwareProxy) + return object; + var message = new $root.google.appengine.v1.Application.IdentityAwareProxy(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.oauth2ClientId != null) + message.oauth2ClientId = String(object.oauth2ClientId); + if (object.oauth2ClientSecret != null) + message.oauth2ClientSecret = String(object.oauth2ClientSecret); + if (object.oauth2ClientSecretSha256 != null) + message.oauth2ClientSecretSha256 = String(object.oauth2ClientSecretSha256); + return message; + }; + + /** + * Creates a plain object from an IdentityAwareProxy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @static + * @param {google.appengine.v1.Application.IdentityAwareProxy} message IdentityAwareProxy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityAwareProxy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.oauth2ClientId = ""; + object.oauth2ClientSecret = ""; + object.oauth2ClientSecretSha256 = ""; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.oauth2ClientId != null && message.hasOwnProperty("oauth2ClientId")) + object.oauth2ClientId = message.oauth2ClientId; + if (message.oauth2ClientSecret != null && message.hasOwnProperty("oauth2ClientSecret")) + object.oauth2ClientSecret = message.oauth2ClientSecret; + if (message.oauth2ClientSecretSha256 != null && message.hasOwnProperty("oauth2ClientSecretSha256")) + object.oauth2ClientSecretSha256 = message.oauth2ClientSecretSha256; + return object; + }; + + /** + * Converts this IdentityAwareProxy to JSON. + * @function toJSON + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @instance + * @returns {Object.} JSON object + */ + IdentityAwareProxy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IdentityAwareProxy + * @function getTypeUrl + * @memberof google.appengine.v1.Application.IdentityAwareProxy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentityAwareProxy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Application.IdentityAwareProxy"; + }; + + return IdentityAwareProxy; + })(); + + /** + * DatabaseType enum. + * @name google.appengine.v1.Application.DatabaseType + * @enum {number} + * @property {number} DATABASE_TYPE_UNSPECIFIED=0 DATABASE_TYPE_UNSPECIFIED value + * @property {number} CLOUD_DATASTORE=1 CLOUD_DATASTORE value + * @property {number} CLOUD_FIRESTORE=2 CLOUD_FIRESTORE value + * @property {number} CLOUD_DATASTORE_COMPATIBILITY=3 CLOUD_DATASTORE_COMPATIBILITY value + */ + Application.DatabaseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_DATASTORE"] = 1; + values[valuesById[2] = "CLOUD_FIRESTORE"] = 2; + values[valuesById[3] = "CLOUD_DATASTORE_COMPATIBILITY"] = 3; + return values; + })(); + + Application.FeatureSettings = (function() { + + /** + * Properties of a FeatureSettings. + * @memberof google.appengine.v1.Application + * @interface IFeatureSettings + * @property {boolean|null} [splitHealthChecks] FeatureSettings splitHealthChecks + * @property {boolean|null} [useContainerOptimizedOs] FeatureSettings useContainerOptimizedOs + */ + + /** + * Constructs a new FeatureSettings. + * @memberof google.appengine.v1.Application + * @classdesc Represents a FeatureSettings. + * @implements IFeatureSettings + * @constructor + * @param {google.appengine.v1.Application.IFeatureSettings=} [properties] Properties to set + */ + function FeatureSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSettings splitHealthChecks. + * @member {boolean} splitHealthChecks + * @memberof google.appengine.v1.Application.FeatureSettings + * @instance + */ + FeatureSettings.prototype.splitHealthChecks = false; + + /** + * FeatureSettings useContainerOptimizedOs. + * @member {boolean} useContainerOptimizedOs + * @memberof google.appengine.v1.Application.FeatureSettings + * @instance + */ + FeatureSettings.prototype.useContainerOptimizedOs = false; + + /** + * Creates a new FeatureSettings instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Application.FeatureSettings + * @static + * @param {google.appengine.v1.Application.IFeatureSettings=} [properties] Properties to set + * @returns {google.appengine.v1.Application.FeatureSettings} FeatureSettings instance + */ + FeatureSettings.create = function create(properties) { + return new FeatureSettings(properties); + }; + + /** + * Encodes the specified FeatureSettings message. Does not implicitly {@link google.appengine.v1.Application.FeatureSettings.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Application.FeatureSettings + * @static + * @param {google.appengine.v1.Application.IFeatureSettings} message FeatureSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.splitHealthChecks != null && Object.hasOwnProperty.call(message, "splitHealthChecks")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.splitHealthChecks); + if (message.useContainerOptimizedOs != null && Object.hasOwnProperty.call(message, "useContainerOptimizedOs")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useContainerOptimizedOs); + return writer; + }; + + /** + * Encodes the specified FeatureSettings message, length delimited. Does not implicitly {@link google.appengine.v1.Application.FeatureSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Application.FeatureSettings + * @static + * @param {google.appengine.v1.Application.IFeatureSettings} message FeatureSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSettings message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Application.FeatureSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Application.FeatureSettings} FeatureSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSettings.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.appengine.v1.Application.FeatureSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.splitHealthChecks = reader.bool(); + break; + } + case 2: { + message.useContainerOptimizedOs = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Application.FeatureSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Application.FeatureSettings} FeatureSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSettings message. + * @function verify + * @memberof google.appengine.v1.Application.FeatureSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.splitHealthChecks != null && message.hasOwnProperty("splitHealthChecks")) + if (typeof message.splitHealthChecks !== "boolean") + return "splitHealthChecks: boolean expected"; + if (message.useContainerOptimizedOs != null && message.hasOwnProperty("useContainerOptimizedOs")) + if (typeof message.useContainerOptimizedOs !== "boolean") + return "useContainerOptimizedOs: boolean expected"; + return null; + }; + + /** + * Creates a FeatureSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Application.FeatureSettings + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Application.FeatureSettings} FeatureSettings + */ + FeatureSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Application.FeatureSettings) + return object; + var message = new $root.google.appengine.v1.Application.FeatureSettings(); + if (object.splitHealthChecks != null) + message.splitHealthChecks = Boolean(object.splitHealthChecks); + if (object.useContainerOptimizedOs != null) + message.useContainerOptimizedOs = Boolean(object.useContainerOptimizedOs); + return message; + }; + + /** + * Creates a plain object from a FeatureSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Application.FeatureSettings + * @static + * @param {google.appengine.v1.Application.FeatureSettings} message FeatureSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.splitHealthChecks = false; + object.useContainerOptimizedOs = false; + } + if (message.splitHealthChecks != null && message.hasOwnProperty("splitHealthChecks")) + object.splitHealthChecks = message.splitHealthChecks; + if (message.useContainerOptimizedOs != null && message.hasOwnProperty("useContainerOptimizedOs")) + object.useContainerOptimizedOs = message.useContainerOptimizedOs; + return object; + }; + + /** + * Converts this FeatureSettings to JSON. + * @function toJSON + * @memberof google.appengine.v1.Application.FeatureSettings + * @instance + * @returns {Object.} JSON object + */ + FeatureSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSettings + * @function getTypeUrl + * @memberof google.appengine.v1.Application.FeatureSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Application.FeatureSettings"; + }; + + return FeatureSettings; + })(); + + return Application; + })(); + + v1.UrlDispatchRule = (function() { + + /** + * Properties of an UrlDispatchRule. + * @memberof google.appengine.v1 + * @interface IUrlDispatchRule + * @property {string|null} [domain] UrlDispatchRule domain + * @property {string|null} [path] UrlDispatchRule path + * @property {string|null} [service] UrlDispatchRule service + */ + + /** + * Constructs a new UrlDispatchRule. + * @memberof google.appengine.v1 + * @classdesc Represents an UrlDispatchRule. + * @implements IUrlDispatchRule + * @constructor + * @param {google.appengine.v1.IUrlDispatchRule=} [properties] Properties to set + */ + function UrlDispatchRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlDispatchRule domain. + * @member {string} domain + * @memberof google.appengine.v1.UrlDispatchRule + * @instance + */ + UrlDispatchRule.prototype.domain = ""; + + /** + * UrlDispatchRule path. + * @member {string} path + * @memberof google.appengine.v1.UrlDispatchRule + * @instance + */ + UrlDispatchRule.prototype.path = ""; + + /** + * UrlDispatchRule service. + * @member {string} service + * @memberof google.appengine.v1.UrlDispatchRule + * @instance + */ + UrlDispatchRule.prototype.service = ""; + + /** + * Creates a new UrlDispatchRule instance using the specified properties. + * @function create + * @memberof google.appengine.v1.UrlDispatchRule + * @static + * @param {google.appengine.v1.IUrlDispatchRule=} [properties] Properties to set + * @returns {google.appengine.v1.UrlDispatchRule} UrlDispatchRule instance + */ + UrlDispatchRule.create = function create(properties) { + return new UrlDispatchRule(properties); + }; + + /** + * Encodes the specified UrlDispatchRule message. Does not implicitly {@link google.appengine.v1.UrlDispatchRule.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.UrlDispatchRule + * @static + * @param {google.appengine.v1.IUrlDispatchRule} message UrlDispatchRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlDispatchRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.domain); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.service); + return writer; + }; + + /** + * Encodes the specified UrlDispatchRule message, length delimited. Does not implicitly {@link google.appengine.v1.UrlDispatchRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.UrlDispatchRule + * @static + * @param {google.appengine.v1.IUrlDispatchRule} message UrlDispatchRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlDispatchRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlDispatchRule message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.UrlDispatchRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.UrlDispatchRule} UrlDispatchRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlDispatchRule.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.appengine.v1.UrlDispatchRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.domain = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + case 3: { + message.service = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlDispatchRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.UrlDispatchRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.UrlDispatchRule} UrlDispatchRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlDispatchRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlDispatchRule message. + * @function verify + * @memberof google.appengine.v1.UrlDispatchRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlDispatchRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; + + /** + * Creates an UrlDispatchRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.UrlDispatchRule + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.UrlDispatchRule} UrlDispatchRule + */ + UrlDispatchRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.UrlDispatchRule) + return object; + var message = new $root.google.appengine.v1.UrlDispatchRule(); + if (object.domain != null) + message.domain = String(object.domain); + if (object.path != null) + message.path = String(object.path); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from an UrlDispatchRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.UrlDispatchRule + * @static + * @param {google.appengine.v1.UrlDispatchRule} message UrlDispatchRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlDispatchRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.domain = ""; + object.path = ""; + object.service = ""; + } + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; + + /** + * Converts this UrlDispatchRule to JSON. + * @function toJSON + * @memberof google.appengine.v1.UrlDispatchRule + * @instance + * @returns {Object.} JSON object + */ + UrlDispatchRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UrlDispatchRule + * @function getTypeUrl + * @memberof google.appengine.v1.UrlDispatchRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UrlDispatchRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.UrlDispatchRule"; + }; + + return UrlDispatchRule; + })(); + + v1.AuthorizedCertificate = (function() { + + /** + * Properties of an AuthorizedCertificate. + * @memberof google.appengine.v1 + * @interface IAuthorizedCertificate + * @property {string|null} [name] AuthorizedCertificate name + * @property {string|null} [id] AuthorizedCertificate id + * @property {string|null} [displayName] AuthorizedCertificate displayName + * @property {Array.|null} [domainNames] AuthorizedCertificate domainNames + * @property {google.protobuf.ITimestamp|null} [expireTime] AuthorizedCertificate expireTime + * @property {google.appengine.v1.ICertificateRawData|null} [certificateRawData] AuthorizedCertificate certificateRawData + * @property {google.appengine.v1.IManagedCertificate|null} [managedCertificate] AuthorizedCertificate managedCertificate + * @property {Array.|null} [visibleDomainMappings] AuthorizedCertificate visibleDomainMappings + * @property {number|null} [domainMappingsCount] AuthorizedCertificate domainMappingsCount + */ + + /** + * Constructs a new AuthorizedCertificate. + * @memberof google.appengine.v1 + * @classdesc Represents an AuthorizedCertificate. + * @implements IAuthorizedCertificate + * @constructor + * @param {google.appengine.v1.IAuthorizedCertificate=} [properties] Properties to set + */ + function AuthorizedCertificate(properties) { + this.domainNames = []; + this.visibleDomainMappings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthorizedCertificate name. + * @member {string} name + * @memberof google.appengine.v1.AuthorizedCertificate + * @instance + */ + AuthorizedCertificate.prototype.name = ""; + + /** + * AuthorizedCertificate id. + * @member {string} id + * @memberof google.appengine.v1.AuthorizedCertificate + * @instance + */ + AuthorizedCertificate.prototype.id = ""; + + /** + * AuthorizedCertificate displayName. + * @member {string} displayName + * @memberof google.appengine.v1.AuthorizedCertificate + * @instance + */ + AuthorizedCertificate.prototype.displayName = ""; + + /** + * AuthorizedCertificate domainNames. + * @member {Array.} domainNames + * @memberof google.appengine.v1.AuthorizedCertificate + * @instance + */ + AuthorizedCertificate.prototype.domainNames = $util.emptyArray; + + /** + * AuthorizedCertificate expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.appengine.v1.AuthorizedCertificate + * @instance + */ + AuthorizedCertificate.prototype.expireTime = null; + + /** + * AuthorizedCertificate certificateRawData. + * @member {google.appengine.v1.ICertificateRawData|null|undefined} certificateRawData + * @memberof google.appengine.v1.AuthorizedCertificate + * @instance + */ + AuthorizedCertificate.prototype.certificateRawData = null; + + /** + * AuthorizedCertificate managedCertificate. + * @member {google.appengine.v1.IManagedCertificate|null|undefined} managedCertificate + * @memberof google.appengine.v1.AuthorizedCertificate + * @instance + */ + AuthorizedCertificate.prototype.managedCertificate = null; + + /** + * AuthorizedCertificate visibleDomainMappings. + * @member {Array.} visibleDomainMappings + * @memberof google.appengine.v1.AuthorizedCertificate + * @instance + */ + AuthorizedCertificate.prototype.visibleDomainMappings = $util.emptyArray; + + /** + * AuthorizedCertificate domainMappingsCount. + * @member {number} domainMappingsCount + * @memberof google.appengine.v1.AuthorizedCertificate + * @instance + */ + AuthorizedCertificate.prototype.domainMappingsCount = 0; + + /** + * Creates a new AuthorizedCertificate instance using the specified properties. + * @function create + * @memberof google.appengine.v1.AuthorizedCertificate + * @static + * @param {google.appengine.v1.IAuthorizedCertificate=} [properties] Properties to set + * @returns {google.appengine.v1.AuthorizedCertificate} AuthorizedCertificate instance + */ + AuthorizedCertificate.create = function create(properties) { + return new AuthorizedCertificate(properties); + }; + + /** + * Encodes the specified AuthorizedCertificate message. Does not implicitly {@link google.appengine.v1.AuthorizedCertificate.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.AuthorizedCertificate + * @static + * @param {google.appengine.v1.IAuthorizedCertificate} message AuthorizedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedCertificate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.domainNames != null && message.domainNames.length) + for (var i = 0; i < message.domainNames.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.domainNames[i]); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.certificateRawData != null && Object.hasOwnProperty.call(message, "certificateRawData")) + $root.google.appengine.v1.CertificateRawData.encode(message.certificateRawData, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.managedCertificate != null && Object.hasOwnProperty.call(message, "managedCertificate")) + $root.google.appengine.v1.ManagedCertificate.encode(message.managedCertificate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.visibleDomainMappings != null && message.visibleDomainMappings.length) + for (var i = 0; i < message.visibleDomainMappings.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.visibleDomainMappings[i]); + if (message.domainMappingsCount != null && Object.hasOwnProperty.call(message, "domainMappingsCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.domainMappingsCount); + return writer; + }; + + /** + * Encodes the specified AuthorizedCertificate message, length delimited. Does not implicitly {@link google.appengine.v1.AuthorizedCertificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.AuthorizedCertificate + * @static + * @param {google.appengine.v1.IAuthorizedCertificate} message AuthorizedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedCertificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizedCertificate message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.AuthorizedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.AuthorizedCertificate} AuthorizedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedCertificate.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.appengine.v1.AuthorizedCertificate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + if (!(message.domainNames && message.domainNames.length)) + message.domainNames = []; + message.domainNames.push(reader.string()); + break; + } + case 5: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.certificateRawData = $root.google.appengine.v1.CertificateRawData.decode(reader, reader.uint32()); + break; + } + case 7: { + message.managedCertificate = $root.google.appengine.v1.ManagedCertificate.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.visibleDomainMappings && message.visibleDomainMappings.length)) + message.visibleDomainMappings = []; + message.visibleDomainMappings.push(reader.string()); + break; + } + case 9: { + message.domainMappingsCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizedCertificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.AuthorizedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.AuthorizedCertificate} AuthorizedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedCertificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizedCertificate message. + * @function verify + * @memberof google.appengine.v1.AuthorizedCertificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizedCertificate.verify = function verify(message) { + if (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.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.domainNames != null && message.hasOwnProperty("domainNames")) { + if (!Array.isArray(message.domainNames)) + return "domainNames: array expected"; + for (var i = 0; i < message.domainNames.length; ++i) + if (!$util.isString(message.domainNames[i])) + return "domainNames: string[] expected"; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.certificateRawData != null && message.hasOwnProperty("certificateRawData")) { + var error = $root.google.appengine.v1.CertificateRawData.verify(message.certificateRawData); + if (error) + return "certificateRawData." + error; + } + if (message.managedCertificate != null && message.hasOwnProperty("managedCertificate")) { + var error = $root.google.appengine.v1.ManagedCertificate.verify(message.managedCertificate); + if (error) + return "managedCertificate." + error; + } + if (message.visibleDomainMappings != null && message.hasOwnProperty("visibleDomainMappings")) { + if (!Array.isArray(message.visibleDomainMappings)) + return "visibleDomainMappings: array expected"; + for (var i = 0; i < message.visibleDomainMappings.length; ++i) + if (!$util.isString(message.visibleDomainMappings[i])) + return "visibleDomainMappings: string[] expected"; + } + if (message.domainMappingsCount != null && message.hasOwnProperty("domainMappingsCount")) + if (!$util.isInteger(message.domainMappingsCount)) + return "domainMappingsCount: integer expected"; + return null; + }; + + /** + * Creates an AuthorizedCertificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.AuthorizedCertificate + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.AuthorizedCertificate} AuthorizedCertificate + */ + AuthorizedCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.AuthorizedCertificate) + return object; + var message = new $root.google.appengine.v1.AuthorizedCertificate(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.domainNames) { + if (!Array.isArray(object.domainNames)) + throw TypeError(".google.appengine.v1.AuthorizedCertificate.domainNames: array expected"); + message.domainNames = []; + for (var i = 0; i < object.domainNames.length; ++i) + message.domainNames[i] = String(object.domainNames[i]); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.appengine.v1.AuthorizedCertificate.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.certificateRawData != null) { + if (typeof object.certificateRawData !== "object") + throw TypeError(".google.appengine.v1.AuthorizedCertificate.certificateRawData: object expected"); + message.certificateRawData = $root.google.appengine.v1.CertificateRawData.fromObject(object.certificateRawData); + } + if (object.managedCertificate != null) { + if (typeof object.managedCertificate !== "object") + throw TypeError(".google.appengine.v1.AuthorizedCertificate.managedCertificate: object expected"); + message.managedCertificate = $root.google.appengine.v1.ManagedCertificate.fromObject(object.managedCertificate); + } + if (object.visibleDomainMappings) { + if (!Array.isArray(object.visibleDomainMappings)) + throw TypeError(".google.appengine.v1.AuthorizedCertificate.visibleDomainMappings: array expected"); + message.visibleDomainMappings = []; + for (var i = 0; i < object.visibleDomainMappings.length; ++i) + message.visibleDomainMappings[i] = String(object.visibleDomainMappings[i]); + } + if (object.domainMappingsCount != null) + message.domainMappingsCount = object.domainMappingsCount | 0; + return message; + }; + + /** + * Creates a plain object from an AuthorizedCertificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.AuthorizedCertificate + * @static + * @param {google.appengine.v1.AuthorizedCertificate} message AuthorizedCertificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizedCertificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.domainNames = []; + object.visibleDomainMappings = []; + } + if (options.defaults) { + object.name = ""; + object.id = ""; + object.displayName = ""; + object.expireTime = null; + object.certificateRawData = null; + object.managedCertificate = null; + object.domainMappingsCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.domainNames && message.domainNames.length) { + object.domainNames = []; + for (var j = 0; j < message.domainNames.length; ++j) + object.domainNames[j] = message.domainNames[j]; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.certificateRawData != null && message.hasOwnProperty("certificateRawData")) + object.certificateRawData = $root.google.appengine.v1.CertificateRawData.toObject(message.certificateRawData, options); + if (message.managedCertificate != null && message.hasOwnProperty("managedCertificate")) + object.managedCertificate = $root.google.appengine.v1.ManagedCertificate.toObject(message.managedCertificate, options); + if (message.visibleDomainMappings && message.visibleDomainMappings.length) { + object.visibleDomainMappings = []; + for (var j = 0; j < message.visibleDomainMappings.length; ++j) + object.visibleDomainMappings[j] = message.visibleDomainMappings[j]; + } + if (message.domainMappingsCount != null && message.hasOwnProperty("domainMappingsCount")) + object.domainMappingsCount = message.domainMappingsCount; + return object; + }; + + /** + * Converts this AuthorizedCertificate to JSON. + * @function toJSON + * @memberof google.appengine.v1.AuthorizedCertificate + * @instance + * @returns {Object.} JSON object + */ + AuthorizedCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizedCertificate + * @function getTypeUrl + * @memberof google.appengine.v1.AuthorizedCertificate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizedCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.AuthorizedCertificate"; + }; + + return AuthorizedCertificate; + })(); + + v1.CertificateRawData = (function() { + + /** + * Properties of a CertificateRawData. + * @memberof google.appengine.v1 + * @interface ICertificateRawData + * @property {string|null} [publicCertificate] CertificateRawData publicCertificate + * @property {string|null} [privateKey] CertificateRawData privateKey + */ + + /** + * Constructs a new CertificateRawData. + * @memberof google.appengine.v1 + * @classdesc Represents a CertificateRawData. + * @implements ICertificateRawData + * @constructor + * @param {google.appengine.v1.ICertificateRawData=} [properties] Properties to set + */ + function CertificateRawData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CertificateRawData publicCertificate. + * @member {string} publicCertificate + * @memberof google.appengine.v1.CertificateRawData + * @instance + */ + CertificateRawData.prototype.publicCertificate = ""; + + /** + * CertificateRawData privateKey. + * @member {string} privateKey + * @memberof google.appengine.v1.CertificateRawData + * @instance + */ + CertificateRawData.prototype.privateKey = ""; + + /** + * Creates a new CertificateRawData instance using the specified properties. + * @function create + * @memberof google.appengine.v1.CertificateRawData + * @static + * @param {google.appengine.v1.ICertificateRawData=} [properties] Properties to set + * @returns {google.appengine.v1.CertificateRawData} CertificateRawData instance + */ + CertificateRawData.create = function create(properties) { + return new CertificateRawData(properties); + }; + + /** + * Encodes the specified CertificateRawData message. Does not implicitly {@link google.appengine.v1.CertificateRawData.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.CertificateRawData + * @static + * @param {google.appengine.v1.ICertificateRawData} message CertificateRawData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateRawData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicCertificate != null && Object.hasOwnProperty.call(message, "publicCertificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.publicCertificate); + if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateKey); + return writer; + }; + + /** + * Encodes the specified CertificateRawData message, length delimited. Does not implicitly {@link google.appengine.v1.CertificateRawData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.CertificateRawData + * @static + * @param {google.appengine.v1.ICertificateRawData} message CertificateRawData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateRawData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateRawData message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.CertificateRawData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.CertificateRawData} CertificateRawData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateRawData.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.appengine.v1.CertificateRawData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.publicCertificate = reader.string(); + break; + } + case 2: { + message.privateKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateRawData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.CertificateRawData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.CertificateRawData} CertificateRawData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateRawData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateRawData message. + * @function verify + * @memberof google.appengine.v1.CertificateRawData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateRawData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicCertificate != null && message.hasOwnProperty("publicCertificate")) + if (!$util.isString(message.publicCertificate)) + return "publicCertificate: string expected"; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + if (!$util.isString(message.privateKey)) + return "privateKey: string expected"; + return null; + }; + + /** + * Creates a CertificateRawData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.CertificateRawData + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.CertificateRawData} CertificateRawData + */ + CertificateRawData.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.CertificateRawData) + return object; + var message = new $root.google.appengine.v1.CertificateRawData(); + if (object.publicCertificate != null) + message.publicCertificate = String(object.publicCertificate); + if (object.privateKey != null) + message.privateKey = String(object.privateKey); + return message; + }; + + /** + * Creates a plain object from a CertificateRawData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.CertificateRawData + * @static + * @param {google.appengine.v1.CertificateRawData} message CertificateRawData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateRawData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicCertificate = ""; + object.privateKey = ""; + } + if (message.publicCertificate != null && message.hasOwnProperty("publicCertificate")) + object.publicCertificate = message.publicCertificate; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + object.privateKey = message.privateKey; + return object; + }; + + /** + * Converts this CertificateRawData to JSON. + * @function toJSON + * @memberof google.appengine.v1.CertificateRawData + * @instance + * @returns {Object.} JSON object + */ + CertificateRawData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateRawData + * @function getTypeUrl + * @memberof google.appengine.v1.CertificateRawData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateRawData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.CertificateRawData"; + }; + + return CertificateRawData; + })(); + + /** + * ManagementStatus enum. + * @name google.appengine.v1.ManagementStatus + * @enum {number} + * @property {number} MANAGEMENT_STATUS_UNSPECIFIED=0 MANAGEMENT_STATUS_UNSPECIFIED value + * @property {number} OK=1 OK value + * @property {number} PENDING=2 PENDING value + * @property {number} FAILED_RETRYING_NOT_VISIBLE=4 FAILED_RETRYING_NOT_VISIBLE value + * @property {number} FAILED_PERMANENT=6 FAILED_PERMANENT value + * @property {number} FAILED_RETRYING_CAA_FORBIDDEN=7 FAILED_RETRYING_CAA_FORBIDDEN value + * @property {number} FAILED_RETRYING_CAA_CHECKING=8 FAILED_RETRYING_CAA_CHECKING value + */ + v1.ManagementStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MANAGEMENT_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "OK"] = 1; + values[valuesById[2] = "PENDING"] = 2; + values[valuesById[4] = "FAILED_RETRYING_NOT_VISIBLE"] = 4; + values[valuesById[6] = "FAILED_PERMANENT"] = 6; + values[valuesById[7] = "FAILED_RETRYING_CAA_FORBIDDEN"] = 7; + values[valuesById[8] = "FAILED_RETRYING_CAA_CHECKING"] = 8; + return values; + })(); + + v1.ManagedCertificate = (function() { + + /** + * Properties of a ManagedCertificate. + * @memberof google.appengine.v1 + * @interface IManagedCertificate + * @property {google.protobuf.ITimestamp|null} [lastRenewalTime] ManagedCertificate lastRenewalTime + * @property {google.appengine.v1.ManagementStatus|null} [status] ManagedCertificate status + */ + + /** + * Constructs a new ManagedCertificate. + * @memberof google.appengine.v1 + * @classdesc Represents a ManagedCertificate. + * @implements IManagedCertificate + * @constructor + * @param {google.appengine.v1.IManagedCertificate=} [properties] Properties to set + */ + function ManagedCertificate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagedCertificate lastRenewalTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastRenewalTime + * @memberof google.appengine.v1.ManagedCertificate + * @instance + */ + ManagedCertificate.prototype.lastRenewalTime = null; + + /** + * ManagedCertificate status. + * @member {google.appengine.v1.ManagementStatus} status + * @memberof google.appengine.v1.ManagedCertificate + * @instance + */ + ManagedCertificate.prototype.status = 0; + + /** + * Creates a new ManagedCertificate instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ManagedCertificate + * @static + * @param {google.appengine.v1.IManagedCertificate=} [properties] Properties to set + * @returns {google.appengine.v1.ManagedCertificate} ManagedCertificate instance + */ + ManagedCertificate.create = function create(properties) { + return new ManagedCertificate(properties); + }; + + /** + * Encodes the specified ManagedCertificate message. Does not implicitly {@link google.appengine.v1.ManagedCertificate.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ManagedCertificate + * @static + * @param {google.appengine.v1.IManagedCertificate} message ManagedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedCertificate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastRenewalTime != null && Object.hasOwnProperty.call(message, "lastRenewalTime")) + $root.google.protobuf.Timestamp.encode(message.lastRenewalTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); + return writer; + }; + + /** + * Encodes the specified ManagedCertificate message, length delimited. Does not implicitly {@link google.appengine.v1.ManagedCertificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ManagedCertificate + * @static + * @param {google.appengine.v1.IManagedCertificate} message ManagedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedCertificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagedCertificate message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ManagedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ManagedCertificate} ManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedCertificate.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.appengine.v1.ManagedCertificate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lastRenewalTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.status = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagedCertificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ManagedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ManagedCertificate} ManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedCertificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagedCertificate message. + * @function verify + * @memberof google.appengine.v1.ManagedCertificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagedCertificate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lastRenewalTime != null && message.hasOwnProperty("lastRenewalTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastRenewalTime); + if (error) + return "lastRenewalTime." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 6: + case 7: + case 8: + break; + } + return null; + }; + + /** + * Creates a ManagedCertificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ManagedCertificate + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ManagedCertificate} ManagedCertificate + */ + ManagedCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ManagedCertificate) + return object; + var message = new $root.google.appengine.v1.ManagedCertificate(); + if (object.lastRenewalTime != null) { + if (typeof object.lastRenewalTime !== "object") + throw TypeError(".google.appengine.v1.ManagedCertificate.lastRenewalTime: object expected"); + message.lastRenewalTime = $root.google.protobuf.Timestamp.fromObject(object.lastRenewalTime); + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "MANAGEMENT_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "OK": + case 1: + message.status = 1; + break; + case "PENDING": + case 2: + message.status = 2; + break; + case "FAILED_RETRYING_NOT_VISIBLE": + case 4: + message.status = 4; + break; + case "FAILED_PERMANENT": + case 6: + message.status = 6; + break; + case "FAILED_RETRYING_CAA_FORBIDDEN": + case 7: + message.status = 7; + break; + case "FAILED_RETRYING_CAA_CHECKING": + case 8: + message.status = 8; + break; + } + return message; + }; + + /** + * Creates a plain object from a ManagedCertificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ManagedCertificate + * @static + * @param {google.appengine.v1.ManagedCertificate} message ManagedCertificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagedCertificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lastRenewalTime = null; + object.status = options.enums === String ? "MANAGEMENT_STATUS_UNSPECIFIED" : 0; + } + if (message.lastRenewalTime != null && message.hasOwnProperty("lastRenewalTime")) + object.lastRenewalTime = $root.google.protobuf.Timestamp.toObject(message.lastRenewalTime, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.appengine.v1.ManagementStatus[message.status] === undefined ? message.status : $root.google.appengine.v1.ManagementStatus[message.status] : message.status; + return object; + }; + + /** + * Converts this ManagedCertificate to JSON. + * @function toJSON + * @memberof google.appengine.v1.ManagedCertificate + * @instance + * @returns {Object.} JSON object + */ + ManagedCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ManagedCertificate + * @function getTypeUrl + * @memberof google.appengine.v1.ManagedCertificate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ManagedCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ManagedCertificate"; + }; + + return ManagedCertificate; + })(); + + v1.AuthorizedDomain = (function() { + + /** + * Properties of an AuthorizedDomain. + * @memberof google.appengine.v1 + * @interface IAuthorizedDomain + * @property {string|null} [name] AuthorizedDomain name + * @property {string|null} [id] AuthorizedDomain id + */ + + /** + * Constructs a new AuthorizedDomain. + * @memberof google.appengine.v1 + * @classdesc Represents an AuthorizedDomain. + * @implements IAuthorizedDomain + * @constructor + * @param {google.appengine.v1.IAuthorizedDomain=} [properties] Properties to set + */ + function AuthorizedDomain(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthorizedDomain name. + * @member {string} name + * @memberof google.appengine.v1.AuthorizedDomain + * @instance + */ + AuthorizedDomain.prototype.name = ""; + + /** + * AuthorizedDomain id. + * @member {string} id + * @memberof google.appengine.v1.AuthorizedDomain + * @instance + */ + AuthorizedDomain.prototype.id = ""; + + /** + * Creates a new AuthorizedDomain instance using the specified properties. + * @function create + * @memberof google.appengine.v1.AuthorizedDomain + * @static + * @param {google.appengine.v1.IAuthorizedDomain=} [properties] Properties to set + * @returns {google.appengine.v1.AuthorizedDomain} AuthorizedDomain instance + */ + AuthorizedDomain.create = function create(properties) { + return new AuthorizedDomain(properties); + }; + + /** + * Encodes the specified AuthorizedDomain message. Does not implicitly {@link google.appengine.v1.AuthorizedDomain.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.AuthorizedDomain + * @static + * @param {google.appengine.v1.IAuthorizedDomain} message AuthorizedDomain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedDomain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + return writer; + }; + + /** + * Encodes the specified AuthorizedDomain message, length delimited. Does not implicitly {@link google.appengine.v1.AuthorizedDomain.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.AuthorizedDomain + * @static + * @param {google.appengine.v1.IAuthorizedDomain} message AuthorizedDomain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedDomain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizedDomain message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.AuthorizedDomain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.AuthorizedDomain} AuthorizedDomain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedDomain.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.appengine.v1.AuthorizedDomain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizedDomain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.AuthorizedDomain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.AuthorizedDomain} AuthorizedDomain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedDomain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizedDomain message. + * @function verify + * @memberof google.appengine.v1.AuthorizedDomain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizedDomain.verify = function verify(message) { + if (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.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates an AuthorizedDomain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.AuthorizedDomain + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.AuthorizedDomain} AuthorizedDomain + */ + AuthorizedDomain.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.AuthorizedDomain) + return object; + var message = new $root.google.appengine.v1.AuthorizedDomain(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from an AuthorizedDomain message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.AuthorizedDomain + * @static + * @param {google.appengine.v1.AuthorizedDomain} message AuthorizedDomain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizedDomain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.id = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this AuthorizedDomain to JSON. + * @function toJSON + * @memberof google.appengine.v1.AuthorizedDomain + * @instance + * @returns {Object.} JSON object + */ + AuthorizedDomain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizedDomain + * @function getTypeUrl + * @memberof google.appengine.v1.AuthorizedDomain + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizedDomain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.AuthorizedDomain"; + }; + + return AuthorizedDomain; + })(); + + v1.DomainMapping = (function() { + + /** + * Properties of a DomainMapping. + * @memberof google.appengine.v1 + * @interface IDomainMapping + * @property {string|null} [name] DomainMapping name + * @property {string|null} [id] DomainMapping id + * @property {google.appengine.v1.ISslSettings|null} [sslSettings] DomainMapping sslSettings + * @property {Array.|null} [resourceRecords] DomainMapping resourceRecords + */ + + /** + * Constructs a new DomainMapping. + * @memberof google.appengine.v1 + * @classdesc Represents a DomainMapping. + * @implements IDomainMapping + * @constructor + * @param {google.appengine.v1.IDomainMapping=} [properties] Properties to set + */ + function DomainMapping(properties) { + this.resourceRecords = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DomainMapping name. + * @member {string} name + * @memberof google.appengine.v1.DomainMapping + * @instance + */ + DomainMapping.prototype.name = ""; + + /** + * DomainMapping id. + * @member {string} id + * @memberof google.appengine.v1.DomainMapping + * @instance + */ + DomainMapping.prototype.id = ""; + + /** + * DomainMapping sslSettings. + * @member {google.appengine.v1.ISslSettings|null|undefined} sslSettings + * @memberof google.appengine.v1.DomainMapping + * @instance + */ + DomainMapping.prototype.sslSettings = null; + + /** + * DomainMapping resourceRecords. + * @member {Array.} resourceRecords + * @memberof google.appengine.v1.DomainMapping + * @instance + */ + DomainMapping.prototype.resourceRecords = $util.emptyArray; + + /** + * Creates a new DomainMapping instance using the specified properties. + * @function create + * @memberof google.appengine.v1.DomainMapping + * @static + * @param {google.appengine.v1.IDomainMapping=} [properties] Properties to set + * @returns {google.appengine.v1.DomainMapping} DomainMapping instance + */ + DomainMapping.create = function create(properties) { + return new DomainMapping(properties); + }; + + /** + * Encodes the specified DomainMapping message. Does not implicitly {@link google.appengine.v1.DomainMapping.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.DomainMapping + * @static + * @param {google.appengine.v1.IDomainMapping} message DomainMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DomainMapping.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.sslSettings != null && Object.hasOwnProperty.call(message, "sslSettings")) + $root.google.appengine.v1.SslSettings.encode(message.sslSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.resourceRecords != null && message.resourceRecords.length) + for (var i = 0; i < message.resourceRecords.length; ++i) + $root.google.appengine.v1.ResourceRecord.encode(message.resourceRecords[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DomainMapping message, length delimited. Does not implicitly {@link google.appengine.v1.DomainMapping.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.DomainMapping + * @static + * @param {google.appengine.v1.IDomainMapping} message DomainMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DomainMapping.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DomainMapping message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.DomainMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.DomainMapping} DomainMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DomainMapping.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.appengine.v1.DomainMapping(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.sslSettings = $root.google.appengine.v1.SslSettings.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.resourceRecords && message.resourceRecords.length)) + message.resourceRecords = []; + message.resourceRecords.push($root.google.appengine.v1.ResourceRecord.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DomainMapping message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.DomainMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.DomainMapping} DomainMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DomainMapping.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DomainMapping message. + * @function verify + * @memberof google.appengine.v1.DomainMapping + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DomainMapping.verify = function verify(message) { + if (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.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.sslSettings != null && message.hasOwnProperty("sslSettings")) { + var error = $root.google.appengine.v1.SslSettings.verify(message.sslSettings); + if (error) + return "sslSettings." + error; + } + if (message.resourceRecords != null && message.hasOwnProperty("resourceRecords")) { + if (!Array.isArray(message.resourceRecords)) + return "resourceRecords: array expected"; + for (var i = 0; i < message.resourceRecords.length; ++i) { + var error = $root.google.appengine.v1.ResourceRecord.verify(message.resourceRecords[i]); + if (error) + return "resourceRecords." + error; + } + } + return null; + }; + + /** + * Creates a DomainMapping message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.DomainMapping + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.DomainMapping} DomainMapping + */ + DomainMapping.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.DomainMapping) + return object; + var message = new $root.google.appengine.v1.DomainMapping(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + if (object.sslSettings != null) { + if (typeof object.sslSettings !== "object") + throw TypeError(".google.appengine.v1.DomainMapping.sslSettings: object expected"); + message.sslSettings = $root.google.appengine.v1.SslSettings.fromObject(object.sslSettings); + } + if (object.resourceRecords) { + if (!Array.isArray(object.resourceRecords)) + throw TypeError(".google.appengine.v1.DomainMapping.resourceRecords: array expected"); + message.resourceRecords = []; + for (var i = 0; i < object.resourceRecords.length; ++i) { + if (typeof object.resourceRecords[i] !== "object") + throw TypeError(".google.appengine.v1.DomainMapping.resourceRecords: object expected"); + message.resourceRecords[i] = $root.google.appengine.v1.ResourceRecord.fromObject(object.resourceRecords[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DomainMapping message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.DomainMapping + * @static + * @param {google.appengine.v1.DomainMapping} message DomainMapping + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DomainMapping.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceRecords = []; + if (options.defaults) { + object.name = ""; + object.id = ""; + object.sslSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.sslSettings != null && message.hasOwnProperty("sslSettings")) + object.sslSettings = $root.google.appengine.v1.SslSettings.toObject(message.sslSettings, options); + if (message.resourceRecords && message.resourceRecords.length) { + object.resourceRecords = []; + for (var j = 0; j < message.resourceRecords.length; ++j) + object.resourceRecords[j] = $root.google.appengine.v1.ResourceRecord.toObject(message.resourceRecords[j], options); + } + return object; + }; + + /** + * Converts this DomainMapping to JSON. + * @function toJSON + * @memberof google.appengine.v1.DomainMapping + * @instance + * @returns {Object.} JSON object + */ + DomainMapping.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DomainMapping + * @function getTypeUrl + * @memberof google.appengine.v1.DomainMapping + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DomainMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.DomainMapping"; + }; + + return DomainMapping; + })(); + + v1.SslSettings = (function() { + + /** + * Properties of a SslSettings. + * @memberof google.appengine.v1 + * @interface ISslSettings + * @property {string|null} [certificateId] SslSettings certificateId + * @property {google.appengine.v1.SslSettings.SslManagementType|null} [sslManagementType] SslSettings sslManagementType + * @property {string|null} [pendingManagedCertificateId] SslSettings pendingManagedCertificateId + */ + + /** + * Constructs a new SslSettings. + * @memberof google.appengine.v1 + * @classdesc Represents a SslSettings. + * @implements ISslSettings + * @constructor + * @param {google.appengine.v1.ISslSettings=} [properties] Properties to set + */ + function SslSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslSettings certificateId. + * @member {string} certificateId + * @memberof google.appengine.v1.SslSettings + * @instance + */ + SslSettings.prototype.certificateId = ""; + + /** + * SslSettings sslManagementType. + * @member {google.appengine.v1.SslSettings.SslManagementType} sslManagementType + * @memberof google.appengine.v1.SslSettings + * @instance + */ + SslSettings.prototype.sslManagementType = 0; + + /** + * SslSettings pendingManagedCertificateId. + * @member {string} pendingManagedCertificateId + * @memberof google.appengine.v1.SslSettings + * @instance + */ + SslSettings.prototype.pendingManagedCertificateId = ""; + + /** + * Creates a new SslSettings instance using the specified properties. + * @function create + * @memberof google.appengine.v1.SslSettings + * @static + * @param {google.appengine.v1.ISslSettings=} [properties] Properties to set + * @returns {google.appengine.v1.SslSettings} SslSettings instance + */ + SslSettings.create = function create(properties) { + return new SslSettings(properties); + }; + + /** + * Encodes the specified SslSettings message. Does not implicitly {@link google.appengine.v1.SslSettings.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.SslSettings + * @static + * @param {google.appengine.v1.ISslSettings} message SslSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateId != null && Object.hasOwnProperty.call(message, "certificateId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificateId); + if (message.sslManagementType != null && Object.hasOwnProperty.call(message, "sslManagementType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sslManagementType); + if (message.pendingManagedCertificateId != null && Object.hasOwnProperty.call(message, "pendingManagedCertificateId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pendingManagedCertificateId); + return writer; + }; + + /** + * Encodes the specified SslSettings message, length delimited. Does not implicitly {@link google.appengine.v1.SslSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.SslSettings + * @static + * @param {google.appengine.v1.ISslSettings} message SslSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslSettings message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.SslSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.SslSettings} SslSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslSettings.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.appengine.v1.SslSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.certificateId = reader.string(); + break; + } + case 3: { + message.sslManagementType = reader.int32(); + break; + } + case 4: { + message.pendingManagedCertificateId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.SslSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.SslSettings} SslSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslSettings message. + * @function verify + * @memberof google.appengine.v1.SslSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateId != null && message.hasOwnProperty("certificateId")) + if (!$util.isString(message.certificateId)) + return "certificateId: string expected"; + if (message.sslManagementType != null && message.hasOwnProperty("sslManagementType")) + switch (message.sslManagementType) { + default: + return "sslManagementType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.pendingManagedCertificateId != null && message.hasOwnProperty("pendingManagedCertificateId")) + if (!$util.isString(message.pendingManagedCertificateId)) + return "pendingManagedCertificateId: string expected"; + return null; + }; + + /** + * Creates a SslSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.SslSettings + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.SslSettings} SslSettings + */ + SslSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.SslSettings) + return object; + var message = new $root.google.appengine.v1.SslSettings(); + if (object.certificateId != null) + message.certificateId = String(object.certificateId); + switch (object.sslManagementType) { + default: + if (typeof object.sslManagementType === "number") { + message.sslManagementType = object.sslManagementType; + break; + } + break; + case "SSL_MANAGEMENT_TYPE_UNSPECIFIED": + case 0: + message.sslManagementType = 0; + break; + case "AUTOMATIC": + case 1: + message.sslManagementType = 1; + break; + case "MANUAL": + case 2: + message.sslManagementType = 2; + break; + } + if (object.pendingManagedCertificateId != null) + message.pendingManagedCertificateId = String(object.pendingManagedCertificateId); + return message; + }; + + /** + * Creates a plain object from a SslSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.SslSettings + * @static + * @param {google.appengine.v1.SslSettings} message SslSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificateId = ""; + object.sslManagementType = options.enums === String ? "SSL_MANAGEMENT_TYPE_UNSPECIFIED" : 0; + object.pendingManagedCertificateId = ""; + } + if (message.certificateId != null && message.hasOwnProperty("certificateId")) + object.certificateId = message.certificateId; + if (message.sslManagementType != null && message.hasOwnProperty("sslManagementType")) + object.sslManagementType = options.enums === String ? $root.google.appengine.v1.SslSettings.SslManagementType[message.sslManagementType] === undefined ? message.sslManagementType : $root.google.appengine.v1.SslSettings.SslManagementType[message.sslManagementType] : message.sslManagementType; + if (message.pendingManagedCertificateId != null && message.hasOwnProperty("pendingManagedCertificateId")) + object.pendingManagedCertificateId = message.pendingManagedCertificateId; + return object; + }; + + /** + * Converts this SslSettings to JSON. + * @function toJSON + * @memberof google.appengine.v1.SslSettings + * @instance + * @returns {Object.} JSON object + */ + SslSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SslSettings + * @function getTypeUrl + * @memberof google.appengine.v1.SslSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SslSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.SslSettings"; + }; + + /** + * SslManagementType enum. + * @name google.appengine.v1.SslSettings.SslManagementType + * @enum {number} + * @property {number} SSL_MANAGEMENT_TYPE_UNSPECIFIED=0 SSL_MANAGEMENT_TYPE_UNSPECIFIED value + * @property {number} AUTOMATIC=1 AUTOMATIC value + * @property {number} MANUAL=2 MANUAL value + */ + SslSettings.SslManagementType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSL_MANAGEMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOMATIC"] = 1; + values[valuesById[2] = "MANUAL"] = 2; + return values; + })(); + + return SslSettings; + })(); + + v1.ResourceRecord = (function() { + + /** + * Properties of a ResourceRecord. + * @memberof google.appengine.v1 + * @interface IResourceRecord + * @property {string|null} [name] ResourceRecord name + * @property {string|null} [rrdata] ResourceRecord rrdata + * @property {google.appengine.v1.ResourceRecord.RecordType|null} [type] ResourceRecord type + */ + + /** + * Constructs a new ResourceRecord. + * @memberof google.appengine.v1 + * @classdesc Represents a ResourceRecord. + * @implements IResourceRecord + * @constructor + * @param {google.appengine.v1.IResourceRecord=} [properties] Properties to set + */ + function ResourceRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceRecord name. + * @member {string} name + * @memberof google.appengine.v1.ResourceRecord + * @instance + */ + ResourceRecord.prototype.name = ""; + + /** + * ResourceRecord rrdata. + * @member {string} rrdata + * @memberof google.appengine.v1.ResourceRecord + * @instance + */ + ResourceRecord.prototype.rrdata = ""; + + /** + * ResourceRecord type. + * @member {google.appengine.v1.ResourceRecord.RecordType} type + * @memberof google.appengine.v1.ResourceRecord + * @instance + */ + ResourceRecord.prototype.type = 0; + + /** + * Creates a new ResourceRecord instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ResourceRecord + * @static + * @param {google.appengine.v1.IResourceRecord=} [properties] Properties to set + * @returns {google.appengine.v1.ResourceRecord} ResourceRecord instance + */ + ResourceRecord.create = function create(properties) { + return new ResourceRecord(properties); + }; + + /** + * Encodes the specified ResourceRecord message. Does not implicitly {@link google.appengine.v1.ResourceRecord.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ResourceRecord + * @static + * @param {google.appengine.v1.IResourceRecord} message ResourceRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.rrdata != null && Object.hasOwnProperty.call(message, "rrdata")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rrdata); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + return writer; + }; + + /** + * Encodes the specified ResourceRecord message, length delimited. Does not implicitly {@link google.appengine.v1.ResourceRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ResourceRecord + * @static + * @param {google.appengine.v1.IResourceRecord} message ResourceRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceRecord message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ResourceRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ResourceRecord} ResourceRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceRecord.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.appengine.v1.ResourceRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.rrdata = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ResourceRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ResourceRecord} ResourceRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceRecord message. + * @function verify + * @memberof google.appengine.v1.ResourceRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceRecord.verify = function verify(message) { + if (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.rrdata != null && message.hasOwnProperty("rrdata")) + if (!$util.isString(message.rrdata)) + return "rrdata: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ResourceRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ResourceRecord + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ResourceRecord} ResourceRecord + */ + ResourceRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ResourceRecord) + return object; + var message = new $root.google.appengine.v1.ResourceRecord(); + if (object.name != null) + message.name = String(object.name); + if (object.rrdata != null) + message.rrdata = String(object.rrdata); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "RECORD_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "A": + case 1: + message.type = 1; + break; + case "AAAA": + case 2: + message.type = 2; + break; + case "CNAME": + case 3: + message.type = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourceRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ResourceRecord + * @static + * @param {google.appengine.v1.ResourceRecord} message ResourceRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.rrdata = ""; + object.type = options.enums === String ? "RECORD_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.rrdata != null && message.hasOwnProperty("rrdata")) + object.rrdata = message.rrdata; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.appengine.v1.ResourceRecord.RecordType[message.type] === undefined ? message.type : $root.google.appengine.v1.ResourceRecord.RecordType[message.type] : message.type; + return object; + }; + + /** + * Converts this ResourceRecord to JSON. + * @function toJSON + * @memberof google.appengine.v1.ResourceRecord + * @instance + * @returns {Object.} JSON object + */ + ResourceRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceRecord + * @function getTypeUrl + * @memberof google.appengine.v1.ResourceRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ResourceRecord"; + }; + + /** + * RecordType enum. + * @name google.appengine.v1.ResourceRecord.RecordType + * @enum {number} + * @property {number} RECORD_TYPE_UNSPECIFIED=0 RECORD_TYPE_UNSPECIFIED value + * @property {number} A=1 A value + * @property {number} AAAA=2 AAAA value + * @property {number} CNAME=3 CNAME value + */ + ResourceRecord.RecordType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECORD_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "A"] = 1; + values[valuesById[2] = "AAAA"] = 2; + values[valuesById[3] = "CNAME"] = 3; + return values; + })(); + + return ResourceRecord; + })(); + + v1.FirewallRule = (function() { + + /** + * Properties of a FirewallRule. + * @memberof google.appengine.v1 + * @interface IFirewallRule + * @property {number|null} [priority] FirewallRule priority + * @property {google.appengine.v1.FirewallRule.Action|null} [action] FirewallRule action + * @property {string|null} [sourceRange] FirewallRule sourceRange + * @property {string|null} [description] FirewallRule description + */ + + /** + * Constructs a new FirewallRule. + * @memberof google.appengine.v1 + * @classdesc Represents a FirewallRule. + * @implements IFirewallRule + * @constructor + * @param {google.appengine.v1.IFirewallRule=} [properties] Properties to set + */ + function FirewallRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FirewallRule priority. + * @member {number} priority + * @memberof google.appengine.v1.FirewallRule + * @instance + */ + FirewallRule.prototype.priority = 0; + + /** + * FirewallRule action. + * @member {google.appengine.v1.FirewallRule.Action} action + * @memberof google.appengine.v1.FirewallRule + * @instance + */ + FirewallRule.prototype.action = 0; + + /** + * FirewallRule sourceRange. + * @member {string} sourceRange + * @memberof google.appengine.v1.FirewallRule + * @instance + */ + FirewallRule.prototype.sourceRange = ""; + + /** + * FirewallRule description. + * @member {string} description + * @memberof google.appengine.v1.FirewallRule + * @instance + */ + FirewallRule.prototype.description = ""; + + /** + * Creates a new FirewallRule instance using the specified properties. + * @function create + * @memberof google.appengine.v1.FirewallRule + * @static + * @param {google.appengine.v1.IFirewallRule=} [properties] Properties to set + * @returns {google.appengine.v1.FirewallRule} FirewallRule instance + */ + FirewallRule.create = function create(properties) { + return new FirewallRule(properties); + }; + + /** + * Encodes the specified FirewallRule message. Does not implicitly {@link google.appengine.v1.FirewallRule.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.FirewallRule + * @static + * @param {google.appengine.v1.IFirewallRule} message FirewallRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.priority); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.action); + if (message.sourceRange != null && Object.hasOwnProperty.call(message, "sourceRange")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceRange); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + return writer; + }; + + /** + * Encodes the specified FirewallRule message, length delimited. Does not implicitly {@link google.appengine.v1.FirewallRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.FirewallRule + * @static + * @param {google.appengine.v1.IFirewallRule} message FirewallRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallRule message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.FirewallRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.FirewallRule} FirewallRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallRule.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.appengine.v1.FirewallRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.priority = reader.int32(); + break; + } + case 2: { + message.action = reader.int32(); + break; + } + case 3: { + message.sourceRange = reader.string(); + break; + } + case 4: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.FirewallRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.FirewallRule} FirewallRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallRule message. + * @function verify + * @memberof google.appengine.v1.FirewallRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.sourceRange != null && message.hasOwnProperty("sourceRange")) + if (!$util.isString(message.sourceRange)) + return "sourceRange: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a FirewallRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.FirewallRule + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.FirewallRule} FirewallRule + */ + FirewallRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.FirewallRule) + return object; + var message = new $root.google.appengine.v1.FirewallRule(); + if (object.priority != null) + message.priority = object.priority | 0; + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "UNSPECIFIED_ACTION": + case 0: + message.action = 0; + break; + case "ALLOW": + case 1: + message.action = 1; + break; + case "DENY": + case 2: + message.action = 2; + break; + } + if (object.sourceRange != null) + message.sourceRange = String(object.sourceRange); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a FirewallRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.FirewallRule + * @static + * @param {google.appengine.v1.FirewallRule} message FirewallRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.priority = 0; + object.action = options.enums === String ? "UNSPECIFIED_ACTION" : 0; + object.sourceRange = ""; + object.description = ""; + } + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = message.priority; + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.appengine.v1.FirewallRule.Action[message.action] === undefined ? message.action : $root.google.appengine.v1.FirewallRule.Action[message.action] : message.action; + if (message.sourceRange != null && message.hasOwnProperty("sourceRange")) + object.sourceRange = message.sourceRange; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this FirewallRule to JSON. + * @function toJSON + * @memberof google.appengine.v1.FirewallRule + * @instance + * @returns {Object.} JSON object + */ + FirewallRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FirewallRule + * @function getTypeUrl + * @memberof google.appengine.v1.FirewallRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FirewallRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.FirewallRule"; + }; + + /** + * Action enum. + * @name google.appengine.v1.FirewallRule.Action + * @enum {number} + * @property {number} UNSPECIFIED_ACTION=0 UNSPECIFIED_ACTION value + * @property {number} ALLOW=1 ALLOW value + * @property {number} DENY=2 DENY value + */ + FirewallRule.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED_ACTION"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "DENY"] = 2; + return values; + })(); + + return FirewallRule; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.appengine.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [id] Instance id + * @property {string|null} [appEngineRelease] Instance appEngineRelease + * @property {google.appengine.v1.Instance.Availability|null} [availability] Instance availability + * @property {string|null} [vmName] Instance vmName + * @property {string|null} [vmZoneName] Instance vmZoneName + * @property {string|null} [vmId] Instance vmId + * @property {google.protobuf.ITimestamp|null} [startTime] Instance startTime + * @property {number|null} [requests] Instance requests + * @property {number|null} [errors] Instance errors + * @property {number|null} [qps] Instance qps + * @property {number|null} [averageLatency] Instance averageLatency + * @property {number|Long|null} [memoryUsage] Instance memoryUsage + * @property {string|null} [vmStatus] Instance vmStatus + * @property {boolean|null} [vmDebugEnabled] Instance vmDebugEnabled + * @property {string|null} [vmIp] Instance vmIp + * @property {google.appengine.v1.Instance.Liveness.LivenessState|null} [vmLiveness] Instance vmLiveness + */ + + /** + * Constructs a new Instance. + * @memberof google.appengine.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.appengine.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance id. + * @member {string} id + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.id = ""; + + /** + * Instance appEngineRelease. + * @member {string} appEngineRelease + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.appEngineRelease = ""; + + /** + * Instance availability. + * @member {google.appengine.v1.Instance.Availability} availability + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.availability = 0; + + /** + * Instance vmName. + * @member {string} vmName + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.vmName = ""; + + /** + * Instance vmZoneName. + * @member {string} vmZoneName + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.vmZoneName = ""; + + /** + * Instance vmId. + * @member {string} vmId + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.vmId = ""; + + /** + * Instance startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.startTime = null; + + /** + * Instance requests. + * @member {number} requests + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.requests = 0; + + /** + * Instance errors. + * @member {number} errors + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.errors = 0; + + /** + * Instance qps. + * @member {number} qps + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.qps = 0; + + /** + * Instance averageLatency. + * @member {number} averageLatency + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.averageLatency = 0; + + /** + * Instance memoryUsage. + * @member {number|Long} memoryUsage + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.memoryUsage = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance vmStatus. + * @member {string} vmStatus + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.vmStatus = ""; + + /** + * Instance vmDebugEnabled. + * @member {boolean} vmDebugEnabled + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.vmDebugEnabled = false; + + /** + * Instance vmIp. + * @member {string} vmIp + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.vmIp = ""; + + /** + * Instance vmLiveness. + * @member {google.appengine.v1.Instance.Liveness.LivenessState} vmLiveness + * @memberof google.appengine.v1.Instance + * @instance + */ + Instance.prototype.vmLiveness = 0; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Instance + * @static + * @param {google.appengine.v1.IInstance=} [properties] Properties to set + * @returns {google.appengine.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.appengine.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Instance + * @static + * @param {google.appengine.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.appEngineRelease != null && Object.hasOwnProperty.call(message, "appEngineRelease")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.appEngineRelease); + if (message.availability != null && Object.hasOwnProperty.call(message, "availability")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.availability); + if (message.vmName != null && Object.hasOwnProperty.call(message, "vmName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.vmName); + if (message.vmZoneName != null && Object.hasOwnProperty.call(message, "vmZoneName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.vmZoneName); + if (message.vmId != null && Object.hasOwnProperty.call(message, "vmId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.vmId); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.requests); + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.errors); + if (message.qps != null && Object.hasOwnProperty.call(message, "qps")) + writer.uint32(/* id 11, wireType 5 =*/93).float(message.qps); + if (message.averageLatency != null && Object.hasOwnProperty.call(message, "averageLatency")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.averageLatency); + if (message.memoryUsage != null && Object.hasOwnProperty.call(message, "memoryUsage")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.memoryUsage); + if (message.vmStatus != null && Object.hasOwnProperty.call(message, "vmStatus")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.vmStatus); + if (message.vmDebugEnabled != null && Object.hasOwnProperty.call(message, "vmDebugEnabled")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.vmDebugEnabled); + if (message.vmIp != null && Object.hasOwnProperty.call(message, "vmIp")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.vmIp); + if (message.vmLiveness != null && Object.hasOwnProperty.call(message, "vmLiveness")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.vmLiveness); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.appengine.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Instance + * @static + * @param {google.appengine.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.Instance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.appEngineRelease = reader.string(); + break; + } + case 4: { + message.availability = reader.int32(); + break; + } + case 5: { + message.vmName = reader.string(); + break; + } + case 6: { + message.vmZoneName = reader.string(); + break; + } + case 7: { + message.vmId = reader.string(); + break; + } + case 8: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.requests = reader.int32(); + break; + } + case 10: { + message.errors = reader.int32(); + break; + } + case 11: { + message.qps = reader.float(); + break; + } + case 12: { + message.averageLatency = reader.int32(); + break; + } + case 13: { + message.memoryUsage = reader.int64(); + break; + } + case 14: { + message.vmStatus = reader.string(); + break; + } + case 15: { + message.vmDebugEnabled = reader.bool(); + break; + } + case 16: { + message.vmIp = reader.string(); + break; + } + case 17: { + message.vmLiveness = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.appengine.v1.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.appEngineRelease != null && message.hasOwnProperty("appEngineRelease")) + if (!$util.isString(message.appEngineRelease)) + return "appEngineRelease: string expected"; + if (message.availability != null && message.hasOwnProperty("availability")) + switch (message.availability) { + default: + return "availability: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.vmName != null && message.hasOwnProperty("vmName")) + if (!$util.isString(message.vmName)) + return "vmName: string expected"; + if (message.vmZoneName != null && message.hasOwnProperty("vmZoneName")) + if (!$util.isString(message.vmZoneName)) + return "vmZoneName: string expected"; + if (message.vmId != null && message.hasOwnProperty("vmId")) + if (!$util.isString(message.vmId)) + return "vmId: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.requests != null && message.hasOwnProperty("requests")) + if (!$util.isInteger(message.requests)) + return "requests: integer expected"; + if (message.errors != null && message.hasOwnProperty("errors")) + if (!$util.isInteger(message.errors)) + return "errors: integer expected"; + if (message.qps != null && message.hasOwnProperty("qps")) + if (typeof message.qps !== "number") + return "qps: number expected"; + if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) + if (!$util.isInteger(message.averageLatency)) + return "averageLatency: integer expected"; + if (message.memoryUsage != null && message.hasOwnProperty("memoryUsage")) + if (!$util.isInteger(message.memoryUsage) && !(message.memoryUsage && $util.isInteger(message.memoryUsage.low) && $util.isInteger(message.memoryUsage.high))) + return "memoryUsage: integer|Long expected"; + if (message.vmStatus != null && message.hasOwnProperty("vmStatus")) + if (!$util.isString(message.vmStatus)) + return "vmStatus: string expected"; + if (message.vmDebugEnabled != null && message.hasOwnProperty("vmDebugEnabled")) + if (typeof message.vmDebugEnabled !== "boolean") + return "vmDebugEnabled: boolean expected"; + if (message.vmIp != null && message.hasOwnProperty("vmIp")) + if (!$util.isString(message.vmIp)) + return "vmIp: string expected"; + if (message.vmLiveness != null && message.hasOwnProperty("vmLiveness")) + switch (message.vmLiveness) { + default: + return "vmLiveness: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Instance) + return object; + var message = new $root.google.appengine.v1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + if (object.appEngineRelease != null) + message.appEngineRelease = String(object.appEngineRelease); + switch (object.availability) { + default: + if (typeof object.availability === "number") { + message.availability = object.availability; + break; + } + break; + case "UNSPECIFIED": + case 0: + message.availability = 0; + break; + case "RESIDENT": + case 1: + message.availability = 1; + break; + case "DYNAMIC": + case 2: + message.availability = 2; + break; + } + if (object.vmName != null) + message.vmName = String(object.vmName); + if (object.vmZoneName != null) + message.vmZoneName = String(object.vmZoneName); + if (object.vmId != null) + message.vmId = String(object.vmId); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.appengine.v1.Instance.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.requests != null) + message.requests = object.requests | 0; + if (object.errors != null) + message.errors = object.errors | 0; + if (object.qps != null) + message.qps = Number(object.qps); + if (object.averageLatency != null) + message.averageLatency = object.averageLatency | 0; + if (object.memoryUsage != null) + if ($util.Long) + (message.memoryUsage = $util.Long.fromValue(object.memoryUsage)).unsigned = false; + else if (typeof object.memoryUsage === "string") + message.memoryUsage = parseInt(object.memoryUsage, 10); + else if (typeof object.memoryUsage === "number") + message.memoryUsage = object.memoryUsage; + else if (typeof object.memoryUsage === "object") + message.memoryUsage = new $util.LongBits(object.memoryUsage.low >>> 0, object.memoryUsage.high >>> 0).toNumber(); + if (object.vmStatus != null) + message.vmStatus = String(object.vmStatus); + if (object.vmDebugEnabled != null) + message.vmDebugEnabled = Boolean(object.vmDebugEnabled); + if (object.vmIp != null) + message.vmIp = String(object.vmIp); + switch (object.vmLiveness) { + default: + if (typeof object.vmLiveness === "number") { + message.vmLiveness = object.vmLiveness; + break; + } + break; + case "LIVENESS_STATE_UNSPECIFIED": + case 0: + message.vmLiveness = 0; + break; + case "UNKNOWN": + case 1: + message.vmLiveness = 1; + break; + case "HEALTHY": + case 2: + message.vmLiveness = 2; + break; + case "UNHEALTHY": + case 3: + message.vmLiveness = 3; + break; + case "DRAINING": + case 4: + message.vmLiveness = 4; + break; + case "TIMEOUT": + case 5: + message.vmLiveness = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Instance + * @static + * @param {google.appengine.v1.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.id = ""; + object.appEngineRelease = ""; + object.availability = options.enums === String ? "UNSPECIFIED" : 0; + object.vmName = ""; + object.vmZoneName = ""; + object.vmId = ""; + object.startTime = null; + object.requests = 0; + object.errors = 0; + object.qps = 0; + object.averageLatency = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.memoryUsage = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.memoryUsage = options.longs === String ? "0" : 0; + object.vmStatus = ""; + object.vmDebugEnabled = false; + object.vmIp = ""; + object.vmLiveness = options.enums === String ? "LIVENESS_STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.appEngineRelease != null && message.hasOwnProperty("appEngineRelease")) + object.appEngineRelease = message.appEngineRelease; + if (message.availability != null && message.hasOwnProperty("availability")) + object.availability = options.enums === String ? $root.google.appengine.v1.Instance.Availability[message.availability] === undefined ? message.availability : $root.google.appengine.v1.Instance.Availability[message.availability] : message.availability; + if (message.vmName != null && message.hasOwnProperty("vmName")) + object.vmName = message.vmName; + if (message.vmZoneName != null && message.hasOwnProperty("vmZoneName")) + object.vmZoneName = message.vmZoneName; + if (message.vmId != null && message.hasOwnProperty("vmId")) + object.vmId = message.vmId; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.requests != null && message.hasOwnProperty("requests")) + object.requests = message.requests; + if (message.errors != null && message.hasOwnProperty("errors")) + object.errors = message.errors; + if (message.qps != null && message.hasOwnProperty("qps")) + object.qps = options.json && !isFinite(message.qps) ? String(message.qps) : message.qps; + if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) + object.averageLatency = message.averageLatency; + if (message.memoryUsage != null && message.hasOwnProperty("memoryUsage")) + if (typeof message.memoryUsage === "number") + object.memoryUsage = options.longs === String ? String(message.memoryUsage) : message.memoryUsage; + else + object.memoryUsage = options.longs === String ? $util.Long.prototype.toString.call(message.memoryUsage) : options.longs === Number ? new $util.LongBits(message.memoryUsage.low >>> 0, message.memoryUsage.high >>> 0).toNumber() : message.memoryUsage; + if (message.vmStatus != null && message.hasOwnProperty("vmStatus")) + object.vmStatus = message.vmStatus; + if (message.vmDebugEnabled != null && message.hasOwnProperty("vmDebugEnabled")) + object.vmDebugEnabled = message.vmDebugEnabled; + if (message.vmIp != null && message.hasOwnProperty("vmIp")) + object.vmIp = message.vmIp; + if (message.vmLiveness != null && message.hasOwnProperty("vmLiveness")) + object.vmLiveness = options.enums === String ? $root.google.appengine.v1.Instance.Liveness.LivenessState[message.vmLiveness] === undefined ? message.vmLiveness : $root.google.appengine.v1.Instance.Liveness.LivenessState[message.vmLiveness] : message.vmLiveness; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.appengine.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.appengine.v1.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Instance"; + }; + + /** + * Availability enum. + * @name google.appengine.v1.Instance.Availability + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} RESIDENT=1 RESIDENT value + * @property {number} DYNAMIC=2 DYNAMIC value + */ + Instance.Availability = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "RESIDENT"] = 1; + values[valuesById[2] = "DYNAMIC"] = 2; + return values; + })(); + + Instance.Liveness = (function() { + + /** + * Properties of a Liveness. + * @memberof google.appengine.v1.Instance + * @interface ILiveness + */ + + /** + * Constructs a new Liveness. + * @memberof google.appengine.v1.Instance + * @classdesc Represents a Liveness. + * @implements ILiveness + * @constructor + * @param {google.appengine.v1.Instance.ILiveness=} [properties] Properties to set + */ + function Liveness(properties) { + if (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 Liveness instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Instance.Liveness + * @static + * @param {google.appengine.v1.Instance.ILiveness=} [properties] Properties to set + * @returns {google.appengine.v1.Instance.Liveness} Liveness instance + */ + Liveness.create = function create(properties) { + return new Liveness(properties); + }; + + /** + * Encodes the specified Liveness message. Does not implicitly {@link google.appengine.v1.Instance.Liveness.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Instance.Liveness + * @static + * @param {google.appengine.v1.Instance.ILiveness} message Liveness message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Liveness.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Liveness message, length delimited. Does not implicitly {@link google.appengine.v1.Instance.Liveness.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Instance.Liveness + * @static + * @param {google.appengine.v1.Instance.ILiveness} message Liveness message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Liveness.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Liveness message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Instance.Liveness + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Instance.Liveness} Liveness + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Liveness.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.appengine.v1.Instance.Liveness(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Liveness message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Instance.Liveness + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Instance.Liveness} Liveness + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Liveness.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Liveness message. + * @function verify + * @memberof google.appengine.v1.Instance.Liveness + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Liveness.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Liveness message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Instance.Liveness + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Instance.Liveness} Liveness + */ + Liveness.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Instance.Liveness) + return object; + return new $root.google.appengine.v1.Instance.Liveness(); + }; + + /** + * Creates a plain object from a Liveness message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Instance.Liveness + * @static + * @param {google.appengine.v1.Instance.Liveness} message Liveness + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Liveness.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Liveness to JSON. + * @function toJSON + * @memberof google.appengine.v1.Instance.Liveness + * @instance + * @returns {Object.} JSON object + */ + Liveness.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Liveness + * @function getTypeUrl + * @memberof google.appengine.v1.Instance.Liveness + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Liveness.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Instance.Liveness"; + }; + + /** + * LivenessState enum. + * @name google.appengine.v1.Instance.Liveness.LivenessState + * @enum {number} + * @property {number} LIVENESS_STATE_UNSPECIFIED=0 LIVENESS_STATE_UNSPECIFIED value + * @property {number} UNKNOWN=1 UNKNOWN value + * @property {number} HEALTHY=2 HEALTHY value + * @property {number} UNHEALTHY=3 UNHEALTHY value + * @property {number} DRAINING=4 DRAINING value + * @property {number} TIMEOUT=5 TIMEOUT value + */ + Liveness.LivenessState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIVENESS_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNKNOWN"] = 1; + values[valuesById[2] = "HEALTHY"] = 2; + values[valuesById[3] = "UNHEALTHY"] = 3; + values[valuesById[4] = "DRAINING"] = 4; + values[valuesById[5] = "TIMEOUT"] = 5; + return values; + })(); + + return Liveness; + })(); + + return Instance; + })(); + + v1.Service = (function() { + + /** + * Properties of a Service. + * @memberof google.appengine.v1 + * @interface IService + * @property {string|null} [name] Service name + * @property {string|null} [id] Service id + * @property {google.appengine.v1.ITrafficSplit|null} [split] Service split + * @property {Object.|null} [labels] Service labels + * @property {google.appengine.v1.INetworkSettings|null} [networkSettings] Service networkSettings + */ + + /** + * Constructs a new Service. + * @memberof google.appengine.v1 + * @classdesc Represents a Service. + * @implements IService + * @constructor + * @param {google.appengine.v1.IService=} [properties] Properties to set + */ + function Service(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Service name. + * @member {string} name + * @memberof google.appengine.v1.Service + * @instance + */ + Service.prototype.name = ""; + + /** + * Service id. + * @member {string} id + * @memberof google.appengine.v1.Service + * @instance + */ + Service.prototype.id = ""; + + /** + * Service split. + * @member {google.appengine.v1.ITrafficSplit|null|undefined} split + * @memberof google.appengine.v1.Service + * @instance + */ + Service.prototype.split = null; + + /** + * Service labels. + * @member {Object.} labels + * @memberof google.appengine.v1.Service + * @instance + */ + Service.prototype.labels = $util.emptyObject; + + /** + * Service networkSettings. + * @member {google.appengine.v1.INetworkSettings|null|undefined} networkSettings + * @memberof google.appengine.v1.Service + * @instance + */ + Service.prototype.networkSettings = null; + + /** + * Creates a new Service instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Service + * @static + * @param {google.appengine.v1.IService=} [properties] Properties to set + * @returns {google.appengine.v1.Service} Service instance + */ + Service.create = function create(properties) { + return new Service(properties); + }; + + /** + * Encodes the specified Service message. Does not implicitly {@link google.appengine.v1.Service.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Service + * @static + * @param {google.appengine.v1.IService} message Service message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Service.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.split != null && Object.hasOwnProperty.call(message, "split")) + $root.google.appengine.v1.TrafficSplit.encode(message.split, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.networkSettings != null && Object.hasOwnProperty.call(message, "networkSettings")) + $root.google.appengine.v1.NetworkSettings.encode(message.networkSettings, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.appengine.v1.Service.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Service + * @static + * @param {google.appengine.v1.IService} message Service message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Service.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Service message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Service + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Service} Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Service.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.Service(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.split = $root.google.appengine.v1.TrafficSplit.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.networkSettings = $root.google.appengine.v1.NetworkSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Service message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Service + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Service} Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Service.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Service message. + * @function verify + * @memberof google.appengine.v1.Service + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Service.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.split != null && message.hasOwnProperty("split")) { + var error = $root.google.appengine.v1.TrafficSplit.verify(message.split); + if (error) + return "split." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.networkSettings != null && message.hasOwnProperty("networkSettings")) { + var error = $root.google.appengine.v1.NetworkSettings.verify(message.networkSettings); + if (error) + return "networkSettings." + error; + } + return null; + }; + + /** + * Creates a Service message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Service + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Service} Service + */ + Service.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Service) + return object; + var message = new $root.google.appengine.v1.Service(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + if (object.split != null) { + if (typeof object.split !== "object") + throw TypeError(".google.appengine.v1.Service.split: object expected"); + message.split = $root.google.appengine.v1.TrafficSplit.fromObject(object.split); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.appengine.v1.Service.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.networkSettings != null) { + if (typeof object.networkSettings !== "object") + throw TypeError(".google.appengine.v1.Service.networkSettings: object expected"); + message.networkSettings = $root.google.appengine.v1.NetworkSettings.fromObject(object.networkSettings); + } + return message; + }; + + /** + * Creates a plain object from a Service message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Service + * @static + * @param {google.appengine.v1.Service} message Service + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Service.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.id = ""; + object.split = null; + object.networkSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.split != null && message.hasOwnProperty("split")) + object.split = $root.google.appengine.v1.TrafficSplit.toObject(message.split, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.networkSettings != null && message.hasOwnProperty("networkSettings")) + object.networkSettings = $root.google.appengine.v1.NetworkSettings.toObject(message.networkSettings, options); + return object; + }; + + /** + * Converts this Service to JSON. + * @function toJSON + * @memberof google.appengine.v1.Service + * @instance + * @returns {Object.} JSON object + */ + Service.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Service + * @function getTypeUrl + * @memberof google.appengine.v1.Service + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Service.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Service"; + }; + + return Service; + })(); + + v1.TrafficSplit = (function() { + + /** + * Properties of a TrafficSplit. + * @memberof google.appengine.v1 + * @interface ITrafficSplit + * @property {google.appengine.v1.TrafficSplit.ShardBy|null} [shardBy] TrafficSplit shardBy + * @property {Object.|null} [allocations] TrafficSplit allocations + */ + + /** + * Constructs a new TrafficSplit. + * @memberof google.appengine.v1 + * @classdesc Represents a TrafficSplit. + * @implements ITrafficSplit + * @constructor + * @param {google.appengine.v1.ITrafficSplit=} [properties] Properties to set + */ + function TrafficSplit(properties) { + this.allocations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrafficSplit shardBy. + * @member {google.appengine.v1.TrafficSplit.ShardBy} shardBy + * @memberof google.appengine.v1.TrafficSplit + * @instance + */ + TrafficSplit.prototype.shardBy = 0; + + /** + * TrafficSplit allocations. + * @member {Object.} allocations + * @memberof google.appengine.v1.TrafficSplit + * @instance + */ + TrafficSplit.prototype.allocations = $util.emptyObject; + + /** + * Creates a new TrafficSplit instance using the specified properties. + * @function create + * @memberof google.appengine.v1.TrafficSplit + * @static + * @param {google.appengine.v1.ITrafficSplit=} [properties] Properties to set + * @returns {google.appengine.v1.TrafficSplit} TrafficSplit instance + */ + TrafficSplit.create = function create(properties) { + return new TrafficSplit(properties); + }; + + /** + * Encodes the specified TrafficSplit message. Does not implicitly {@link google.appengine.v1.TrafficSplit.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.TrafficSplit + * @static + * @param {google.appengine.v1.ITrafficSplit} message TrafficSplit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficSplit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.shardBy != null && Object.hasOwnProperty.call(message, "shardBy")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.shardBy); + if (message.allocations != null && Object.hasOwnProperty.call(message, "allocations")) + for (var keys = Object.keys(message.allocations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 1 =*/17).double(message.allocations[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrafficSplit message, length delimited. Does not implicitly {@link google.appengine.v1.TrafficSplit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.TrafficSplit + * @static + * @param {google.appengine.v1.ITrafficSplit} message TrafficSplit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficSplit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrafficSplit message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.TrafficSplit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.TrafficSplit} TrafficSplit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficSplit.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.appengine.v1.TrafficSplit(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.shardBy = reader.int32(); + break; + } + case 2: { + if (message.allocations === $util.emptyObject) + message.allocations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.double(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.allocations[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrafficSplit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.TrafficSplit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.TrafficSplit} TrafficSplit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficSplit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrafficSplit message. + * @function verify + * @memberof google.appengine.v1.TrafficSplit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrafficSplit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.shardBy != null && message.hasOwnProperty("shardBy")) + switch (message.shardBy) { + default: + return "shardBy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.allocations != null && message.hasOwnProperty("allocations")) { + if (!$util.isObject(message.allocations)) + return "allocations: object expected"; + var key = Object.keys(message.allocations); + for (var i = 0; i < key.length; ++i) + if (typeof message.allocations[key[i]] !== "number") + return "allocations: number{k:string} expected"; + } + return null; + }; + + /** + * Creates a TrafficSplit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.TrafficSplit + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.TrafficSplit} TrafficSplit + */ + TrafficSplit.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.TrafficSplit) + return object; + var message = new $root.google.appengine.v1.TrafficSplit(); + switch (object.shardBy) { + default: + if (typeof object.shardBy === "number") { + message.shardBy = object.shardBy; + break; + } + break; + case "UNSPECIFIED": + case 0: + message.shardBy = 0; + break; + case "COOKIE": + case 1: + message.shardBy = 1; + break; + case "IP": + case 2: + message.shardBy = 2; + break; + case "RANDOM": + case 3: + message.shardBy = 3; + break; + } + if (object.allocations) { + if (typeof object.allocations !== "object") + throw TypeError(".google.appengine.v1.TrafficSplit.allocations: object expected"); + message.allocations = {}; + for (var keys = Object.keys(object.allocations), i = 0; i < keys.length; ++i) + message.allocations[keys[i]] = Number(object.allocations[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a TrafficSplit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.TrafficSplit + * @static + * @param {google.appengine.v1.TrafficSplit} message TrafficSplit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrafficSplit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.allocations = {}; + if (options.defaults) + object.shardBy = options.enums === String ? "UNSPECIFIED" : 0; + if (message.shardBy != null && message.hasOwnProperty("shardBy")) + object.shardBy = options.enums === String ? $root.google.appengine.v1.TrafficSplit.ShardBy[message.shardBy] === undefined ? message.shardBy : $root.google.appengine.v1.TrafficSplit.ShardBy[message.shardBy] : message.shardBy; + var keys2; + if (message.allocations && (keys2 = Object.keys(message.allocations)).length) { + object.allocations = {}; + for (var j = 0; j < keys2.length; ++j) + object.allocations[keys2[j]] = options.json && !isFinite(message.allocations[keys2[j]]) ? String(message.allocations[keys2[j]]) : message.allocations[keys2[j]]; + } + return object; + }; + + /** + * Converts this TrafficSplit to JSON. + * @function toJSON + * @memberof google.appengine.v1.TrafficSplit + * @instance + * @returns {Object.} JSON object + */ + TrafficSplit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrafficSplit + * @function getTypeUrl + * @memberof google.appengine.v1.TrafficSplit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrafficSplit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.TrafficSplit"; + }; + + /** + * ShardBy enum. + * @name google.appengine.v1.TrafficSplit.ShardBy + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} COOKIE=1 COOKIE value + * @property {number} IP=2 IP value + * @property {number} RANDOM=3 RANDOM value + */ + TrafficSplit.ShardBy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "COOKIE"] = 1; + values[valuesById[2] = "IP"] = 2; + values[valuesById[3] = "RANDOM"] = 3; + return values; + })(); + + return TrafficSplit; + })(); + + v1.NetworkSettings = (function() { + + /** + * Properties of a NetworkSettings. + * @memberof google.appengine.v1 + * @interface INetworkSettings + * @property {google.appengine.v1.NetworkSettings.IngressTrafficAllowed|null} [ingressTrafficAllowed] NetworkSettings ingressTrafficAllowed + */ + + /** + * Constructs a new NetworkSettings. + * @memberof google.appengine.v1 + * @classdesc Represents a NetworkSettings. + * @implements INetworkSettings + * @constructor + * @param {google.appengine.v1.INetworkSettings=} [properties] Properties to set + */ + function NetworkSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkSettings ingressTrafficAllowed. + * @member {google.appengine.v1.NetworkSettings.IngressTrafficAllowed} ingressTrafficAllowed + * @memberof google.appengine.v1.NetworkSettings + * @instance + */ + NetworkSettings.prototype.ingressTrafficAllowed = 0; + + /** + * Creates a new NetworkSettings instance using the specified properties. + * @function create + * @memberof google.appengine.v1.NetworkSettings + * @static + * @param {google.appengine.v1.INetworkSettings=} [properties] Properties to set + * @returns {google.appengine.v1.NetworkSettings} NetworkSettings instance + */ + NetworkSettings.create = function create(properties) { + return new NetworkSettings(properties); + }; + + /** + * Encodes the specified NetworkSettings message. Does not implicitly {@link google.appengine.v1.NetworkSettings.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.NetworkSettings + * @static + * @param {google.appengine.v1.INetworkSettings} message NetworkSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ingressTrafficAllowed != null && Object.hasOwnProperty.call(message, "ingressTrafficAllowed")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ingressTrafficAllowed); + return writer; + }; + + /** + * Encodes the specified NetworkSettings message, length delimited. Does not implicitly {@link google.appengine.v1.NetworkSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.NetworkSettings + * @static + * @param {google.appengine.v1.INetworkSettings} message NetworkSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkSettings message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.NetworkSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.NetworkSettings} NetworkSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkSettings.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.appengine.v1.NetworkSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ingressTrafficAllowed = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.NetworkSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.NetworkSettings} NetworkSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkSettings message. + * @function verify + * @memberof google.appengine.v1.NetworkSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ingressTrafficAllowed != null && message.hasOwnProperty("ingressTrafficAllowed")) + switch (message.ingressTrafficAllowed) { + default: + return "ingressTrafficAllowed: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a NetworkSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.NetworkSettings + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.NetworkSettings} NetworkSettings + */ + NetworkSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.NetworkSettings) + return object; + var message = new $root.google.appengine.v1.NetworkSettings(); + switch (object.ingressTrafficAllowed) { + default: + if (typeof object.ingressTrafficAllowed === "number") { + message.ingressTrafficAllowed = object.ingressTrafficAllowed; + break; + } + break; + case "INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED": + case 0: + message.ingressTrafficAllowed = 0; + break; + case "INGRESS_TRAFFIC_ALLOWED_ALL": + case 1: + message.ingressTrafficAllowed = 1; + break; + case "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY": + case 2: + message.ingressTrafficAllowed = 2; + break; + case "INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB": + case 3: + message.ingressTrafficAllowed = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.NetworkSettings + * @static + * @param {google.appengine.v1.NetworkSettings} message NetworkSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ingressTrafficAllowed = options.enums === String ? "INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED" : 0; + if (message.ingressTrafficAllowed != null && message.hasOwnProperty("ingressTrafficAllowed")) + object.ingressTrafficAllowed = options.enums === String ? $root.google.appengine.v1.NetworkSettings.IngressTrafficAllowed[message.ingressTrafficAllowed] === undefined ? message.ingressTrafficAllowed : $root.google.appengine.v1.NetworkSettings.IngressTrafficAllowed[message.ingressTrafficAllowed] : message.ingressTrafficAllowed; + return object; + }; + + /** + * Converts this NetworkSettings to JSON. + * @function toJSON + * @memberof google.appengine.v1.NetworkSettings + * @instance + * @returns {Object.} JSON object + */ + NetworkSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkSettings + * @function getTypeUrl + * @memberof google.appengine.v1.NetworkSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.NetworkSettings"; + }; + + /** + * IngressTrafficAllowed enum. + * @name google.appengine.v1.NetworkSettings.IngressTrafficAllowed + * @enum {number} + * @property {number} INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED=0 INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED value + * @property {number} INGRESS_TRAFFIC_ALLOWED_ALL=1 INGRESS_TRAFFIC_ALLOWED_ALL value + * @property {number} INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY=2 INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY value + * @property {number} INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB=3 INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB value + */ + NetworkSettings.IngressTrafficAllowed = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED"] = 0; + values[valuesById[1] = "INGRESS_TRAFFIC_ALLOWED_ALL"] = 1; + values[valuesById[2] = "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY"] = 2; + values[valuesById[3] = "INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB"] = 3; + return values; + })(); + + return NetworkSettings; + })(); + + v1.Version = (function() { + + /** + * Properties of a Version. + * @memberof google.appengine.v1 + * @interface IVersion + * @property {string|null} [name] Version name + * @property {string|null} [id] Version id + * @property {google.appengine.v1.IAutomaticScaling|null} [automaticScaling] Version automaticScaling + * @property {google.appengine.v1.IBasicScaling|null} [basicScaling] Version basicScaling + * @property {google.appengine.v1.IManualScaling|null} [manualScaling] Version manualScaling + * @property {Array.|null} [inboundServices] Version inboundServices + * @property {string|null} [instanceClass] Version instanceClass + * @property {google.appengine.v1.INetwork|null} [network] Version network + * @property {Array.|null} [zones] Version zones + * @property {google.appengine.v1.IResources|null} [resources] Version resources + * @property {string|null} [runtime] Version runtime + * @property {string|null} [runtimeChannel] Version runtimeChannel + * @property {boolean|null} [threadsafe] Version threadsafe + * @property {boolean|null} [vm] Version vm + * @property {boolean|null} [appEngineApis] Version appEngineApis + * @property {Object.|null} [betaSettings] Version betaSettings + * @property {string|null} [env] Version env + * @property {google.appengine.v1.ServingStatus|null} [servingStatus] Version servingStatus + * @property {string|null} [createdBy] Version createdBy + * @property {google.protobuf.ITimestamp|null} [createTime] Version createTime + * @property {number|Long|null} [diskUsageBytes] Version diskUsageBytes + * @property {string|null} [runtimeApiVersion] Version runtimeApiVersion + * @property {string|null} [runtimeMainExecutablePath] Version runtimeMainExecutablePath + * @property {string|null} [serviceAccount] Version serviceAccount + * @property {Array.|null} [handlers] Version handlers + * @property {Array.|null} [errorHandlers] Version errorHandlers + * @property {Array.|null} [libraries] Version libraries + * @property {google.appengine.v1.IApiConfigHandler|null} [apiConfig] Version apiConfig + * @property {Object.|null} [envVariables] Version envVariables + * @property {Object.|null} [buildEnvVariables] Version buildEnvVariables + * @property {google.protobuf.IDuration|null} [defaultExpiration] Version defaultExpiration + * @property {google.appengine.v1.IHealthCheck|null} [healthCheck] Version healthCheck + * @property {google.appengine.v1.IReadinessCheck|null} [readinessCheck] Version readinessCheck + * @property {google.appengine.v1.ILivenessCheck|null} [livenessCheck] Version livenessCheck + * @property {string|null} [nobuildFilesRegex] Version nobuildFilesRegex + * @property {google.appengine.v1.IDeployment|null} [deployment] Version deployment + * @property {string|null} [versionUrl] Version versionUrl + * @property {google.appengine.v1.IEndpointsApiService|null} [endpointsApiService] Version endpointsApiService + * @property {google.appengine.v1.IEntrypoint|null} [entrypoint] Version entrypoint + * @property {google.appengine.v1.IVpcAccessConnector|null} [vpcAccessConnector] Version vpcAccessConnector + */ + + /** + * Constructs a new Version. + * @memberof google.appengine.v1 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {google.appengine.v1.IVersion=} [properties] Properties to set + */ + function Version(properties) { + this.inboundServices = []; + this.zones = []; + this.betaSettings = {}; + this.handlers = []; + this.errorHandlers = []; + this.libraries = []; + this.envVariables = {}; + this.buildEnvVariables = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version name. + * @member {string} name + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.name = ""; + + /** + * Version id. + * @member {string} id + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.id = ""; + + /** + * Version automaticScaling. + * @member {google.appengine.v1.IAutomaticScaling|null|undefined} automaticScaling + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.automaticScaling = null; + + /** + * Version basicScaling. + * @member {google.appengine.v1.IBasicScaling|null|undefined} basicScaling + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.basicScaling = null; + + /** + * Version manualScaling. + * @member {google.appengine.v1.IManualScaling|null|undefined} manualScaling + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.manualScaling = null; + + /** + * Version inboundServices. + * @member {Array.} inboundServices + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.inboundServices = $util.emptyArray; + + /** + * Version instanceClass. + * @member {string} instanceClass + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.instanceClass = ""; + + /** + * Version network. + * @member {google.appengine.v1.INetwork|null|undefined} network + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.network = null; + + /** + * Version zones. + * @member {Array.} zones + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.zones = $util.emptyArray; + + /** + * Version resources. + * @member {google.appengine.v1.IResources|null|undefined} resources + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.resources = null; + + /** + * Version runtime. + * @member {string} runtime + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.runtime = ""; + + /** + * Version runtimeChannel. + * @member {string} runtimeChannel + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.runtimeChannel = ""; + + /** + * Version threadsafe. + * @member {boolean} threadsafe + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.threadsafe = false; + + /** + * Version vm. + * @member {boolean} vm + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.vm = false; + + /** + * Version appEngineApis. + * @member {boolean} appEngineApis + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.appEngineApis = false; + + /** + * Version betaSettings. + * @member {Object.} betaSettings + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.betaSettings = $util.emptyObject; + + /** + * Version env. + * @member {string} env + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.env = ""; + + /** + * Version servingStatus. + * @member {google.appengine.v1.ServingStatus} servingStatus + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.servingStatus = 0; + + /** + * Version createdBy. + * @member {string} createdBy + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.createdBy = ""; + + /** + * Version createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.createTime = null; + + /** + * Version diskUsageBytes. + * @member {number|Long} diskUsageBytes + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.diskUsageBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Version runtimeApiVersion. + * @member {string} runtimeApiVersion + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.runtimeApiVersion = ""; + + /** + * Version runtimeMainExecutablePath. + * @member {string} runtimeMainExecutablePath + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.runtimeMainExecutablePath = ""; + + /** + * Version serviceAccount. + * @member {string} serviceAccount + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.serviceAccount = ""; + + /** + * Version handlers. + * @member {Array.} handlers + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.handlers = $util.emptyArray; + + /** + * Version errorHandlers. + * @member {Array.} errorHandlers + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.errorHandlers = $util.emptyArray; + + /** + * Version libraries. + * @member {Array.} libraries + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.libraries = $util.emptyArray; + + /** + * Version apiConfig. + * @member {google.appengine.v1.IApiConfigHandler|null|undefined} apiConfig + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.apiConfig = null; + + /** + * Version envVariables. + * @member {Object.} envVariables + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.envVariables = $util.emptyObject; + + /** + * Version buildEnvVariables. + * @member {Object.} buildEnvVariables + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.buildEnvVariables = $util.emptyObject; + + /** + * Version defaultExpiration. + * @member {google.protobuf.IDuration|null|undefined} defaultExpiration + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.defaultExpiration = null; + + /** + * Version healthCheck. + * @member {google.appengine.v1.IHealthCheck|null|undefined} healthCheck + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.healthCheck = null; + + /** + * Version readinessCheck. + * @member {google.appengine.v1.IReadinessCheck|null|undefined} readinessCheck + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.readinessCheck = null; + + /** + * Version livenessCheck. + * @member {google.appengine.v1.ILivenessCheck|null|undefined} livenessCheck + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.livenessCheck = null; + + /** + * Version nobuildFilesRegex. + * @member {string} nobuildFilesRegex + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.nobuildFilesRegex = ""; + + /** + * Version deployment. + * @member {google.appengine.v1.IDeployment|null|undefined} deployment + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.deployment = null; + + /** + * Version versionUrl. + * @member {string} versionUrl + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.versionUrl = ""; + + /** + * Version endpointsApiService. + * @member {google.appengine.v1.IEndpointsApiService|null|undefined} endpointsApiService + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.endpointsApiService = null; + + /** + * Version entrypoint. + * @member {google.appengine.v1.IEntrypoint|null|undefined} entrypoint + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.entrypoint = null; + + /** + * Version vpcAccessConnector. + * @member {google.appengine.v1.IVpcAccessConnector|null|undefined} vpcAccessConnector + * @memberof google.appengine.v1.Version + * @instance + */ + Version.prototype.vpcAccessConnector = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Version scaling. + * @member {"automaticScaling"|"basicScaling"|"manualScaling"|undefined} scaling + * @memberof google.appengine.v1.Version + * @instance + */ + Object.defineProperty(Version.prototype, "scaling", { + get: $util.oneOfGetter($oneOfFields = ["automaticScaling", "basicScaling", "manualScaling"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Version + * @static + * @param {google.appengine.v1.IVersion=} [properties] Properties to set + * @returns {google.appengine.v1.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.appengine.v1.Version.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Version + * @static + * @param {google.appengine.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.automaticScaling != null && Object.hasOwnProperty.call(message, "automaticScaling")) + $root.google.appengine.v1.AutomaticScaling.encode(message.automaticScaling, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.basicScaling != null && Object.hasOwnProperty.call(message, "basicScaling")) + $root.google.appengine.v1.BasicScaling.encode(message.basicScaling, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.manualScaling != null && Object.hasOwnProperty.call(message, "manualScaling")) + $root.google.appengine.v1.ManualScaling.encode(message.manualScaling, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.inboundServices != null && message.inboundServices.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.inboundServices.length; ++i) + writer.int32(message.inboundServices[i]); + writer.ldelim(); + } + if (message.instanceClass != null && Object.hasOwnProperty.call(message, "instanceClass")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.instanceClass); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + $root.google.appengine.v1.Network.encode(message.network, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.resources != null && Object.hasOwnProperty.call(message, "resources")) + $root.google.appengine.v1.Resources.encode(message.resources, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.runtime != null && Object.hasOwnProperty.call(message, "runtime")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.runtime); + if (message.threadsafe != null && Object.hasOwnProperty.call(message, "threadsafe")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.threadsafe); + if (message.vm != null && Object.hasOwnProperty.call(message, "vm")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.vm); + if (message.betaSettings != null && Object.hasOwnProperty.call(message, "betaSettings")) + for (var keys = Object.keys(message.betaSettings), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.betaSettings[keys[i]]).ldelim(); + if (message.env != null && Object.hasOwnProperty.call(message, "env")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.env); + if (message.servingStatus != null && Object.hasOwnProperty.call(message, "servingStatus")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.servingStatus); + if (message.createdBy != null && Object.hasOwnProperty.call(message, "createdBy")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.createdBy); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.diskUsageBytes != null && Object.hasOwnProperty.call(message, "diskUsageBytes")) + writer.uint32(/* id 18, wireType 0 =*/144).int64(message.diskUsageBytes); + if (message.runtimeApiVersion != null && Object.hasOwnProperty.call(message, "runtimeApiVersion")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.runtimeApiVersion); + if (message.runtimeMainExecutablePath != null && Object.hasOwnProperty.call(message, "runtimeMainExecutablePath")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.runtimeMainExecutablePath); + if (message.handlers != null && message.handlers.length) + for (var i = 0; i < message.handlers.length; ++i) + $root.google.appengine.v1.UrlMap.encode(message.handlers[i], writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.errorHandlers != null && message.errorHandlers.length) + for (var i = 0; i < message.errorHandlers.length; ++i) + $root.google.appengine.v1.ErrorHandler.encode(message.errorHandlers[i], writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.libraries != null && message.libraries.length) + for (var i = 0; i < message.libraries.length; ++i) + $root.google.appengine.v1.Library.encode(message.libraries[i], writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + if (message.apiConfig != null && Object.hasOwnProperty.call(message, "apiConfig")) + $root.google.appengine.v1.ApiConfigHandler.encode(message.apiConfig, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + if (message.envVariables != null && Object.hasOwnProperty.call(message, "envVariables")) + for (var keys = Object.keys(message.envVariables), i = 0; i < keys.length; ++i) + writer.uint32(/* id 104, wireType 2 =*/834).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.envVariables[keys[i]]).ldelim(); + if (message.defaultExpiration != null && Object.hasOwnProperty.call(message, "defaultExpiration")) + $root.google.protobuf.Duration.encode(message.defaultExpiration, writer.uint32(/* id 105, wireType 2 =*/842).fork()).ldelim(); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + $root.google.appengine.v1.HealthCheck.encode(message.healthCheck, writer.uint32(/* id 106, wireType 2 =*/850).fork()).ldelim(); + if (message.nobuildFilesRegex != null && Object.hasOwnProperty.call(message, "nobuildFilesRegex")) + writer.uint32(/* id 107, wireType 2 =*/858).string(message.nobuildFilesRegex); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.appengine.v1.Deployment.encode(message.deployment, writer.uint32(/* id 108, wireType 2 =*/866).fork()).ldelim(); + if (message.versionUrl != null && Object.hasOwnProperty.call(message, "versionUrl")) + writer.uint32(/* id 109, wireType 2 =*/874).string(message.versionUrl); + if (message.endpointsApiService != null && Object.hasOwnProperty.call(message, "endpointsApiService")) + $root.google.appengine.v1.EndpointsApiService.encode(message.endpointsApiService, writer.uint32(/* id 110, wireType 2 =*/882).fork()).ldelim(); + if (message.readinessCheck != null && Object.hasOwnProperty.call(message, "readinessCheck")) + $root.google.appengine.v1.ReadinessCheck.encode(message.readinessCheck, writer.uint32(/* id 112, wireType 2 =*/898).fork()).ldelim(); + if (message.livenessCheck != null && Object.hasOwnProperty.call(message, "livenessCheck")) + $root.google.appengine.v1.LivenessCheck.encode(message.livenessCheck, writer.uint32(/* id 113, wireType 2 =*/906).fork()).ldelim(); + if (message.runtimeChannel != null && Object.hasOwnProperty.call(message, "runtimeChannel")) + writer.uint32(/* id 117, wireType 2 =*/938).string(message.runtimeChannel); + if (message.zones != null && message.zones.length) + for (var i = 0; i < message.zones.length; ++i) + writer.uint32(/* id 118, wireType 2 =*/946).string(message.zones[i]); + if (message.vpcAccessConnector != null && Object.hasOwnProperty.call(message, "vpcAccessConnector")) + $root.google.appengine.v1.VpcAccessConnector.encode(message.vpcAccessConnector, writer.uint32(/* id 121, wireType 2 =*/970).fork()).ldelim(); + if (message.entrypoint != null && Object.hasOwnProperty.call(message, "entrypoint")) + $root.google.appengine.v1.Entrypoint.encode(message.entrypoint, writer.uint32(/* id 122, wireType 2 =*/978).fork()).ldelim(); + if (message.buildEnvVariables != null && Object.hasOwnProperty.call(message, "buildEnvVariables")) + for (var keys = Object.keys(message.buildEnvVariables), i = 0; i < keys.length; ++i) + writer.uint32(/* id 125, wireType 2 =*/1002).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.buildEnvVariables[keys[i]]).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 127, wireType 2 =*/1018).string(message.serviceAccount); + if (message.appEngineApis != null && Object.hasOwnProperty.call(message, "appEngineApis")) + writer.uint32(/* id 128, wireType 0 =*/1024).bool(message.appEngineApis); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.appengine.v1.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Version + * @static + * @param {google.appengine.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.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.appengine.v1.Version(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.automaticScaling = $root.google.appengine.v1.AutomaticScaling.decode(reader, reader.uint32()); + break; + } + case 4: { + message.basicScaling = $root.google.appengine.v1.BasicScaling.decode(reader, reader.uint32()); + break; + } + case 5: { + message.manualScaling = $root.google.appengine.v1.ManualScaling.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.inboundServices && message.inboundServices.length)) + message.inboundServices = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.inboundServices.push(reader.int32()); + } else + message.inboundServices.push(reader.int32()); + break; + } + case 7: { + message.instanceClass = reader.string(); + break; + } + case 8: { + message.network = $root.google.appengine.v1.Network.decode(reader, reader.uint32()); + break; + } + case 118: { + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push(reader.string()); + break; + } + case 9: { + message.resources = $root.google.appengine.v1.Resources.decode(reader, reader.uint32()); + break; + } + case 10: { + message.runtime = reader.string(); + break; + } + case 117: { + message.runtimeChannel = reader.string(); + break; + } + case 11: { + message.threadsafe = reader.bool(); + break; + } + case 12: { + message.vm = reader.bool(); + break; + } + case 128: { + message.appEngineApis = reader.bool(); + break; + } + case 13: { + if (message.betaSettings === $util.emptyObject) + message.betaSettings = {}; + 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.betaSettings[key] = value; + break; + } + case 14: { + message.env = reader.string(); + break; + } + case 15: { + message.servingStatus = reader.int32(); + break; + } + case 16: { + message.createdBy = reader.string(); + break; + } + case 17: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 18: { + message.diskUsageBytes = reader.int64(); + break; + } + case 21: { + message.runtimeApiVersion = reader.string(); + break; + } + case 22: { + message.runtimeMainExecutablePath = reader.string(); + break; + } + case 127: { + message.serviceAccount = reader.string(); + break; + } + case 100: { + if (!(message.handlers && message.handlers.length)) + message.handlers = []; + message.handlers.push($root.google.appengine.v1.UrlMap.decode(reader, reader.uint32())); + break; + } + case 101: { + if (!(message.errorHandlers && message.errorHandlers.length)) + message.errorHandlers = []; + message.errorHandlers.push($root.google.appengine.v1.ErrorHandler.decode(reader, reader.uint32())); + break; + } + case 102: { + if (!(message.libraries && message.libraries.length)) + message.libraries = []; + message.libraries.push($root.google.appengine.v1.Library.decode(reader, reader.uint32())); + break; + } + case 103: { + message.apiConfig = $root.google.appengine.v1.ApiConfigHandler.decode(reader, reader.uint32()); + break; + } + case 104: { + if (message.envVariables === $util.emptyObject) + message.envVariables = {}; + 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.envVariables[key] = value; + break; + } + case 125: { + if (message.buildEnvVariables === $util.emptyObject) + message.buildEnvVariables = {}; + 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.buildEnvVariables[key] = value; + break; + } + case 105: { + message.defaultExpiration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 106: { + message.healthCheck = $root.google.appengine.v1.HealthCheck.decode(reader, reader.uint32()); + break; + } + case 112: { + message.readinessCheck = $root.google.appengine.v1.ReadinessCheck.decode(reader, reader.uint32()); + break; + } + case 113: { + message.livenessCheck = $root.google.appengine.v1.LivenessCheck.decode(reader, reader.uint32()); + break; + } + case 107: { + message.nobuildFilesRegex = reader.string(); + break; + } + case 108: { + message.deployment = $root.google.appengine.v1.Deployment.decode(reader, reader.uint32()); + break; + } + case 109: { + message.versionUrl = reader.string(); + break; + } + case 110: { + message.endpointsApiService = $root.google.appengine.v1.EndpointsApiService.decode(reader, reader.uint32()); + break; + } + case 122: { + message.entrypoint = $root.google.appengine.v1.Entrypoint.decode(reader, reader.uint32()); + break; + } + case 121: { + message.vpcAccessConnector = $root.google.appengine.v1.VpcAccessConnector.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof google.appengine.v1.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.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.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.automaticScaling != null && message.hasOwnProperty("automaticScaling")) { + properties.scaling = 1; + { + var error = $root.google.appengine.v1.AutomaticScaling.verify(message.automaticScaling); + if (error) + return "automaticScaling." + error; + } + } + if (message.basicScaling != null && message.hasOwnProperty("basicScaling")) { + if (properties.scaling === 1) + return "scaling: multiple values"; + properties.scaling = 1; + { + var error = $root.google.appengine.v1.BasicScaling.verify(message.basicScaling); + if (error) + return "basicScaling." + error; + } + } + if (message.manualScaling != null && message.hasOwnProperty("manualScaling")) { + if (properties.scaling === 1) + return "scaling: multiple values"; + properties.scaling = 1; + { + var error = $root.google.appengine.v1.ManualScaling.verify(message.manualScaling); + if (error) + return "manualScaling." + error; + } + } + if (message.inboundServices != null && message.hasOwnProperty("inboundServices")) { + if (!Array.isArray(message.inboundServices)) + return "inboundServices: array expected"; + for (var i = 0; i < message.inboundServices.length; ++i) + switch (message.inboundServices[i]) { + default: + return "inboundServices: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 9: + break; + } + } + if (message.instanceClass != null && message.hasOwnProperty("instanceClass")) + if (!$util.isString(message.instanceClass)) + return "instanceClass: string expected"; + if (message.network != null && message.hasOwnProperty("network")) { + var error = $root.google.appengine.v1.Network.verify(message.network); + if (error) + return "network." + error; + } + if (message.zones != null && message.hasOwnProperty("zones")) { + if (!Array.isArray(message.zones)) + return "zones: array expected"; + for (var i = 0; i < message.zones.length; ++i) + if (!$util.isString(message.zones[i])) + return "zones: string[] expected"; + } + if (message.resources != null && message.hasOwnProperty("resources")) { + var error = $root.google.appengine.v1.Resources.verify(message.resources); + if (error) + return "resources." + error; + } + if (message.runtime != null && message.hasOwnProperty("runtime")) + if (!$util.isString(message.runtime)) + return "runtime: string expected"; + if (message.runtimeChannel != null && message.hasOwnProperty("runtimeChannel")) + if (!$util.isString(message.runtimeChannel)) + return "runtimeChannel: string expected"; + if (message.threadsafe != null && message.hasOwnProperty("threadsafe")) + if (typeof message.threadsafe !== "boolean") + return "threadsafe: boolean expected"; + if (message.vm != null && message.hasOwnProperty("vm")) + if (typeof message.vm !== "boolean") + return "vm: boolean expected"; + if (message.appEngineApis != null && message.hasOwnProperty("appEngineApis")) + if (typeof message.appEngineApis !== "boolean") + return "appEngineApis: boolean expected"; + if (message.betaSettings != null && message.hasOwnProperty("betaSettings")) { + if (!$util.isObject(message.betaSettings)) + return "betaSettings: object expected"; + var key = Object.keys(message.betaSettings); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.betaSettings[key[i]])) + return "betaSettings: string{k:string} expected"; + } + if (message.env != null && message.hasOwnProperty("env")) + if (!$util.isString(message.env)) + return "env: string expected"; + if (message.servingStatus != null && message.hasOwnProperty("servingStatus")) + switch (message.servingStatus) { + default: + return "servingStatus: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + if (!$util.isString(message.createdBy)) + return "createdBy: 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.diskUsageBytes != null && message.hasOwnProperty("diskUsageBytes")) + if (!$util.isInteger(message.diskUsageBytes) && !(message.diskUsageBytes && $util.isInteger(message.diskUsageBytes.low) && $util.isInteger(message.diskUsageBytes.high))) + return "diskUsageBytes: integer|Long expected"; + if (message.runtimeApiVersion != null && message.hasOwnProperty("runtimeApiVersion")) + if (!$util.isString(message.runtimeApiVersion)) + return "runtimeApiVersion: string expected"; + if (message.runtimeMainExecutablePath != null && message.hasOwnProperty("runtimeMainExecutablePath")) + if (!$util.isString(message.runtimeMainExecutablePath)) + return "runtimeMainExecutablePath: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.handlers != null && message.hasOwnProperty("handlers")) { + if (!Array.isArray(message.handlers)) + return "handlers: array expected"; + for (var i = 0; i < message.handlers.length; ++i) { + var error = $root.google.appengine.v1.UrlMap.verify(message.handlers[i]); + if (error) + return "handlers." + error; + } + } + if (message.errorHandlers != null && message.hasOwnProperty("errorHandlers")) { + if (!Array.isArray(message.errorHandlers)) + return "errorHandlers: array expected"; + for (var i = 0; i < message.errorHandlers.length; ++i) { + var error = $root.google.appengine.v1.ErrorHandler.verify(message.errorHandlers[i]); + if (error) + return "errorHandlers." + error; + } + } + if (message.libraries != null && message.hasOwnProperty("libraries")) { + if (!Array.isArray(message.libraries)) + return "libraries: array expected"; + for (var i = 0; i < message.libraries.length; ++i) { + var error = $root.google.appengine.v1.Library.verify(message.libraries[i]); + if (error) + return "libraries." + error; + } + } + if (message.apiConfig != null && message.hasOwnProperty("apiConfig")) { + var error = $root.google.appengine.v1.ApiConfigHandler.verify(message.apiConfig); + if (error) + return "apiConfig." + error; + } + if (message.envVariables != null && message.hasOwnProperty("envVariables")) { + if (!$util.isObject(message.envVariables)) + return "envVariables: object expected"; + var key = Object.keys(message.envVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.envVariables[key[i]])) + return "envVariables: string{k:string} expected"; + } + if (message.buildEnvVariables != null && message.hasOwnProperty("buildEnvVariables")) { + if (!$util.isObject(message.buildEnvVariables)) + return "buildEnvVariables: object expected"; + var key = Object.keys(message.buildEnvVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.buildEnvVariables[key[i]])) + return "buildEnvVariables: string{k:string} expected"; + } + if (message.defaultExpiration != null && message.hasOwnProperty("defaultExpiration")) { + var error = $root.google.protobuf.Duration.verify(message.defaultExpiration); + if (error) + return "defaultExpiration." + error; + } + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) { + var error = $root.google.appengine.v1.HealthCheck.verify(message.healthCheck); + if (error) + return "healthCheck." + error; + } + if (message.readinessCheck != null && message.hasOwnProperty("readinessCheck")) { + var error = $root.google.appengine.v1.ReadinessCheck.verify(message.readinessCheck); + if (error) + return "readinessCheck." + error; + } + if (message.livenessCheck != null && message.hasOwnProperty("livenessCheck")) { + var error = $root.google.appengine.v1.LivenessCheck.verify(message.livenessCheck); + if (error) + return "livenessCheck." + error; + } + if (message.nobuildFilesRegex != null && message.hasOwnProperty("nobuildFilesRegex")) + if (!$util.isString(message.nobuildFilesRegex)) + return "nobuildFilesRegex: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.appengine.v1.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + if (message.versionUrl != null && message.hasOwnProperty("versionUrl")) + if (!$util.isString(message.versionUrl)) + return "versionUrl: string expected"; + if (message.endpointsApiService != null && message.hasOwnProperty("endpointsApiService")) { + var error = $root.google.appengine.v1.EndpointsApiService.verify(message.endpointsApiService); + if (error) + return "endpointsApiService." + error; + } + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) { + var error = $root.google.appengine.v1.Entrypoint.verify(message.entrypoint); + if (error) + return "entrypoint." + error; + } + if (message.vpcAccessConnector != null && message.hasOwnProperty("vpcAccessConnector")) { + var error = $root.google.appengine.v1.VpcAccessConnector.verify(message.vpcAccessConnector); + if (error) + return "vpcAccessConnector." + error; + } + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Version + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Version} Version + */ + Version.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Version) + return object; + var message = new $root.google.appengine.v1.Version(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + if (object.automaticScaling != null) { + if (typeof object.automaticScaling !== "object") + throw TypeError(".google.appengine.v1.Version.automaticScaling: object expected"); + message.automaticScaling = $root.google.appengine.v1.AutomaticScaling.fromObject(object.automaticScaling); + } + if (object.basicScaling != null) { + if (typeof object.basicScaling !== "object") + throw TypeError(".google.appengine.v1.Version.basicScaling: object expected"); + message.basicScaling = $root.google.appengine.v1.BasicScaling.fromObject(object.basicScaling); + } + if (object.manualScaling != null) { + if (typeof object.manualScaling !== "object") + throw TypeError(".google.appengine.v1.Version.manualScaling: object expected"); + message.manualScaling = $root.google.appengine.v1.ManualScaling.fromObject(object.manualScaling); + } + if (object.inboundServices) { + if (!Array.isArray(object.inboundServices)) + throw TypeError(".google.appengine.v1.Version.inboundServices: array expected"); + message.inboundServices = []; + for (var i = 0; i < object.inboundServices.length; ++i) + switch (object.inboundServices[i]) { + default: + if (typeof object.inboundServices[i] === "number") { + message.inboundServices[i] = object.inboundServices[i]; + break; + } + case "INBOUND_SERVICE_UNSPECIFIED": + case 0: + message.inboundServices[i] = 0; + break; + case "INBOUND_SERVICE_MAIL": + case 1: + message.inboundServices[i] = 1; + break; + case "INBOUND_SERVICE_MAIL_BOUNCE": + case 2: + message.inboundServices[i] = 2; + break; + case "INBOUND_SERVICE_XMPP_ERROR": + case 3: + message.inboundServices[i] = 3; + break; + case "INBOUND_SERVICE_XMPP_MESSAGE": + case 4: + message.inboundServices[i] = 4; + break; + case "INBOUND_SERVICE_XMPP_SUBSCRIBE": + case 5: + message.inboundServices[i] = 5; + break; + case "INBOUND_SERVICE_XMPP_PRESENCE": + case 6: + message.inboundServices[i] = 6; + break; + case "INBOUND_SERVICE_CHANNEL_PRESENCE": + case 7: + message.inboundServices[i] = 7; + break; + case "INBOUND_SERVICE_WARMUP": + case 9: + message.inboundServices[i] = 9; + break; + } + } + if (object.instanceClass != null) + message.instanceClass = String(object.instanceClass); + if (object.network != null) { + if (typeof object.network !== "object") + throw TypeError(".google.appengine.v1.Version.network: object expected"); + message.network = $root.google.appengine.v1.Network.fromObject(object.network); + } + if (object.zones) { + if (!Array.isArray(object.zones)) + throw TypeError(".google.appengine.v1.Version.zones: array expected"); + message.zones = []; + for (var i = 0; i < object.zones.length; ++i) + message.zones[i] = String(object.zones[i]); + } + if (object.resources != null) { + if (typeof object.resources !== "object") + throw TypeError(".google.appengine.v1.Version.resources: object expected"); + message.resources = $root.google.appengine.v1.Resources.fromObject(object.resources); + } + if (object.runtime != null) + message.runtime = String(object.runtime); + if (object.runtimeChannel != null) + message.runtimeChannel = String(object.runtimeChannel); + if (object.threadsafe != null) + message.threadsafe = Boolean(object.threadsafe); + if (object.vm != null) + message.vm = Boolean(object.vm); + if (object.appEngineApis != null) + message.appEngineApis = Boolean(object.appEngineApis); + if (object.betaSettings) { + if (typeof object.betaSettings !== "object") + throw TypeError(".google.appengine.v1.Version.betaSettings: object expected"); + message.betaSettings = {}; + for (var keys = Object.keys(object.betaSettings), i = 0; i < keys.length; ++i) + message.betaSettings[keys[i]] = String(object.betaSettings[keys[i]]); + } + if (object.env != null) + message.env = String(object.env); + switch (object.servingStatus) { + default: + if (typeof object.servingStatus === "number") { + message.servingStatus = object.servingStatus; + break; + } + break; + case "SERVING_STATUS_UNSPECIFIED": + case 0: + message.servingStatus = 0; + break; + case "SERVING": + case 1: + message.servingStatus = 1; + break; + case "STOPPED": + case 2: + message.servingStatus = 2; + break; + } + if (object.createdBy != null) + message.createdBy = String(object.createdBy); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.appengine.v1.Version.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.diskUsageBytes != null) + if ($util.Long) + (message.diskUsageBytes = $util.Long.fromValue(object.diskUsageBytes)).unsigned = false; + else if (typeof object.diskUsageBytes === "string") + message.diskUsageBytes = parseInt(object.diskUsageBytes, 10); + else if (typeof object.diskUsageBytes === "number") + message.diskUsageBytes = object.diskUsageBytes; + else if (typeof object.diskUsageBytes === "object") + message.diskUsageBytes = new $util.LongBits(object.diskUsageBytes.low >>> 0, object.diskUsageBytes.high >>> 0).toNumber(); + if (object.runtimeApiVersion != null) + message.runtimeApiVersion = String(object.runtimeApiVersion); + if (object.runtimeMainExecutablePath != null) + message.runtimeMainExecutablePath = String(object.runtimeMainExecutablePath); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.handlers) { + if (!Array.isArray(object.handlers)) + throw TypeError(".google.appengine.v1.Version.handlers: array expected"); + message.handlers = []; + for (var i = 0; i < object.handlers.length; ++i) { + if (typeof object.handlers[i] !== "object") + throw TypeError(".google.appengine.v1.Version.handlers: object expected"); + message.handlers[i] = $root.google.appengine.v1.UrlMap.fromObject(object.handlers[i]); + } + } + if (object.errorHandlers) { + if (!Array.isArray(object.errorHandlers)) + throw TypeError(".google.appengine.v1.Version.errorHandlers: array expected"); + message.errorHandlers = []; + for (var i = 0; i < object.errorHandlers.length; ++i) { + if (typeof object.errorHandlers[i] !== "object") + throw TypeError(".google.appengine.v1.Version.errorHandlers: object expected"); + message.errorHandlers[i] = $root.google.appengine.v1.ErrorHandler.fromObject(object.errorHandlers[i]); + } + } + if (object.libraries) { + if (!Array.isArray(object.libraries)) + throw TypeError(".google.appengine.v1.Version.libraries: array expected"); + message.libraries = []; + for (var i = 0; i < object.libraries.length; ++i) { + if (typeof object.libraries[i] !== "object") + throw TypeError(".google.appengine.v1.Version.libraries: object expected"); + message.libraries[i] = $root.google.appengine.v1.Library.fromObject(object.libraries[i]); + } + } + if (object.apiConfig != null) { + if (typeof object.apiConfig !== "object") + throw TypeError(".google.appengine.v1.Version.apiConfig: object expected"); + message.apiConfig = $root.google.appengine.v1.ApiConfigHandler.fromObject(object.apiConfig); + } + if (object.envVariables) { + if (typeof object.envVariables !== "object") + throw TypeError(".google.appengine.v1.Version.envVariables: object expected"); + message.envVariables = {}; + for (var keys = Object.keys(object.envVariables), i = 0; i < keys.length; ++i) + message.envVariables[keys[i]] = String(object.envVariables[keys[i]]); + } + if (object.buildEnvVariables) { + if (typeof object.buildEnvVariables !== "object") + throw TypeError(".google.appengine.v1.Version.buildEnvVariables: object expected"); + message.buildEnvVariables = {}; + for (var keys = Object.keys(object.buildEnvVariables), i = 0; i < keys.length; ++i) + message.buildEnvVariables[keys[i]] = String(object.buildEnvVariables[keys[i]]); + } + if (object.defaultExpiration != null) { + if (typeof object.defaultExpiration !== "object") + throw TypeError(".google.appengine.v1.Version.defaultExpiration: object expected"); + message.defaultExpiration = $root.google.protobuf.Duration.fromObject(object.defaultExpiration); + } + if (object.healthCheck != null) { + if (typeof object.healthCheck !== "object") + throw TypeError(".google.appengine.v1.Version.healthCheck: object expected"); + message.healthCheck = $root.google.appengine.v1.HealthCheck.fromObject(object.healthCheck); + } + if (object.readinessCheck != null) { + if (typeof object.readinessCheck !== "object") + throw TypeError(".google.appengine.v1.Version.readinessCheck: object expected"); + message.readinessCheck = $root.google.appengine.v1.ReadinessCheck.fromObject(object.readinessCheck); + } + if (object.livenessCheck != null) { + if (typeof object.livenessCheck !== "object") + throw TypeError(".google.appengine.v1.Version.livenessCheck: object expected"); + message.livenessCheck = $root.google.appengine.v1.LivenessCheck.fromObject(object.livenessCheck); + } + if (object.nobuildFilesRegex != null) + message.nobuildFilesRegex = String(object.nobuildFilesRegex); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.appengine.v1.Version.deployment: object expected"); + message.deployment = $root.google.appengine.v1.Deployment.fromObject(object.deployment); + } + if (object.versionUrl != null) + message.versionUrl = String(object.versionUrl); + if (object.endpointsApiService != null) { + if (typeof object.endpointsApiService !== "object") + throw TypeError(".google.appengine.v1.Version.endpointsApiService: object expected"); + message.endpointsApiService = $root.google.appengine.v1.EndpointsApiService.fromObject(object.endpointsApiService); + } + if (object.entrypoint != null) { + if (typeof object.entrypoint !== "object") + throw TypeError(".google.appengine.v1.Version.entrypoint: object expected"); + message.entrypoint = $root.google.appengine.v1.Entrypoint.fromObject(object.entrypoint); + } + if (object.vpcAccessConnector != null) { + if (typeof object.vpcAccessConnector !== "object") + throw TypeError(".google.appengine.v1.Version.vpcAccessConnector: object expected"); + message.vpcAccessConnector = $root.google.appengine.v1.VpcAccessConnector.fromObject(object.vpcAccessConnector); + } + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Version + * @static + * @param {google.appengine.v1.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inboundServices = []; + object.handlers = []; + object.errorHandlers = []; + object.libraries = []; + object.zones = []; + } + if (options.objects || options.defaults) { + object.betaSettings = {}; + object.envVariables = {}; + object.buildEnvVariables = {}; + } + if (options.defaults) { + object.name = ""; + object.id = ""; + object.instanceClass = ""; + object.network = null; + object.resources = null; + object.runtime = ""; + object.threadsafe = false; + object.vm = false; + object.env = ""; + object.servingStatus = options.enums === String ? "SERVING_STATUS_UNSPECIFIED" : 0; + object.createdBy = ""; + object.createTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.diskUsageBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.diskUsageBytes = options.longs === String ? "0" : 0; + object.runtimeApiVersion = ""; + object.runtimeMainExecutablePath = ""; + object.apiConfig = null; + object.defaultExpiration = null; + object.healthCheck = null; + object.nobuildFilesRegex = ""; + object.deployment = null; + object.versionUrl = ""; + object.endpointsApiService = null; + object.readinessCheck = null; + object.livenessCheck = null; + object.runtimeChannel = ""; + object.vpcAccessConnector = null; + object.entrypoint = null; + object.serviceAccount = ""; + object.appEngineApis = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.automaticScaling != null && message.hasOwnProperty("automaticScaling")) { + object.automaticScaling = $root.google.appengine.v1.AutomaticScaling.toObject(message.automaticScaling, options); + if (options.oneofs) + object.scaling = "automaticScaling"; + } + if (message.basicScaling != null && message.hasOwnProperty("basicScaling")) { + object.basicScaling = $root.google.appengine.v1.BasicScaling.toObject(message.basicScaling, options); + if (options.oneofs) + object.scaling = "basicScaling"; + } + if (message.manualScaling != null && message.hasOwnProperty("manualScaling")) { + object.manualScaling = $root.google.appengine.v1.ManualScaling.toObject(message.manualScaling, options); + if (options.oneofs) + object.scaling = "manualScaling"; + } + if (message.inboundServices && message.inboundServices.length) { + object.inboundServices = []; + for (var j = 0; j < message.inboundServices.length; ++j) + object.inboundServices[j] = options.enums === String ? $root.google.appengine.v1.InboundServiceType[message.inboundServices[j]] === undefined ? message.inboundServices[j] : $root.google.appengine.v1.InboundServiceType[message.inboundServices[j]] : message.inboundServices[j]; + } + if (message.instanceClass != null && message.hasOwnProperty("instanceClass")) + object.instanceClass = message.instanceClass; + if (message.network != null && message.hasOwnProperty("network")) + object.network = $root.google.appengine.v1.Network.toObject(message.network, options); + if (message.resources != null && message.hasOwnProperty("resources")) + object.resources = $root.google.appengine.v1.Resources.toObject(message.resources, options); + if (message.runtime != null && message.hasOwnProperty("runtime")) + object.runtime = message.runtime; + if (message.threadsafe != null && message.hasOwnProperty("threadsafe")) + object.threadsafe = message.threadsafe; + if (message.vm != null && message.hasOwnProperty("vm")) + object.vm = message.vm; + var keys2; + if (message.betaSettings && (keys2 = Object.keys(message.betaSettings)).length) { + object.betaSettings = {}; + for (var j = 0; j < keys2.length; ++j) + object.betaSettings[keys2[j]] = message.betaSettings[keys2[j]]; + } + if (message.env != null && message.hasOwnProperty("env")) + object.env = message.env; + if (message.servingStatus != null && message.hasOwnProperty("servingStatus")) + object.servingStatus = options.enums === String ? $root.google.appengine.v1.ServingStatus[message.servingStatus] === undefined ? message.servingStatus : $root.google.appengine.v1.ServingStatus[message.servingStatus] : message.servingStatus; + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + object.createdBy = message.createdBy; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.diskUsageBytes != null && message.hasOwnProperty("diskUsageBytes")) + if (typeof message.diskUsageBytes === "number") + object.diskUsageBytes = options.longs === String ? String(message.diskUsageBytes) : message.diskUsageBytes; + else + object.diskUsageBytes = options.longs === String ? $util.Long.prototype.toString.call(message.diskUsageBytes) : options.longs === Number ? new $util.LongBits(message.diskUsageBytes.low >>> 0, message.diskUsageBytes.high >>> 0).toNumber() : message.diskUsageBytes; + if (message.runtimeApiVersion != null && message.hasOwnProperty("runtimeApiVersion")) + object.runtimeApiVersion = message.runtimeApiVersion; + if (message.runtimeMainExecutablePath != null && message.hasOwnProperty("runtimeMainExecutablePath")) + object.runtimeMainExecutablePath = message.runtimeMainExecutablePath; + if (message.handlers && message.handlers.length) { + object.handlers = []; + for (var j = 0; j < message.handlers.length; ++j) + object.handlers[j] = $root.google.appengine.v1.UrlMap.toObject(message.handlers[j], options); + } + if (message.errorHandlers && message.errorHandlers.length) { + object.errorHandlers = []; + for (var j = 0; j < message.errorHandlers.length; ++j) + object.errorHandlers[j] = $root.google.appengine.v1.ErrorHandler.toObject(message.errorHandlers[j], options); + } + if (message.libraries && message.libraries.length) { + object.libraries = []; + for (var j = 0; j < message.libraries.length; ++j) + object.libraries[j] = $root.google.appengine.v1.Library.toObject(message.libraries[j], options); + } + if (message.apiConfig != null && message.hasOwnProperty("apiConfig")) + object.apiConfig = $root.google.appengine.v1.ApiConfigHandler.toObject(message.apiConfig, options); + if (message.envVariables && (keys2 = Object.keys(message.envVariables)).length) { + object.envVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.envVariables[keys2[j]] = message.envVariables[keys2[j]]; + } + if (message.defaultExpiration != null && message.hasOwnProperty("defaultExpiration")) + object.defaultExpiration = $root.google.protobuf.Duration.toObject(message.defaultExpiration, options); + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + object.healthCheck = $root.google.appengine.v1.HealthCheck.toObject(message.healthCheck, options); + if (message.nobuildFilesRegex != null && message.hasOwnProperty("nobuildFilesRegex")) + object.nobuildFilesRegex = message.nobuildFilesRegex; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.appengine.v1.Deployment.toObject(message.deployment, options); + if (message.versionUrl != null && message.hasOwnProperty("versionUrl")) + object.versionUrl = message.versionUrl; + if (message.endpointsApiService != null && message.hasOwnProperty("endpointsApiService")) + object.endpointsApiService = $root.google.appengine.v1.EndpointsApiService.toObject(message.endpointsApiService, options); + if (message.readinessCheck != null && message.hasOwnProperty("readinessCheck")) + object.readinessCheck = $root.google.appengine.v1.ReadinessCheck.toObject(message.readinessCheck, options); + if (message.livenessCheck != null && message.hasOwnProperty("livenessCheck")) + object.livenessCheck = $root.google.appengine.v1.LivenessCheck.toObject(message.livenessCheck, options); + if (message.runtimeChannel != null && message.hasOwnProperty("runtimeChannel")) + object.runtimeChannel = message.runtimeChannel; + if (message.zones && message.zones.length) { + object.zones = []; + for (var j = 0; j < message.zones.length; ++j) + object.zones[j] = message.zones[j]; + } + if (message.vpcAccessConnector != null && message.hasOwnProperty("vpcAccessConnector")) + object.vpcAccessConnector = $root.google.appengine.v1.VpcAccessConnector.toObject(message.vpcAccessConnector, options); + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) + object.entrypoint = $root.google.appengine.v1.Entrypoint.toObject(message.entrypoint, options); + if (message.buildEnvVariables && (keys2 = Object.keys(message.buildEnvVariables)).length) { + object.buildEnvVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.buildEnvVariables[keys2[j]] = message.buildEnvVariables[keys2[j]]; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.appEngineApis != null && message.hasOwnProperty("appEngineApis")) + object.appEngineApis = message.appEngineApis; + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof google.appengine.v1.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Version + * @function getTypeUrl + * @memberof google.appengine.v1.Version + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Version.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Version"; + }; + + return Version; + })(); + + v1.EndpointsApiService = (function() { + + /** + * Properties of an EndpointsApiService. + * @memberof google.appengine.v1 + * @interface IEndpointsApiService + * @property {string|null} [name] EndpointsApiService name + * @property {string|null} [configId] EndpointsApiService configId + * @property {google.appengine.v1.EndpointsApiService.RolloutStrategy|null} [rolloutStrategy] EndpointsApiService rolloutStrategy + * @property {boolean|null} [disableTraceSampling] EndpointsApiService disableTraceSampling + */ + + /** + * Constructs a new EndpointsApiService. + * @memberof google.appengine.v1 + * @classdesc Represents an EndpointsApiService. + * @implements IEndpointsApiService + * @constructor + * @param {google.appengine.v1.IEndpointsApiService=} [properties] Properties to set + */ + function EndpointsApiService(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndpointsApiService name. + * @member {string} name + * @memberof google.appengine.v1.EndpointsApiService + * @instance + */ + EndpointsApiService.prototype.name = ""; + + /** + * EndpointsApiService configId. + * @member {string} configId + * @memberof google.appengine.v1.EndpointsApiService + * @instance + */ + EndpointsApiService.prototype.configId = ""; + + /** + * EndpointsApiService rolloutStrategy. + * @member {google.appengine.v1.EndpointsApiService.RolloutStrategy} rolloutStrategy + * @memberof google.appengine.v1.EndpointsApiService + * @instance + */ + EndpointsApiService.prototype.rolloutStrategy = 0; + + /** + * EndpointsApiService disableTraceSampling. + * @member {boolean} disableTraceSampling + * @memberof google.appengine.v1.EndpointsApiService + * @instance + */ + EndpointsApiService.prototype.disableTraceSampling = false; + + /** + * Creates a new EndpointsApiService instance using the specified properties. + * @function create + * @memberof google.appengine.v1.EndpointsApiService + * @static + * @param {google.appengine.v1.IEndpointsApiService=} [properties] Properties to set + * @returns {google.appengine.v1.EndpointsApiService} EndpointsApiService instance + */ + EndpointsApiService.create = function create(properties) { + return new EndpointsApiService(properties); + }; + + /** + * Encodes the specified EndpointsApiService message. Does not implicitly {@link google.appengine.v1.EndpointsApiService.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.EndpointsApiService + * @static + * @param {google.appengine.v1.IEndpointsApiService} message EndpointsApiService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointsApiService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.configId != null && Object.hasOwnProperty.call(message, "configId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); + if (message.rolloutStrategy != null && Object.hasOwnProperty.call(message, "rolloutStrategy")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.rolloutStrategy); + if (message.disableTraceSampling != null && Object.hasOwnProperty.call(message, "disableTraceSampling")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disableTraceSampling); + return writer; + }; + + /** + * Encodes the specified EndpointsApiService message, length delimited. Does not implicitly {@link google.appengine.v1.EndpointsApiService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.EndpointsApiService + * @static + * @param {google.appengine.v1.IEndpointsApiService} message EndpointsApiService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointsApiService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndpointsApiService message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.EndpointsApiService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.EndpointsApiService} EndpointsApiService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointsApiService.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.appengine.v1.EndpointsApiService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.configId = reader.string(); + break; + } + case 3: { + message.rolloutStrategy = reader.int32(); + break; + } + case 4: { + message.disableTraceSampling = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndpointsApiService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.EndpointsApiService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.EndpointsApiService} EndpointsApiService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointsApiService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndpointsApiService message. + * @function verify + * @memberof google.appengine.v1.EndpointsApiService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndpointsApiService.verify = function verify(message) { + if (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.configId != null && message.hasOwnProperty("configId")) + if (!$util.isString(message.configId)) + return "configId: string expected"; + if (message.rolloutStrategy != null && message.hasOwnProperty("rolloutStrategy")) + switch (message.rolloutStrategy) { + default: + return "rolloutStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.disableTraceSampling != null && message.hasOwnProperty("disableTraceSampling")) + if (typeof message.disableTraceSampling !== "boolean") + return "disableTraceSampling: boolean expected"; + return null; + }; + + /** + * Creates an EndpointsApiService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.EndpointsApiService + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.EndpointsApiService} EndpointsApiService + */ + EndpointsApiService.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.EndpointsApiService) + return object; + var message = new $root.google.appengine.v1.EndpointsApiService(); + if (object.name != null) + message.name = String(object.name); + if (object.configId != null) + message.configId = String(object.configId); + switch (object.rolloutStrategy) { + default: + if (typeof object.rolloutStrategy === "number") { + message.rolloutStrategy = object.rolloutStrategy; + break; + } + break; + case "UNSPECIFIED_ROLLOUT_STRATEGY": + case 0: + message.rolloutStrategy = 0; + break; + case "FIXED": + case 1: + message.rolloutStrategy = 1; + break; + case "MANAGED": + case 2: + message.rolloutStrategy = 2; + break; + } + if (object.disableTraceSampling != null) + message.disableTraceSampling = Boolean(object.disableTraceSampling); + return message; + }; + + /** + * Creates a plain object from an EndpointsApiService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.EndpointsApiService + * @static + * @param {google.appengine.v1.EndpointsApiService} message EndpointsApiService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndpointsApiService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.configId = ""; + object.rolloutStrategy = options.enums === String ? "UNSPECIFIED_ROLLOUT_STRATEGY" : 0; + object.disableTraceSampling = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.configId != null && message.hasOwnProperty("configId")) + object.configId = message.configId; + if (message.rolloutStrategy != null && message.hasOwnProperty("rolloutStrategy")) + object.rolloutStrategy = options.enums === String ? $root.google.appengine.v1.EndpointsApiService.RolloutStrategy[message.rolloutStrategy] === undefined ? message.rolloutStrategy : $root.google.appengine.v1.EndpointsApiService.RolloutStrategy[message.rolloutStrategy] : message.rolloutStrategy; + if (message.disableTraceSampling != null && message.hasOwnProperty("disableTraceSampling")) + object.disableTraceSampling = message.disableTraceSampling; + return object; + }; + + /** + * Converts this EndpointsApiService to JSON. + * @function toJSON + * @memberof google.appengine.v1.EndpointsApiService + * @instance + * @returns {Object.} JSON object + */ + EndpointsApiService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndpointsApiService + * @function getTypeUrl + * @memberof google.appengine.v1.EndpointsApiService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndpointsApiService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.EndpointsApiService"; + }; + + /** + * RolloutStrategy enum. + * @name google.appengine.v1.EndpointsApiService.RolloutStrategy + * @enum {number} + * @property {number} UNSPECIFIED_ROLLOUT_STRATEGY=0 UNSPECIFIED_ROLLOUT_STRATEGY value + * @property {number} FIXED=1 FIXED value + * @property {number} MANAGED=2 MANAGED value + */ + EndpointsApiService.RolloutStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED_ROLLOUT_STRATEGY"] = 0; + values[valuesById[1] = "FIXED"] = 1; + values[valuesById[2] = "MANAGED"] = 2; + return values; + })(); + + return EndpointsApiService; + })(); + + v1.AutomaticScaling = (function() { + + /** + * Properties of an AutomaticScaling. + * @memberof google.appengine.v1 + * @interface IAutomaticScaling + * @property {google.protobuf.IDuration|null} [coolDownPeriod] AutomaticScaling coolDownPeriod + * @property {google.appengine.v1.ICpuUtilization|null} [cpuUtilization] AutomaticScaling cpuUtilization + * @property {number|null} [maxConcurrentRequests] AutomaticScaling maxConcurrentRequests + * @property {number|null} [maxIdleInstances] AutomaticScaling maxIdleInstances + * @property {number|null} [maxTotalInstances] AutomaticScaling maxTotalInstances + * @property {google.protobuf.IDuration|null} [maxPendingLatency] AutomaticScaling maxPendingLatency + * @property {number|null} [minIdleInstances] AutomaticScaling minIdleInstances + * @property {number|null} [minTotalInstances] AutomaticScaling minTotalInstances + * @property {google.protobuf.IDuration|null} [minPendingLatency] AutomaticScaling minPendingLatency + * @property {google.appengine.v1.IRequestUtilization|null} [requestUtilization] AutomaticScaling requestUtilization + * @property {google.appengine.v1.IDiskUtilization|null} [diskUtilization] AutomaticScaling diskUtilization + * @property {google.appengine.v1.INetworkUtilization|null} [networkUtilization] AutomaticScaling networkUtilization + * @property {google.appengine.v1.IStandardSchedulerSettings|null} [standardSchedulerSettings] AutomaticScaling standardSchedulerSettings + */ + + /** + * Constructs a new AutomaticScaling. + * @memberof google.appengine.v1 + * @classdesc Represents an AutomaticScaling. + * @implements IAutomaticScaling + * @constructor + * @param {google.appengine.v1.IAutomaticScaling=} [properties] Properties to set + */ + function AutomaticScaling(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomaticScaling coolDownPeriod. + * @member {google.protobuf.IDuration|null|undefined} coolDownPeriod + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.coolDownPeriod = null; + + /** + * AutomaticScaling cpuUtilization. + * @member {google.appengine.v1.ICpuUtilization|null|undefined} cpuUtilization + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.cpuUtilization = null; + + /** + * AutomaticScaling maxConcurrentRequests. + * @member {number} maxConcurrentRequests + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.maxConcurrentRequests = 0; + + /** + * AutomaticScaling maxIdleInstances. + * @member {number} maxIdleInstances + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.maxIdleInstances = 0; + + /** + * AutomaticScaling maxTotalInstances. + * @member {number} maxTotalInstances + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.maxTotalInstances = 0; + + /** + * AutomaticScaling maxPendingLatency. + * @member {google.protobuf.IDuration|null|undefined} maxPendingLatency + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.maxPendingLatency = null; + + /** + * AutomaticScaling minIdleInstances. + * @member {number} minIdleInstances + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.minIdleInstances = 0; + + /** + * AutomaticScaling minTotalInstances. + * @member {number} minTotalInstances + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.minTotalInstances = 0; + + /** + * AutomaticScaling minPendingLatency. + * @member {google.protobuf.IDuration|null|undefined} minPendingLatency + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.minPendingLatency = null; + + /** + * AutomaticScaling requestUtilization. + * @member {google.appengine.v1.IRequestUtilization|null|undefined} requestUtilization + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.requestUtilization = null; + + /** + * AutomaticScaling diskUtilization. + * @member {google.appengine.v1.IDiskUtilization|null|undefined} diskUtilization + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.diskUtilization = null; + + /** + * AutomaticScaling networkUtilization. + * @member {google.appengine.v1.INetworkUtilization|null|undefined} networkUtilization + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.networkUtilization = null; + + /** + * AutomaticScaling standardSchedulerSettings. + * @member {google.appengine.v1.IStandardSchedulerSettings|null|undefined} standardSchedulerSettings + * @memberof google.appengine.v1.AutomaticScaling + * @instance + */ + AutomaticScaling.prototype.standardSchedulerSettings = null; + + /** + * Creates a new AutomaticScaling instance using the specified properties. + * @function create + * @memberof google.appengine.v1.AutomaticScaling + * @static + * @param {google.appengine.v1.IAutomaticScaling=} [properties] Properties to set + * @returns {google.appengine.v1.AutomaticScaling} AutomaticScaling instance + */ + AutomaticScaling.create = function create(properties) { + return new AutomaticScaling(properties); + }; + + /** + * Encodes the specified AutomaticScaling message. Does not implicitly {@link google.appengine.v1.AutomaticScaling.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.AutomaticScaling + * @static + * @param {google.appengine.v1.IAutomaticScaling} message AutomaticScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomaticScaling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.coolDownPeriod != null && Object.hasOwnProperty.call(message, "coolDownPeriod")) + $root.google.protobuf.Duration.encode(message.coolDownPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cpuUtilization != null && Object.hasOwnProperty.call(message, "cpuUtilization")) + $root.google.appengine.v1.CpuUtilization.encode(message.cpuUtilization, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.maxConcurrentRequests != null && Object.hasOwnProperty.call(message, "maxConcurrentRequests")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxConcurrentRequests); + if (message.maxIdleInstances != null && Object.hasOwnProperty.call(message, "maxIdleInstances")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxIdleInstances); + if (message.maxTotalInstances != null && Object.hasOwnProperty.call(message, "maxTotalInstances")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxTotalInstances); + if (message.maxPendingLatency != null && Object.hasOwnProperty.call(message, "maxPendingLatency")) + $root.google.protobuf.Duration.encode(message.maxPendingLatency, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.minIdleInstances != null && Object.hasOwnProperty.call(message, "minIdleInstances")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.minIdleInstances); + if (message.minTotalInstances != null && Object.hasOwnProperty.call(message, "minTotalInstances")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.minTotalInstances); + if (message.minPendingLatency != null && Object.hasOwnProperty.call(message, "minPendingLatency")) + $root.google.protobuf.Duration.encode(message.minPendingLatency, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.requestUtilization != null && Object.hasOwnProperty.call(message, "requestUtilization")) + $root.google.appengine.v1.RequestUtilization.encode(message.requestUtilization, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.diskUtilization != null && Object.hasOwnProperty.call(message, "diskUtilization")) + $root.google.appengine.v1.DiskUtilization.encode(message.diskUtilization, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.networkUtilization != null && Object.hasOwnProperty.call(message, "networkUtilization")) + $root.google.appengine.v1.NetworkUtilization.encode(message.networkUtilization, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.standardSchedulerSettings != null && Object.hasOwnProperty.call(message, "standardSchedulerSettings")) + $root.google.appengine.v1.StandardSchedulerSettings.encode(message.standardSchedulerSettings, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutomaticScaling message, length delimited. Does not implicitly {@link google.appengine.v1.AutomaticScaling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.AutomaticScaling + * @static + * @param {google.appengine.v1.IAutomaticScaling} message AutomaticScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomaticScaling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomaticScaling message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.AutomaticScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.AutomaticScaling} AutomaticScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomaticScaling.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.appengine.v1.AutomaticScaling(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.coolDownPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.cpuUtilization = $root.google.appengine.v1.CpuUtilization.decode(reader, reader.uint32()); + break; + } + case 3: { + message.maxConcurrentRequests = reader.int32(); + break; + } + case 4: { + message.maxIdleInstances = reader.int32(); + break; + } + case 5: { + message.maxTotalInstances = reader.int32(); + break; + } + case 6: { + message.maxPendingLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.minIdleInstances = reader.int32(); + break; + } + case 8: { + message.minTotalInstances = reader.int32(); + break; + } + case 9: { + message.minPendingLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 10: { + message.requestUtilization = $root.google.appengine.v1.RequestUtilization.decode(reader, reader.uint32()); + break; + } + case 11: { + message.diskUtilization = $root.google.appengine.v1.DiskUtilization.decode(reader, reader.uint32()); + break; + } + case 12: { + message.networkUtilization = $root.google.appengine.v1.NetworkUtilization.decode(reader, reader.uint32()); + break; + } + case 20: { + message.standardSchedulerSettings = $root.google.appengine.v1.StandardSchedulerSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomaticScaling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.AutomaticScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.AutomaticScaling} AutomaticScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomaticScaling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomaticScaling message. + * @function verify + * @memberof google.appengine.v1.AutomaticScaling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomaticScaling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.coolDownPeriod != null && message.hasOwnProperty("coolDownPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.coolDownPeriod); + if (error) + return "coolDownPeriod." + error; + } + if (message.cpuUtilization != null && message.hasOwnProperty("cpuUtilization")) { + var error = $root.google.appengine.v1.CpuUtilization.verify(message.cpuUtilization); + if (error) + return "cpuUtilization." + error; + } + if (message.maxConcurrentRequests != null && message.hasOwnProperty("maxConcurrentRequests")) + if (!$util.isInteger(message.maxConcurrentRequests)) + return "maxConcurrentRequests: integer expected"; + if (message.maxIdleInstances != null && message.hasOwnProperty("maxIdleInstances")) + if (!$util.isInteger(message.maxIdleInstances)) + return "maxIdleInstances: integer expected"; + if (message.maxTotalInstances != null && message.hasOwnProperty("maxTotalInstances")) + if (!$util.isInteger(message.maxTotalInstances)) + return "maxTotalInstances: integer expected"; + if (message.maxPendingLatency != null && message.hasOwnProperty("maxPendingLatency")) { + var error = $root.google.protobuf.Duration.verify(message.maxPendingLatency); + if (error) + return "maxPendingLatency." + error; + } + if (message.minIdleInstances != null && message.hasOwnProperty("minIdleInstances")) + if (!$util.isInteger(message.minIdleInstances)) + return "minIdleInstances: integer expected"; + if (message.minTotalInstances != null && message.hasOwnProperty("minTotalInstances")) + if (!$util.isInteger(message.minTotalInstances)) + return "minTotalInstances: integer expected"; + if (message.minPendingLatency != null && message.hasOwnProperty("minPendingLatency")) { + var error = $root.google.protobuf.Duration.verify(message.minPendingLatency); + if (error) + return "minPendingLatency." + error; + } + if (message.requestUtilization != null && message.hasOwnProperty("requestUtilization")) { + var error = $root.google.appengine.v1.RequestUtilization.verify(message.requestUtilization); + if (error) + return "requestUtilization." + error; + } + if (message.diskUtilization != null && message.hasOwnProperty("diskUtilization")) { + var error = $root.google.appengine.v1.DiskUtilization.verify(message.diskUtilization); + if (error) + return "diskUtilization." + error; + } + if (message.networkUtilization != null && message.hasOwnProperty("networkUtilization")) { + var error = $root.google.appengine.v1.NetworkUtilization.verify(message.networkUtilization); + if (error) + return "networkUtilization." + error; + } + if (message.standardSchedulerSettings != null && message.hasOwnProperty("standardSchedulerSettings")) { + var error = $root.google.appengine.v1.StandardSchedulerSettings.verify(message.standardSchedulerSettings); + if (error) + return "standardSchedulerSettings." + error; + } + return null; + }; + + /** + * Creates an AutomaticScaling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.AutomaticScaling + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.AutomaticScaling} AutomaticScaling + */ + AutomaticScaling.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.AutomaticScaling) + return object; + var message = new $root.google.appengine.v1.AutomaticScaling(); + if (object.coolDownPeriod != null) { + if (typeof object.coolDownPeriod !== "object") + throw TypeError(".google.appengine.v1.AutomaticScaling.coolDownPeriod: object expected"); + message.coolDownPeriod = $root.google.protobuf.Duration.fromObject(object.coolDownPeriod); + } + if (object.cpuUtilization != null) { + if (typeof object.cpuUtilization !== "object") + throw TypeError(".google.appengine.v1.AutomaticScaling.cpuUtilization: object expected"); + message.cpuUtilization = $root.google.appengine.v1.CpuUtilization.fromObject(object.cpuUtilization); + } + if (object.maxConcurrentRequests != null) + message.maxConcurrentRequests = object.maxConcurrentRequests | 0; + if (object.maxIdleInstances != null) + message.maxIdleInstances = object.maxIdleInstances | 0; + if (object.maxTotalInstances != null) + message.maxTotalInstances = object.maxTotalInstances | 0; + if (object.maxPendingLatency != null) { + if (typeof object.maxPendingLatency !== "object") + throw TypeError(".google.appengine.v1.AutomaticScaling.maxPendingLatency: object expected"); + message.maxPendingLatency = $root.google.protobuf.Duration.fromObject(object.maxPendingLatency); + } + if (object.minIdleInstances != null) + message.minIdleInstances = object.minIdleInstances | 0; + if (object.minTotalInstances != null) + message.minTotalInstances = object.minTotalInstances | 0; + if (object.minPendingLatency != null) { + if (typeof object.minPendingLatency !== "object") + throw TypeError(".google.appengine.v1.AutomaticScaling.minPendingLatency: object expected"); + message.minPendingLatency = $root.google.protobuf.Duration.fromObject(object.minPendingLatency); + } + if (object.requestUtilization != null) { + if (typeof object.requestUtilization !== "object") + throw TypeError(".google.appengine.v1.AutomaticScaling.requestUtilization: object expected"); + message.requestUtilization = $root.google.appengine.v1.RequestUtilization.fromObject(object.requestUtilization); + } + if (object.diskUtilization != null) { + if (typeof object.diskUtilization !== "object") + throw TypeError(".google.appengine.v1.AutomaticScaling.diskUtilization: object expected"); + message.diskUtilization = $root.google.appengine.v1.DiskUtilization.fromObject(object.diskUtilization); + } + if (object.networkUtilization != null) { + if (typeof object.networkUtilization !== "object") + throw TypeError(".google.appengine.v1.AutomaticScaling.networkUtilization: object expected"); + message.networkUtilization = $root.google.appengine.v1.NetworkUtilization.fromObject(object.networkUtilization); + } + if (object.standardSchedulerSettings != null) { + if (typeof object.standardSchedulerSettings !== "object") + throw TypeError(".google.appengine.v1.AutomaticScaling.standardSchedulerSettings: object expected"); + message.standardSchedulerSettings = $root.google.appengine.v1.StandardSchedulerSettings.fromObject(object.standardSchedulerSettings); + } + return message; + }; + + /** + * Creates a plain object from an AutomaticScaling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.AutomaticScaling + * @static + * @param {google.appengine.v1.AutomaticScaling} message AutomaticScaling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomaticScaling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.coolDownPeriod = null; + object.cpuUtilization = null; + object.maxConcurrentRequests = 0; + object.maxIdleInstances = 0; + object.maxTotalInstances = 0; + object.maxPendingLatency = null; + object.minIdleInstances = 0; + object.minTotalInstances = 0; + object.minPendingLatency = null; + object.requestUtilization = null; + object.diskUtilization = null; + object.networkUtilization = null; + object.standardSchedulerSettings = null; + } + if (message.coolDownPeriod != null && message.hasOwnProperty("coolDownPeriod")) + object.coolDownPeriod = $root.google.protobuf.Duration.toObject(message.coolDownPeriod, options); + if (message.cpuUtilization != null && message.hasOwnProperty("cpuUtilization")) + object.cpuUtilization = $root.google.appengine.v1.CpuUtilization.toObject(message.cpuUtilization, options); + if (message.maxConcurrentRequests != null && message.hasOwnProperty("maxConcurrentRequests")) + object.maxConcurrentRequests = message.maxConcurrentRequests; + if (message.maxIdleInstances != null && message.hasOwnProperty("maxIdleInstances")) + object.maxIdleInstances = message.maxIdleInstances; + if (message.maxTotalInstances != null && message.hasOwnProperty("maxTotalInstances")) + object.maxTotalInstances = message.maxTotalInstances; + if (message.maxPendingLatency != null && message.hasOwnProperty("maxPendingLatency")) + object.maxPendingLatency = $root.google.protobuf.Duration.toObject(message.maxPendingLatency, options); + if (message.minIdleInstances != null && message.hasOwnProperty("minIdleInstances")) + object.minIdleInstances = message.minIdleInstances; + if (message.minTotalInstances != null && message.hasOwnProperty("minTotalInstances")) + object.minTotalInstances = message.minTotalInstances; + if (message.minPendingLatency != null && message.hasOwnProperty("minPendingLatency")) + object.minPendingLatency = $root.google.protobuf.Duration.toObject(message.minPendingLatency, options); + if (message.requestUtilization != null && message.hasOwnProperty("requestUtilization")) + object.requestUtilization = $root.google.appengine.v1.RequestUtilization.toObject(message.requestUtilization, options); + if (message.diskUtilization != null && message.hasOwnProperty("diskUtilization")) + object.diskUtilization = $root.google.appengine.v1.DiskUtilization.toObject(message.diskUtilization, options); + if (message.networkUtilization != null && message.hasOwnProperty("networkUtilization")) + object.networkUtilization = $root.google.appengine.v1.NetworkUtilization.toObject(message.networkUtilization, options); + if (message.standardSchedulerSettings != null && message.hasOwnProperty("standardSchedulerSettings")) + object.standardSchedulerSettings = $root.google.appengine.v1.StandardSchedulerSettings.toObject(message.standardSchedulerSettings, options); + return object; + }; + + /** + * Converts this AutomaticScaling to JSON. + * @function toJSON + * @memberof google.appengine.v1.AutomaticScaling + * @instance + * @returns {Object.} JSON object + */ + AutomaticScaling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutomaticScaling + * @function getTypeUrl + * @memberof google.appengine.v1.AutomaticScaling + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomaticScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.AutomaticScaling"; + }; + + return AutomaticScaling; + })(); + + v1.BasicScaling = (function() { + + /** + * Properties of a BasicScaling. + * @memberof google.appengine.v1 + * @interface IBasicScaling + * @property {google.protobuf.IDuration|null} [idleTimeout] BasicScaling idleTimeout + * @property {number|null} [maxInstances] BasicScaling maxInstances + */ + + /** + * Constructs a new BasicScaling. + * @memberof google.appengine.v1 + * @classdesc Represents a BasicScaling. + * @implements IBasicScaling + * @constructor + * @param {google.appengine.v1.IBasicScaling=} [properties] Properties to set + */ + function BasicScaling(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BasicScaling idleTimeout. + * @member {google.protobuf.IDuration|null|undefined} idleTimeout + * @memberof google.appengine.v1.BasicScaling + * @instance + */ + BasicScaling.prototype.idleTimeout = null; + + /** + * BasicScaling maxInstances. + * @member {number} maxInstances + * @memberof google.appengine.v1.BasicScaling + * @instance + */ + BasicScaling.prototype.maxInstances = 0; + + /** + * Creates a new BasicScaling instance using the specified properties. + * @function create + * @memberof google.appengine.v1.BasicScaling + * @static + * @param {google.appengine.v1.IBasicScaling=} [properties] Properties to set + * @returns {google.appengine.v1.BasicScaling} BasicScaling instance + */ + BasicScaling.create = function create(properties) { + return new BasicScaling(properties); + }; + + /** + * Encodes the specified BasicScaling message. Does not implicitly {@link google.appengine.v1.BasicScaling.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.BasicScaling + * @static + * @param {google.appengine.v1.IBasicScaling} message BasicScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicScaling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.idleTimeout != null && Object.hasOwnProperty.call(message, "idleTimeout")) + $root.google.protobuf.Duration.encode(message.idleTimeout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxInstances != null && Object.hasOwnProperty.call(message, "maxInstances")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxInstances); + return writer; + }; + + /** + * Encodes the specified BasicScaling message, length delimited. Does not implicitly {@link google.appengine.v1.BasicScaling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.BasicScaling + * @static + * @param {google.appengine.v1.IBasicScaling} message BasicScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicScaling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BasicScaling message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.BasicScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.BasicScaling} BasicScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicScaling.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.appengine.v1.BasicScaling(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.idleTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maxInstances = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BasicScaling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.BasicScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.BasicScaling} BasicScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicScaling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BasicScaling message. + * @function verify + * @memberof google.appengine.v1.BasicScaling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicScaling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.idleTimeout != null && message.hasOwnProperty("idleTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.idleTimeout); + if (error) + return "idleTimeout." + error; + } + if (message.maxInstances != null && message.hasOwnProperty("maxInstances")) + if (!$util.isInteger(message.maxInstances)) + return "maxInstances: integer expected"; + return null; + }; + + /** + * Creates a BasicScaling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.BasicScaling + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.BasicScaling} BasicScaling + */ + BasicScaling.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.BasicScaling) + return object; + var message = new $root.google.appengine.v1.BasicScaling(); + if (object.idleTimeout != null) { + if (typeof object.idleTimeout !== "object") + throw TypeError(".google.appengine.v1.BasicScaling.idleTimeout: object expected"); + message.idleTimeout = $root.google.protobuf.Duration.fromObject(object.idleTimeout); + } + if (object.maxInstances != null) + message.maxInstances = object.maxInstances | 0; + return message; + }; + + /** + * Creates a plain object from a BasicScaling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.BasicScaling + * @static + * @param {google.appengine.v1.BasicScaling} message BasicScaling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicScaling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.idleTimeout = null; + object.maxInstances = 0; + } + if (message.idleTimeout != null && message.hasOwnProperty("idleTimeout")) + object.idleTimeout = $root.google.protobuf.Duration.toObject(message.idleTimeout, options); + if (message.maxInstances != null && message.hasOwnProperty("maxInstances")) + object.maxInstances = message.maxInstances; + return object; + }; + + /** + * Converts this BasicScaling to JSON. + * @function toJSON + * @memberof google.appengine.v1.BasicScaling + * @instance + * @returns {Object.} JSON object + */ + BasicScaling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BasicScaling + * @function getTypeUrl + * @memberof google.appengine.v1.BasicScaling + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BasicScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.BasicScaling"; + }; + + return BasicScaling; + })(); + + v1.ManualScaling = (function() { + + /** + * Properties of a ManualScaling. + * @memberof google.appengine.v1 + * @interface IManualScaling + * @property {number|null} [instances] ManualScaling instances + */ + + /** + * Constructs a new ManualScaling. + * @memberof google.appengine.v1 + * @classdesc Represents a ManualScaling. + * @implements IManualScaling + * @constructor + * @param {google.appengine.v1.IManualScaling=} [properties] Properties to set + */ + function ManualScaling(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManualScaling instances. + * @member {number} instances + * @memberof google.appengine.v1.ManualScaling + * @instance + */ + ManualScaling.prototype.instances = 0; + + /** + * Creates a new ManualScaling instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ManualScaling + * @static + * @param {google.appengine.v1.IManualScaling=} [properties] Properties to set + * @returns {google.appengine.v1.ManualScaling} ManualScaling instance + */ + ManualScaling.create = function create(properties) { + return new ManualScaling(properties); + }; + + /** + * Encodes the specified ManualScaling message. Does not implicitly {@link google.appengine.v1.ManualScaling.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ManualScaling + * @static + * @param {google.appengine.v1.IManualScaling} message ManualScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManualScaling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && Object.hasOwnProperty.call(message, "instances")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.instances); + return writer; + }; + + /** + * Encodes the specified ManualScaling message, length delimited. Does not implicitly {@link google.appengine.v1.ManualScaling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ManualScaling + * @static + * @param {google.appengine.v1.IManualScaling} message ManualScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManualScaling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManualScaling message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ManualScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ManualScaling} ManualScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManualScaling.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.appengine.v1.ManualScaling(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.instances = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManualScaling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ManualScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ManualScaling} ManualScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManualScaling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManualScaling message. + * @function verify + * @memberof google.appengine.v1.ManualScaling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManualScaling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) + if (!$util.isInteger(message.instances)) + return "instances: integer expected"; + return null; + }; + + /** + * Creates a ManualScaling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ManualScaling + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ManualScaling} ManualScaling + */ + ManualScaling.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ManualScaling) + return object; + var message = new $root.google.appengine.v1.ManualScaling(); + if (object.instances != null) + message.instances = object.instances | 0; + return message; + }; + + /** + * Creates a plain object from a ManualScaling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ManualScaling + * @static + * @param {google.appengine.v1.ManualScaling} message ManualScaling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManualScaling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.instances = 0; + if (message.instances != null && message.hasOwnProperty("instances")) + object.instances = message.instances; + return object; + }; + + /** + * Converts this ManualScaling to JSON. + * @function toJSON + * @memberof google.appengine.v1.ManualScaling + * @instance + * @returns {Object.} JSON object + */ + ManualScaling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ManualScaling + * @function getTypeUrl + * @memberof google.appengine.v1.ManualScaling + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ManualScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ManualScaling"; + }; + + return ManualScaling; + })(); + + v1.CpuUtilization = (function() { + + /** + * Properties of a CpuUtilization. + * @memberof google.appengine.v1 + * @interface ICpuUtilization + * @property {google.protobuf.IDuration|null} [aggregationWindowLength] CpuUtilization aggregationWindowLength + * @property {number|null} [targetUtilization] CpuUtilization targetUtilization + */ + + /** + * Constructs a new CpuUtilization. + * @memberof google.appengine.v1 + * @classdesc Represents a CpuUtilization. + * @implements ICpuUtilization + * @constructor + * @param {google.appengine.v1.ICpuUtilization=} [properties] Properties to set + */ + function CpuUtilization(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CpuUtilization aggregationWindowLength. + * @member {google.protobuf.IDuration|null|undefined} aggregationWindowLength + * @memberof google.appengine.v1.CpuUtilization + * @instance + */ + CpuUtilization.prototype.aggregationWindowLength = null; + + /** + * CpuUtilization targetUtilization. + * @member {number} targetUtilization + * @memberof google.appengine.v1.CpuUtilization + * @instance + */ + CpuUtilization.prototype.targetUtilization = 0; + + /** + * Creates a new CpuUtilization instance using the specified properties. + * @function create + * @memberof google.appengine.v1.CpuUtilization + * @static + * @param {google.appengine.v1.ICpuUtilization=} [properties] Properties to set + * @returns {google.appengine.v1.CpuUtilization} CpuUtilization instance + */ + CpuUtilization.create = function create(properties) { + return new CpuUtilization(properties); + }; + + /** + * Encodes the specified CpuUtilization message. Does not implicitly {@link google.appengine.v1.CpuUtilization.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.CpuUtilization + * @static + * @param {google.appengine.v1.ICpuUtilization} message CpuUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CpuUtilization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aggregationWindowLength != null && Object.hasOwnProperty.call(message, "aggregationWindowLength")) + $root.google.protobuf.Duration.encode(message.aggregationWindowLength, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.targetUtilization != null && Object.hasOwnProperty.call(message, "targetUtilization")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.targetUtilization); + return writer; + }; + + /** + * Encodes the specified CpuUtilization message, length delimited. Does not implicitly {@link google.appengine.v1.CpuUtilization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.CpuUtilization + * @static + * @param {google.appengine.v1.ICpuUtilization} message CpuUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CpuUtilization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CpuUtilization message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.CpuUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.CpuUtilization} CpuUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CpuUtilization.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.appengine.v1.CpuUtilization(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.aggregationWindowLength = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.targetUtilization = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CpuUtilization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.CpuUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.CpuUtilization} CpuUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CpuUtilization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CpuUtilization message. + * @function verify + * @memberof google.appengine.v1.CpuUtilization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CpuUtilization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aggregationWindowLength != null && message.hasOwnProperty("aggregationWindowLength")) { + var error = $root.google.protobuf.Duration.verify(message.aggregationWindowLength); + if (error) + return "aggregationWindowLength." + error; + } + if (message.targetUtilization != null && message.hasOwnProperty("targetUtilization")) + if (typeof message.targetUtilization !== "number") + return "targetUtilization: number expected"; + return null; + }; + + /** + * Creates a CpuUtilization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.CpuUtilization + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.CpuUtilization} CpuUtilization + */ + CpuUtilization.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.CpuUtilization) + return object; + var message = new $root.google.appengine.v1.CpuUtilization(); + if (object.aggregationWindowLength != null) { + if (typeof object.aggregationWindowLength !== "object") + throw TypeError(".google.appengine.v1.CpuUtilization.aggregationWindowLength: object expected"); + message.aggregationWindowLength = $root.google.protobuf.Duration.fromObject(object.aggregationWindowLength); + } + if (object.targetUtilization != null) + message.targetUtilization = Number(object.targetUtilization); + return message; + }; + + /** + * Creates a plain object from a CpuUtilization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.CpuUtilization + * @static + * @param {google.appengine.v1.CpuUtilization} message CpuUtilization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CpuUtilization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.aggregationWindowLength = null; + object.targetUtilization = 0; + } + if (message.aggregationWindowLength != null && message.hasOwnProperty("aggregationWindowLength")) + object.aggregationWindowLength = $root.google.protobuf.Duration.toObject(message.aggregationWindowLength, options); + if (message.targetUtilization != null && message.hasOwnProperty("targetUtilization")) + object.targetUtilization = options.json && !isFinite(message.targetUtilization) ? String(message.targetUtilization) : message.targetUtilization; + return object; + }; + + /** + * Converts this CpuUtilization to JSON. + * @function toJSON + * @memberof google.appengine.v1.CpuUtilization + * @instance + * @returns {Object.} JSON object + */ + CpuUtilization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CpuUtilization + * @function getTypeUrl + * @memberof google.appengine.v1.CpuUtilization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CpuUtilization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.CpuUtilization"; + }; + + return CpuUtilization; + })(); + + v1.RequestUtilization = (function() { + + /** + * Properties of a RequestUtilization. + * @memberof google.appengine.v1 + * @interface IRequestUtilization + * @property {number|null} [targetRequestCountPerSecond] RequestUtilization targetRequestCountPerSecond + * @property {number|null} [targetConcurrentRequests] RequestUtilization targetConcurrentRequests + */ + + /** + * Constructs a new RequestUtilization. + * @memberof google.appengine.v1 + * @classdesc Represents a RequestUtilization. + * @implements IRequestUtilization + * @constructor + * @param {google.appengine.v1.IRequestUtilization=} [properties] Properties to set + */ + function RequestUtilization(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestUtilization targetRequestCountPerSecond. + * @member {number} targetRequestCountPerSecond + * @memberof google.appengine.v1.RequestUtilization + * @instance + */ + RequestUtilization.prototype.targetRequestCountPerSecond = 0; + + /** + * RequestUtilization targetConcurrentRequests. + * @member {number} targetConcurrentRequests + * @memberof google.appengine.v1.RequestUtilization + * @instance + */ + RequestUtilization.prototype.targetConcurrentRequests = 0; + + /** + * Creates a new RequestUtilization instance using the specified properties. + * @function create + * @memberof google.appengine.v1.RequestUtilization + * @static + * @param {google.appengine.v1.IRequestUtilization=} [properties] Properties to set + * @returns {google.appengine.v1.RequestUtilization} RequestUtilization instance + */ + RequestUtilization.create = function create(properties) { + return new RequestUtilization(properties); + }; + + /** + * Encodes the specified RequestUtilization message. Does not implicitly {@link google.appengine.v1.RequestUtilization.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.RequestUtilization + * @static + * @param {google.appengine.v1.IRequestUtilization} message RequestUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestUtilization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetRequestCountPerSecond != null && Object.hasOwnProperty.call(message, "targetRequestCountPerSecond")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.targetRequestCountPerSecond); + if (message.targetConcurrentRequests != null && Object.hasOwnProperty.call(message, "targetConcurrentRequests")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.targetConcurrentRequests); + return writer; + }; + + /** + * Encodes the specified RequestUtilization message, length delimited. Does not implicitly {@link google.appengine.v1.RequestUtilization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.RequestUtilization + * @static + * @param {google.appengine.v1.IRequestUtilization} message RequestUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestUtilization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestUtilization message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.RequestUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.RequestUtilization} RequestUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestUtilization.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.appengine.v1.RequestUtilization(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.targetRequestCountPerSecond = reader.int32(); + break; + } + case 2: { + message.targetConcurrentRequests = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestUtilization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.RequestUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.RequestUtilization} RequestUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestUtilization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestUtilization message. + * @function verify + * @memberof google.appengine.v1.RequestUtilization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestUtilization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetRequestCountPerSecond != null && message.hasOwnProperty("targetRequestCountPerSecond")) + if (!$util.isInteger(message.targetRequestCountPerSecond)) + return "targetRequestCountPerSecond: integer expected"; + if (message.targetConcurrentRequests != null && message.hasOwnProperty("targetConcurrentRequests")) + if (!$util.isInteger(message.targetConcurrentRequests)) + return "targetConcurrentRequests: integer expected"; + return null; + }; + + /** + * Creates a RequestUtilization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.RequestUtilization + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.RequestUtilization} RequestUtilization + */ + RequestUtilization.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.RequestUtilization) + return object; + var message = new $root.google.appengine.v1.RequestUtilization(); + if (object.targetRequestCountPerSecond != null) + message.targetRequestCountPerSecond = object.targetRequestCountPerSecond | 0; + if (object.targetConcurrentRequests != null) + message.targetConcurrentRequests = object.targetConcurrentRequests | 0; + return message; + }; + + /** + * Creates a plain object from a RequestUtilization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.RequestUtilization + * @static + * @param {google.appengine.v1.RequestUtilization} message RequestUtilization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestUtilization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetRequestCountPerSecond = 0; + object.targetConcurrentRequests = 0; + } + if (message.targetRequestCountPerSecond != null && message.hasOwnProperty("targetRequestCountPerSecond")) + object.targetRequestCountPerSecond = message.targetRequestCountPerSecond; + if (message.targetConcurrentRequests != null && message.hasOwnProperty("targetConcurrentRequests")) + object.targetConcurrentRequests = message.targetConcurrentRequests; + return object; + }; + + /** + * Converts this RequestUtilization to JSON. + * @function toJSON + * @memberof google.appengine.v1.RequestUtilization + * @instance + * @returns {Object.} JSON object + */ + RequestUtilization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestUtilization + * @function getTypeUrl + * @memberof google.appengine.v1.RequestUtilization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestUtilization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.RequestUtilization"; + }; + + return RequestUtilization; + })(); + + v1.DiskUtilization = (function() { + + /** + * Properties of a DiskUtilization. + * @memberof google.appengine.v1 + * @interface IDiskUtilization + * @property {number|null} [targetWriteBytesPerSecond] DiskUtilization targetWriteBytesPerSecond + * @property {number|null} [targetWriteOpsPerSecond] DiskUtilization targetWriteOpsPerSecond + * @property {number|null} [targetReadBytesPerSecond] DiskUtilization targetReadBytesPerSecond + * @property {number|null} [targetReadOpsPerSecond] DiskUtilization targetReadOpsPerSecond + */ + + /** + * Constructs a new DiskUtilization. + * @memberof google.appengine.v1 + * @classdesc Represents a DiskUtilization. + * @implements IDiskUtilization + * @constructor + * @param {google.appengine.v1.IDiskUtilization=} [properties] Properties to set + */ + function DiskUtilization(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskUtilization targetWriteBytesPerSecond. + * @member {number} targetWriteBytesPerSecond + * @memberof google.appengine.v1.DiskUtilization + * @instance + */ + DiskUtilization.prototype.targetWriteBytesPerSecond = 0; + + /** + * DiskUtilization targetWriteOpsPerSecond. + * @member {number} targetWriteOpsPerSecond + * @memberof google.appengine.v1.DiskUtilization + * @instance + */ + DiskUtilization.prototype.targetWriteOpsPerSecond = 0; + + /** + * DiskUtilization targetReadBytesPerSecond. + * @member {number} targetReadBytesPerSecond + * @memberof google.appengine.v1.DiskUtilization + * @instance + */ + DiskUtilization.prototype.targetReadBytesPerSecond = 0; + + /** + * DiskUtilization targetReadOpsPerSecond. + * @member {number} targetReadOpsPerSecond + * @memberof google.appengine.v1.DiskUtilization + * @instance + */ + DiskUtilization.prototype.targetReadOpsPerSecond = 0; + + /** + * Creates a new DiskUtilization instance using the specified properties. + * @function create + * @memberof google.appengine.v1.DiskUtilization + * @static + * @param {google.appengine.v1.IDiskUtilization=} [properties] Properties to set + * @returns {google.appengine.v1.DiskUtilization} DiskUtilization instance + */ + DiskUtilization.create = function create(properties) { + return new DiskUtilization(properties); + }; + + /** + * Encodes the specified DiskUtilization message. Does not implicitly {@link google.appengine.v1.DiskUtilization.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.DiskUtilization + * @static + * @param {google.appengine.v1.IDiskUtilization} message DiskUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskUtilization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetWriteBytesPerSecond != null && Object.hasOwnProperty.call(message, "targetWriteBytesPerSecond")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.targetWriteBytesPerSecond); + if (message.targetWriteOpsPerSecond != null && Object.hasOwnProperty.call(message, "targetWriteOpsPerSecond")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.targetWriteOpsPerSecond); + if (message.targetReadBytesPerSecond != null && Object.hasOwnProperty.call(message, "targetReadBytesPerSecond")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.targetReadBytesPerSecond); + if (message.targetReadOpsPerSecond != null && Object.hasOwnProperty.call(message, "targetReadOpsPerSecond")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.targetReadOpsPerSecond); + return writer; + }; + + /** + * Encodes the specified DiskUtilization message, length delimited. Does not implicitly {@link google.appengine.v1.DiskUtilization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.DiskUtilization + * @static + * @param {google.appengine.v1.IDiskUtilization} message DiskUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskUtilization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskUtilization message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.DiskUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.DiskUtilization} DiskUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskUtilization.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.appengine.v1.DiskUtilization(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 14: { + message.targetWriteBytesPerSecond = reader.int32(); + break; + } + case 15: { + message.targetWriteOpsPerSecond = reader.int32(); + break; + } + case 16: { + message.targetReadBytesPerSecond = reader.int32(); + break; + } + case 17: { + message.targetReadOpsPerSecond = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskUtilization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.DiskUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.DiskUtilization} DiskUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskUtilization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskUtilization message. + * @function verify + * @memberof google.appengine.v1.DiskUtilization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskUtilization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetWriteBytesPerSecond != null && message.hasOwnProperty("targetWriteBytesPerSecond")) + if (!$util.isInteger(message.targetWriteBytesPerSecond)) + return "targetWriteBytesPerSecond: integer expected"; + if (message.targetWriteOpsPerSecond != null && message.hasOwnProperty("targetWriteOpsPerSecond")) + if (!$util.isInteger(message.targetWriteOpsPerSecond)) + return "targetWriteOpsPerSecond: integer expected"; + if (message.targetReadBytesPerSecond != null && message.hasOwnProperty("targetReadBytesPerSecond")) + if (!$util.isInteger(message.targetReadBytesPerSecond)) + return "targetReadBytesPerSecond: integer expected"; + if (message.targetReadOpsPerSecond != null && message.hasOwnProperty("targetReadOpsPerSecond")) + if (!$util.isInteger(message.targetReadOpsPerSecond)) + return "targetReadOpsPerSecond: integer expected"; + return null; + }; + + /** + * Creates a DiskUtilization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.DiskUtilization + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.DiskUtilization} DiskUtilization + */ + DiskUtilization.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.DiskUtilization) + return object; + var message = new $root.google.appengine.v1.DiskUtilization(); + if (object.targetWriteBytesPerSecond != null) + message.targetWriteBytesPerSecond = object.targetWriteBytesPerSecond | 0; + if (object.targetWriteOpsPerSecond != null) + message.targetWriteOpsPerSecond = object.targetWriteOpsPerSecond | 0; + if (object.targetReadBytesPerSecond != null) + message.targetReadBytesPerSecond = object.targetReadBytesPerSecond | 0; + if (object.targetReadOpsPerSecond != null) + message.targetReadOpsPerSecond = object.targetReadOpsPerSecond | 0; + return message; + }; + + /** + * Creates a plain object from a DiskUtilization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.DiskUtilization + * @static + * @param {google.appengine.v1.DiskUtilization} message DiskUtilization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskUtilization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetWriteBytesPerSecond = 0; + object.targetWriteOpsPerSecond = 0; + object.targetReadBytesPerSecond = 0; + object.targetReadOpsPerSecond = 0; + } + if (message.targetWriteBytesPerSecond != null && message.hasOwnProperty("targetWriteBytesPerSecond")) + object.targetWriteBytesPerSecond = message.targetWriteBytesPerSecond; + if (message.targetWriteOpsPerSecond != null && message.hasOwnProperty("targetWriteOpsPerSecond")) + object.targetWriteOpsPerSecond = message.targetWriteOpsPerSecond; + if (message.targetReadBytesPerSecond != null && message.hasOwnProperty("targetReadBytesPerSecond")) + object.targetReadBytesPerSecond = message.targetReadBytesPerSecond; + if (message.targetReadOpsPerSecond != null && message.hasOwnProperty("targetReadOpsPerSecond")) + object.targetReadOpsPerSecond = message.targetReadOpsPerSecond; + return object; + }; + + /** + * Converts this DiskUtilization to JSON. + * @function toJSON + * @memberof google.appengine.v1.DiskUtilization + * @instance + * @returns {Object.} JSON object + */ + DiskUtilization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiskUtilization + * @function getTypeUrl + * @memberof google.appengine.v1.DiskUtilization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiskUtilization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.DiskUtilization"; + }; + + return DiskUtilization; + })(); + + v1.NetworkUtilization = (function() { + + /** + * Properties of a NetworkUtilization. + * @memberof google.appengine.v1 + * @interface INetworkUtilization + * @property {number|null} [targetSentBytesPerSecond] NetworkUtilization targetSentBytesPerSecond + * @property {number|null} [targetSentPacketsPerSecond] NetworkUtilization targetSentPacketsPerSecond + * @property {number|null} [targetReceivedBytesPerSecond] NetworkUtilization targetReceivedBytesPerSecond + * @property {number|null} [targetReceivedPacketsPerSecond] NetworkUtilization targetReceivedPacketsPerSecond + */ + + /** + * Constructs a new NetworkUtilization. + * @memberof google.appengine.v1 + * @classdesc Represents a NetworkUtilization. + * @implements INetworkUtilization + * @constructor + * @param {google.appengine.v1.INetworkUtilization=} [properties] Properties to set + */ + function NetworkUtilization(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkUtilization targetSentBytesPerSecond. + * @member {number} targetSentBytesPerSecond + * @memberof google.appengine.v1.NetworkUtilization + * @instance + */ + NetworkUtilization.prototype.targetSentBytesPerSecond = 0; + + /** + * NetworkUtilization targetSentPacketsPerSecond. + * @member {number} targetSentPacketsPerSecond + * @memberof google.appengine.v1.NetworkUtilization + * @instance + */ + NetworkUtilization.prototype.targetSentPacketsPerSecond = 0; + + /** + * NetworkUtilization targetReceivedBytesPerSecond. + * @member {number} targetReceivedBytesPerSecond + * @memberof google.appengine.v1.NetworkUtilization + * @instance + */ + NetworkUtilization.prototype.targetReceivedBytesPerSecond = 0; + + /** + * NetworkUtilization targetReceivedPacketsPerSecond. + * @member {number} targetReceivedPacketsPerSecond + * @memberof google.appengine.v1.NetworkUtilization + * @instance + */ + NetworkUtilization.prototype.targetReceivedPacketsPerSecond = 0; + + /** + * Creates a new NetworkUtilization instance using the specified properties. + * @function create + * @memberof google.appengine.v1.NetworkUtilization + * @static + * @param {google.appengine.v1.INetworkUtilization=} [properties] Properties to set + * @returns {google.appengine.v1.NetworkUtilization} NetworkUtilization instance + */ + NetworkUtilization.create = function create(properties) { + return new NetworkUtilization(properties); + }; + + /** + * Encodes the specified NetworkUtilization message. Does not implicitly {@link google.appengine.v1.NetworkUtilization.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.NetworkUtilization + * @static + * @param {google.appengine.v1.INetworkUtilization} message NetworkUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkUtilization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetSentBytesPerSecond != null && Object.hasOwnProperty.call(message, "targetSentBytesPerSecond")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.targetSentBytesPerSecond); + if (message.targetSentPacketsPerSecond != null && Object.hasOwnProperty.call(message, "targetSentPacketsPerSecond")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.targetSentPacketsPerSecond); + if (message.targetReceivedBytesPerSecond != null && Object.hasOwnProperty.call(message, "targetReceivedBytesPerSecond")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.targetReceivedBytesPerSecond); + if (message.targetReceivedPacketsPerSecond != null && Object.hasOwnProperty.call(message, "targetReceivedPacketsPerSecond")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.targetReceivedPacketsPerSecond); + return writer; + }; + + /** + * Encodes the specified NetworkUtilization message, length delimited. Does not implicitly {@link google.appengine.v1.NetworkUtilization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.NetworkUtilization + * @static + * @param {google.appengine.v1.INetworkUtilization} message NetworkUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkUtilization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkUtilization message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.NetworkUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.NetworkUtilization} NetworkUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkUtilization.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.appengine.v1.NetworkUtilization(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.targetSentBytesPerSecond = reader.int32(); + break; + } + case 11: { + message.targetSentPacketsPerSecond = reader.int32(); + break; + } + case 12: { + message.targetReceivedBytesPerSecond = reader.int32(); + break; + } + case 13: { + message.targetReceivedPacketsPerSecond = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkUtilization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.NetworkUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.NetworkUtilization} NetworkUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkUtilization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkUtilization message. + * @function verify + * @memberof google.appengine.v1.NetworkUtilization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkUtilization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetSentBytesPerSecond != null && message.hasOwnProperty("targetSentBytesPerSecond")) + if (!$util.isInteger(message.targetSentBytesPerSecond)) + return "targetSentBytesPerSecond: integer expected"; + if (message.targetSentPacketsPerSecond != null && message.hasOwnProperty("targetSentPacketsPerSecond")) + if (!$util.isInteger(message.targetSentPacketsPerSecond)) + return "targetSentPacketsPerSecond: integer expected"; + if (message.targetReceivedBytesPerSecond != null && message.hasOwnProperty("targetReceivedBytesPerSecond")) + if (!$util.isInteger(message.targetReceivedBytesPerSecond)) + return "targetReceivedBytesPerSecond: integer expected"; + if (message.targetReceivedPacketsPerSecond != null && message.hasOwnProperty("targetReceivedPacketsPerSecond")) + if (!$util.isInteger(message.targetReceivedPacketsPerSecond)) + return "targetReceivedPacketsPerSecond: integer expected"; + return null; + }; + + /** + * Creates a NetworkUtilization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.NetworkUtilization + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.NetworkUtilization} NetworkUtilization + */ + NetworkUtilization.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.NetworkUtilization) + return object; + var message = new $root.google.appengine.v1.NetworkUtilization(); + if (object.targetSentBytesPerSecond != null) + message.targetSentBytesPerSecond = object.targetSentBytesPerSecond | 0; + if (object.targetSentPacketsPerSecond != null) + message.targetSentPacketsPerSecond = object.targetSentPacketsPerSecond | 0; + if (object.targetReceivedBytesPerSecond != null) + message.targetReceivedBytesPerSecond = object.targetReceivedBytesPerSecond | 0; + if (object.targetReceivedPacketsPerSecond != null) + message.targetReceivedPacketsPerSecond = object.targetReceivedPacketsPerSecond | 0; + return message; + }; + + /** + * Creates a plain object from a NetworkUtilization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.NetworkUtilization + * @static + * @param {google.appengine.v1.NetworkUtilization} message NetworkUtilization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkUtilization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetSentBytesPerSecond = 0; + object.targetSentPacketsPerSecond = 0; + object.targetReceivedBytesPerSecond = 0; + object.targetReceivedPacketsPerSecond = 0; + } + if (message.targetSentBytesPerSecond != null && message.hasOwnProperty("targetSentBytesPerSecond")) + object.targetSentBytesPerSecond = message.targetSentBytesPerSecond; + if (message.targetSentPacketsPerSecond != null && message.hasOwnProperty("targetSentPacketsPerSecond")) + object.targetSentPacketsPerSecond = message.targetSentPacketsPerSecond; + if (message.targetReceivedBytesPerSecond != null && message.hasOwnProperty("targetReceivedBytesPerSecond")) + object.targetReceivedBytesPerSecond = message.targetReceivedBytesPerSecond; + if (message.targetReceivedPacketsPerSecond != null && message.hasOwnProperty("targetReceivedPacketsPerSecond")) + object.targetReceivedPacketsPerSecond = message.targetReceivedPacketsPerSecond; + return object; + }; + + /** + * Converts this NetworkUtilization to JSON. + * @function toJSON + * @memberof google.appengine.v1.NetworkUtilization + * @instance + * @returns {Object.} JSON object + */ + NetworkUtilization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkUtilization + * @function getTypeUrl + * @memberof google.appengine.v1.NetworkUtilization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkUtilization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.NetworkUtilization"; + }; + + return NetworkUtilization; + })(); + + v1.StandardSchedulerSettings = (function() { + + /** + * Properties of a StandardSchedulerSettings. + * @memberof google.appengine.v1 + * @interface IStandardSchedulerSettings + * @property {number|null} [targetCpuUtilization] StandardSchedulerSettings targetCpuUtilization + * @property {number|null} [targetThroughputUtilization] StandardSchedulerSettings targetThroughputUtilization + * @property {number|null} [minInstances] StandardSchedulerSettings minInstances + * @property {number|null} [maxInstances] StandardSchedulerSettings maxInstances + */ + + /** + * Constructs a new StandardSchedulerSettings. + * @memberof google.appengine.v1 + * @classdesc Represents a StandardSchedulerSettings. + * @implements IStandardSchedulerSettings + * @constructor + * @param {google.appengine.v1.IStandardSchedulerSettings=} [properties] Properties to set + */ + function StandardSchedulerSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StandardSchedulerSettings targetCpuUtilization. + * @member {number} targetCpuUtilization + * @memberof google.appengine.v1.StandardSchedulerSettings + * @instance + */ + StandardSchedulerSettings.prototype.targetCpuUtilization = 0; + + /** + * StandardSchedulerSettings targetThroughputUtilization. + * @member {number} targetThroughputUtilization + * @memberof google.appengine.v1.StandardSchedulerSettings + * @instance + */ + StandardSchedulerSettings.prototype.targetThroughputUtilization = 0; + + /** + * StandardSchedulerSettings minInstances. + * @member {number} minInstances + * @memberof google.appengine.v1.StandardSchedulerSettings + * @instance + */ + StandardSchedulerSettings.prototype.minInstances = 0; + + /** + * StandardSchedulerSettings maxInstances. + * @member {number} maxInstances + * @memberof google.appengine.v1.StandardSchedulerSettings + * @instance + */ + StandardSchedulerSettings.prototype.maxInstances = 0; + + /** + * Creates a new StandardSchedulerSettings instance using the specified properties. + * @function create + * @memberof google.appengine.v1.StandardSchedulerSettings + * @static + * @param {google.appengine.v1.IStandardSchedulerSettings=} [properties] Properties to set + * @returns {google.appengine.v1.StandardSchedulerSettings} StandardSchedulerSettings instance + */ + StandardSchedulerSettings.create = function create(properties) { + return new StandardSchedulerSettings(properties); + }; + + /** + * Encodes the specified StandardSchedulerSettings message. Does not implicitly {@link google.appengine.v1.StandardSchedulerSettings.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.StandardSchedulerSettings + * @static + * @param {google.appengine.v1.IStandardSchedulerSettings} message StandardSchedulerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSchedulerSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetCpuUtilization != null && Object.hasOwnProperty.call(message, "targetCpuUtilization")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.targetCpuUtilization); + if (message.targetThroughputUtilization != null && Object.hasOwnProperty.call(message, "targetThroughputUtilization")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.targetThroughputUtilization); + if (message.minInstances != null && Object.hasOwnProperty.call(message, "minInstances")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.minInstances); + if (message.maxInstances != null && Object.hasOwnProperty.call(message, "maxInstances")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxInstances); + return writer; + }; + + /** + * Encodes the specified StandardSchedulerSettings message, length delimited. Does not implicitly {@link google.appengine.v1.StandardSchedulerSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.StandardSchedulerSettings + * @static + * @param {google.appengine.v1.IStandardSchedulerSettings} message StandardSchedulerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSchedulerSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StandardSchedulerSettings message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.StandardSchedulerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.StandardSchedulerSettings} StandardSchedulerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSchedulerSettings.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.appengine.v1.StandardSchedulerSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.targetCpuUtilization = reader.double(); + break; + } + case 2: { + message.targetThroughputUtilization = reader.double(); + break; + } + case 3: { + message.minInstances = reader.int32(); + break; + } + case 4: { + message.maxInstances = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StandardSchedulerSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.StandardSchedulerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.StandardSchedulerSettings} StandardSchedulerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSchedulerSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardSchedulerSettings message. + * @function verify + * @memberof google.appengine.v1.StandardSchedulerSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardSchedulerSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetCpuUtilization != null && message.hasOwnProperty("targetCpuUtilization")) + if (typeof message.targetCpuUtilization !== "number") + return "targetCpuUtilization: number expected"; + if (message.targetThroughputUtilization != null && message.hasOwnProperty("targetThroughputUtilization")) + if (typeof message.targetThroughputUtilization !== "number") + return "targetThroughputUtilization: number expected"; + if (message.minInstances != null && message.hasOwnProperty("minInstances")) + if (!$util.isInteger(message.minInstances)) + return "minInstances: integer expected"; + if (message.maxInstances != null && message.hasOwnProperty("maxInstances")) + if (!$util.isInteger(message.maxInstances)) + return "maxInstances: integer expected"; + return null; + }; + + /** + * Creates a StandardSchedulerSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.StandardSchedulerSettings + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.StandardSchedulerSettings} StandardSchedulerSettings + */ + StandardSchedulerSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.StandardSchedulerSettings) + return object; + var message = new $root.google.appengine.v1.StandardSchedulerSettings(); + if (object.targetCpuUtilization != null) + message.targetCpuUtilization = Number(object.targetCpuUtilization); + if (object.targetThroughputUtilization != null) + message.targetThroughputUtilization = Number(object.targetThroughputUtilization); + if (object.minInstances != null) + message.minInstances = object.minInstances | 0; + if (object.maxInstances != null) + message.maxInstances = object.maxInstances | 0; + return message; + }; + + /** + * Creates a plain object from a StandardSchedulerSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.StandardSchedulerSettings + * @static + * @param {google.appengine.v1.StandardSchedulerSettings} message StandardSchedulerSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardSchedulerSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetCpuUtilization = 0; + object.targetThroughputUtilization = 0; + object.minInstances = 0; + object.maxInstances = 0; + } + if (message.targetCpuUtilization != null && message.hasOwnProperty("targetCpuUtilization")) + object.targetCpuUtilization = options.json && !isFinite(message.targetCpuUtilization) ? String(message.targetCpuUtilization) : message.targetCpuUtilization; + if (message.targetThroughputUtilization != null && message.hasOwnProperty("targetThroughputUtilization")) + object.targetThroughputUtilization = options.json && !isFinite(message.targetThroughputUtilization) ? String(message.targetThroughputUtilization) : message.targetThroughputUtilization; + if (message.minInstances != null && message.hasOwnProperty("minInstances")) + object.minInstances = message.minInstances; + if (message.maxInstances != null && message.hasOwnProperty("maxInstances")) + object.maxInstances = message.maxInstances; + return object; + }; + + /** + * Converts this StandardSchedulerSettings to JSON. + * @function toJSON + * @memberof google.appengine.v1.StandardSchedulerSettings + * @instance + * @returns {Object.} JSON object + */ + StandardSchedulerSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardSchedulerSettings + * @function getTypeUrl + * @memberof google.appengine.v1.StandardSchedulerSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardSchedulerSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.StandardSchedulerSettings"; + }; + + return StandardSchedulerSettings; + })(); + + v1.Network = (function() { + + /** + * Properties of a Network. + * @memberof google.appengine.v1 + * @interface INetwork + * @property {Array.|null} [forwardedPorts] Network forwardedPorts + * @property {string|null} [instanceTag] Network instanceTag + * @property {string|null} [name] Network name + * @property {string|null} [subnetworkName] Network subnetworkName + * @property {boolean|null} [sessionAffinity] Network sessionAffinity + */ + + /** + * Constructs a new Network. + * @memberof google.appengine.v1 + * @classdesc Represents a Network. + * @implements INetwork + * @constructor + * @param {google.appengine.v1.INetwork=} [properties] Properties to set + */ + function Network(properties) { + this.forwardedPorts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Network forwardedPorts. + * @member {Array.} forwardedPorts + * @memberof google.appengine.v1.Network + * @instance + */ + Network.prototype.forwardedPorts = $util.emptyArray; + + /** + * Network instanceTag. + * @member {string} instanceTag + * @memberof google.appengine.v1.Network + * @instance + */ + Network.prototype.instanceTag = ""; + + /** + * Network name. + * @member {string} name + * @memberof google.appengine.v1.Network + * @instance + */ + Network.prototype.name = ""; + + /** + * Network subnetworkName. + * @member {string} subnetworkName + * @memberof google.appengine.v1.Network + * @instance + */ + Network.prototype.subnetworkName = ""; + + /** + * Network sessionAffinity. + * @member {boolean} sessionAffinity + * @memberof google.appengine.v1.Network + * @instance + */ + Network.prototype.sessionAffinity = false; + + /** + * Creates a new Network instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Network + * @static + * @param {google.appengine.v1.INetwork=} [properties] Properties to set + * @returns {google.appengine.v1.Network} Network instance + */ + Network.create = function create(properties) { + return new Network(properties); + }; + + /** + * Encodes the specified Network message. Does not implicitly {@link google.appengine.v1.Network.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Network + * @static + * @param {google.appengine.v1.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.forwardedPorts != null && message.forwardedPorts.length) + for (var i = 0; i < message.forwardedPorts.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.forwardedPorts[i]); + if (message.instanceTag != null && Object.hasOwnProperty.call(message, "instanceTag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceTag); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.subnetworkName != null && Object.hasOwnProperty.call(message, "subnetworkName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.subnetworkName); + if (message.sessionAffinity != null && Object.hasOwnProperty.call(message, "sessionAffinity")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.sessionAffinity); + return writer; + }; + + /** + * Encodes the specified Network message, length delimited. Does not implicitly {@link google.appengine.v1.Network.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Network + * @static + * @param {google.appengine.v1.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Network message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.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.appengine.v1.Network(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.forwardedPorts && message.forwardedPorts.length)) + message.forwardedPorts = []; + message.forwardedPorts.push(reader.string()); + break; + } + case 2: { + message.instanceTag = reader.string(); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 4: { + message.subnetworkName = reader.string(); + break; + } + case 5: { + message.sessionAffinity = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Network message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Network message. + * @function verify + * @memberof google.appengine.v1.Network + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Network.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.forwardedPorts != null && message.hasOwnProperty("forwardedPorts")) { + if (!Array.isArray(message.forwardedPorts)) + return "forwardedPorts: array expected"; + for (var i = 0; i < message.forwardedPorts.length; ++i) + if (!$util.isString(message.forwardedPorts[i])) + return "forwardedPorts: string[] expected"; + } + if (message.instanceTag != null && message.hasOwnProperty("instanceTag")) + if (!$util.isString(message.instanceTag)) + return "instanceTag: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.subnetworkName != null && message.hasOwnProperty("subnetworkName")) + if (!$util.isString(message.subnetworkName)) + return "subnetworkName: string expected"; + if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) + if (typeof message.sessionAffinity !== "boolean") + return "sessionAffinity: boolean expected"; + return null; + }; + + /** + * Creates a Network message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Network + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Network} Network + */ + Network.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Network) + return object; + var message = new $root.google.appengine.v1.Network(); + if (object.forwardedPorts) { + if (!Array.isArray(object.forwardedPorts)) + throw TypeError(".google.appengine.v1.Network.forwardedPorts: array expected"); + message.forwardedPorts = []; + for (var i = 0; i < object.forwardedPorts.length; ++i) + message.forwardedPorts[i] = String(object.forwardedPorts[i]); + } + if (object.instanceTag != null) + message.instanceTag = String(object.instanceTag); + if (object.name != null) + message.name = String(object.name); + if (object.subnetworkName != null) + message.subnetworkName = String(object.subnetworkName); + if (object.sessionAffinity != null) + message.sessionAffinity = Boolean(object.sessionAffinity); + return message; + }; + + /** + * Creates a plain object from a Network message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Network + * @static + * @param {google.appengine.v1.Network} message Network + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Network.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.forwardedPorts = []; + if (options.defaults) { + object.instanceTag = ""; + object.name = ""; + object.subnetworkName = ""; + object.sessionAffinity = false; + } + if (message.forwardedPorts && message.forwardedPorts.length) { + object.forwardedPorts = []; + for (var j = 0; j < message.forwardedPorts.length; ++j) + object.forwardedPorts[j] = message.forwardedPorts[j]; + } + if (message.instanceTag != null && message.hasOwnProperty("instanceTag")) + object.instanceTag = message.instanceTag; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.subnetworkName != null && message.hasOwnProperty("subnetworkName")) + object.subnetworkName = message.subnetworkName; + if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) + object.sessionAffinity = message.sessionAffinity; + return object; + }; + + /** + * Converts this Network to JSON. + * @function toJSON + * @memberof google.appengine.v1.Network + * @instance + * @returns {Object.} JSON object + */ + Network.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Network + * @function getTypeUrl + * @memberof google.appengine.v1.Network + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Network.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Network"; + }; + + return Network; + })(); + + v1.Volume = (function() { + + /** + * Properties of a Volume. + * @memberof google.appengine.v1 + * @interface IVolume + * @property {string|null} [name] Volume name + * @property {string|null} [volumeType] Volume volumeType + * @property {number|null} [sizeGb] Volume sizeGb + */ + + /** + * Constructs a new Volume. + * @memberof google.appengine.v1 + * @classdesc Represents a Volume. + * @implements IVolume + * @constructor + * @param {google.appengine.v1.IVolume=} [properties] Properties to set + */ + function Volume(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Volume name. + * @member {string} name + * @memberof google.appengine.v1.Volume + * @instance + */ + Volume.prototype.name = ""; + + /** + * Volume volumeType. + * @member {string} volumeType + * @memberof google.appengine.v1.Volume + * @instance + */ + Volume.prototype.volumeType = ""; + + /** + * Volume sizeGb. + * @member {number} sizeGb + * @memberof google.appengine.v1.Volume + * @instance + */ + Volume.prototype.sizeGb = 0; + + /** + * Creates a new Volume instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Volume + * @static + * @param {google.appengine.v1.IVolume=} [properties] Properties to set + * @returns {google.appengine.v1.Volume} Volume instance + */ + Volume.create = function create(properties) { + return new Volume(properties); + }; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.appengine.v1.Volume.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Volume + * @static + * @param {google.appengine.v1.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.volumeType != null && Object.hasOwnProperty.call(message, "volumeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.volumeType); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.sizeGb); + return writer; + }; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.appengine.v1.Volume.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Volume + * @static + * @param {google.appengine.v1.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.appengine.v1.Volume(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.volumeType = reader.string(); + break; + } + case 3: { + message.sizeGb = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Volume message. + * @function verify + * @memberof google.appengine.v1.Volume + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Volume.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.volumeType != null && message.hasOwnProperty("volumeType")) + if (!$util.isString(message.volumeType)) + return "volumeType: string expected"; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (typeof message.sizeGb !== "number") + return "sizeGb: number expected"; + return null; + }; + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Volume + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Volume} Volume + */ + Volume.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Volume) + return object; + var message = new $root.google.appengine.v1.Volume(); + if (object.name != null) + message.name = String(object.name); + if (object.volumeType != null) + message.volumeType = String(object.volumeType); + if (object.sizeGb != null) + message.sizeGb = Number(object.sizeGb); + return message; + }; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Volume + * @static + * @param {google.appengine.v1.Volume} message Volume + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Volume.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.volumeType = ""; + object.sizeGb = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.volumeType != null && message.hasOwnProperty("volumeType")) + object.volumeType = message.volumeType; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + object.sizeGb = options.json && !isFinite(message.sizeGb) ? String(message.sizeGb) : message.sizeGb; + return object; + }; + + /** + * Converts this Volume to JSON. + * @function toJSON + * @memberof google.appengine.v1.Volume + * @instance + * @returns {Object.} JSON object + */ + Volume.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Volume + * @function getTypeUrl + * @memberof google.appengine.v1.Volume + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Volume.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Volume"; + }; + + return Volume; + })(); + + v1.Resources = (function() { + + /** + * Properties of a Resources. + * @memberof google.appengine.v1 + * @interface IResources + * @property {number|null} [cpu] Resources cpu + * @property {number|null} [diskGb] Resources diskGb + * @property {number|null} [memoryGb] Resources memoryGb + * @property {Array.|null} [volumes] Resources volumes + * @property {string|null} [kmsKeyReference] Resources kmsKeyReference + */ + + /** + * Constructs a new Resources. + * @memberof google.appengine.v1 + * @classdesc Represents a Resources. + * @implements IResources + * @constructor + * @param {google.appengine.v1.IResources=} [properties] Properties to set + */ + function Resources(properties) { + this.volumes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resources cpu. + * @member {number} cpu + * @memberof google.appengine.v1.Resources + * @instance + */ + Resources.prototype.cpu = 0; + + /** + * Resources diskGb. + * @member {number} diskGb + * @memberof google.appengine.v1.Resources + * @instance + */ + Resources.prototype.diskGb = 0; + + /** + * Resources memoryGb. + * @member {number} memoryGb + * @memberof google.appengine.v1.Resources + * @instance + */ + Resources.prototype.memoryGb = 0; + + /** + * Resources volumes. + * @member {Array.} volumes + * @memberof google.appengine.v1.Resources + * @instance + */ + Resources.prototype.volumes = $util.emptyArray; + + /** + * Resources kmsKeyReference. + * @member {string} kmsKeyReference + * @memberof google.appengine.v1.Resources + * @instance + */ + Resources.prototype.kmsKeyReference = ""; + + /** + * Creates a new Resources instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Resources + * @static + * @param {google.appengine.v1.IResources=} [properties] Properties to set + * @returns {google.appengine.v1.Resources} Resources instance + */ + Resources.create = function create(properties) { + return new Resources(properties); + }; + + /** + * Encodes the specified Resources message. Does not implicitly {@link google.appengine.v1.Resources.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Resources + * @static + * @param {google.appengine.v1.IResources} message Resources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.cpu); + if (message.diskGb != null && Object.hasOwnProperty.call(message, "diskGb")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.diskGb); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.memoryGb); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.appengine.v1.Volume.encode(message.volumes[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.kmsKeyReference != null && Object.hasOwnProperty.call(message, "kmsKeyReference")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.kmsKeyReference); + return writer; + }; + + /** + * Encodes the specified Resources message, length delimited. Does not implicitly {@link google.appengine.v1.Resources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Resources + * @static + * @param {google.appengine.v1.IResources} message Resources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resources message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Resources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Resources} Resources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resources.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.appengine.v1.Resources(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpu = reader.double(); + break; + } + case 2: { + message.diskGb = reader.double(); + break; + } + case 3: { + message.memoryGb = reader.double(); + break; + } + case 4: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.appengine.v1.Volume.decode(reader, reader.uint32())); + break; + } + case 5: { + message.kmsKeyReference = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Resources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Resources} Resources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resources message. + * @function verify + * @memberof google.appengine.v1.Resources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpu != null && message.hasOwnProperty("cpu")) + if (typeof message.cpu !== "number") + return "cpu: number expected"; + if (message.diskGb != null && message.hasOwnProperty("diskGb")) + if (typeof message.diskGb !== "number") + return "diskGb: number expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (typeof message.memoryGb !== "number") + return "memoryGb: number expected"; + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) { + var error = $root.google.appengine.v1.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.kmsKeyReference != null && message.hasOwnProperty("kmsKeyReference")) + if (!$util.isString(message.kmsKeyReference)) + return "kmsKeyReference: string expected"; + return null; + }; + + /** + * Creates a Resources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Resources + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Resources} Resources + */ + Resources.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Resources) + return object; + var message = new $root.google.appengine.v1.Resources(); + if (object.cpu != null) + message.cpu = Number(object.cpu); + if (object.diskGb != null) + message.diskGb = Number(object.diskGb); + if (object.memoryGb != null) + message.memoryGb = Number(object.memoryGb); + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.appengine.v1.Resources.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.appengine.v1.Resources.volumes: object expected"); + message.volumes[i] = $root.google.appengine.v1.Volume.fromObject(object.volumes[i]); + } + } + if (object.kmsKeyReference != null) + message.kmsKeyReference = String(object.kmsKeyReference); + return message; + }; + + /** + * Creates a plain object from a Resources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Resources + * @static + * @param {google.appengine.v1.Resources} message Resources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.volumes = []; + if (options.defaults) { + object.cpu = 0; + object.diskGb = 0; + object.memoryGb = 0; + object.kmsKeyReference = ""; + } + if (message.cpu != null && message.hasOwnProperty("cpu")) + object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; + if (message.diskGb != null && message.hasOwnProperty("diskGb")) + object.diskGb = options.json && !isFinite(message.diskGb) ? String(message.diskGb) : message.diskGb; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.appengine.v1.Volume.toObject(message.volumes[j], options); + } + if (message.kmsKeyReference != null && message.hasOwnProperty("kmsKeyReference")) + object.kmsKeyReference = message.kmsKeyReference; + return object; + }; + + /** + * Converts this Resources to JSON. + * @function toJSON + * @memberof google.appengine.v1.Resources + * @instance + * @returns {Object.} JSON object + */ + Resources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resources + * @function getTypeUrl + * @memberof google.appengine.v1.Resources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Resources"; + }; + + return Resources; + })(); + + /** + * InboundServiceType enum. + * @name google.appengine.v1.InboundServiceType + * @enum {number} + * @property {number} INBOUND_SERVICE_UNSPECIFIED=0 INBOUND_SERVICE_UNSPECIFIED value + * @property {number} INBOUND_SERVICE_MAIL=1 INBOUND_SERVICE_MAIL value + * @property {number} INBOUND_SERVICE_MAIL_BOUNCE=2 INBOUND_SERVICE_MAIL_BOUNCE value + * @property {number} INBOUND_SERVICE_XMPP_ERROR=3 INBOUND_SERVICE_XMPP_ERROR value + * @property {number} INBOUND_SERVICE_XMPP_MESSAGE=4 INBOUND_SERVICE_XMPP_MESSAGE value + * @property {number} INBOUND_SERVICE_XMPP_SUBSCRIBE=5 INBOUND_SERVICE_XMPP_SUBSCRIBE value + * @property {number} INBOUND_SERVICE_XMPP_PRESENCE=6 INBOUND_SERVICE_XMPP_PRESENCE value + * @property {number} INBOUND_SERVICE_CHANNEL_PRESENCE=7 INBOUND_SERVICE_CHANNEL_PRESENCE value + * @property {number} INBOUND_SERVICE_WARMUP=9 INBOUND_SERVICE_WARMUP value + */ + v1.InboundServiceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INBOUND_SERVICE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INBOUND_SERVICE_MAIL"] = 1; + values[valuesById[2] = "INBOUND_SERVICE_MAIL_BOUNCE"] = 2; + values[valuesById[3] = "INBOUND_SERVICE_XMPP_ERROR"] = 3; + values[valuesById[4] = "INBOUND_SERVICE_XMPP_MESSAGE"] = 4; + values[valuesById[5] = "INBOUND_SERVICE_XMPP_SUBSCRIBE"] = 5; + values[valuesById[6] = "INBOUND_SERVICE_XMPP_PRESENCE"] = 6; + values[valuesById[7] = "INBOUND_SERVICE_CHANNEL_PRESENCE"] = 7; + values[valuesById[9] = "INBOUND_SERVICE_WARMUP"] = 9; + return values; + })(); + + /** + * ServingStatus enum. + * @name google.appengine.v1.ServingStatus + * @enum {number} + * @property {number} SERVING_STATUS_UNSPECIFIED=0 SERVING_STATUS_UNSPECIFIED value + * @property {number} SERVING=1 SERVING value + * @property {number} STOPPED=2 STOPPED value + */ + v1.ServingStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVING_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVING"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + return values; + })(); + + v1.VpcAccessConnector = (function() { + + /** + * Properties of a VpcAccessConnector. + * @memberof google.appengine.v1 + * @interface IVpcAccessConnector + * @property {string|null} [name] VpcAccessConnector name + * @property {google.appengine.v1.VpcAccessConnector.EgressSetting|null} [egressSetting] VpcAccessConnector egressSetting + */ + + /** + * Constructs a new VpcAccessConnector. + * @memberof google.appengine.v1 + * @classdesc Represents a VpcAccessConnector. + * @implements IVpcAccessConnector + * @constructor + * @param {google.appengine.v1.IVpcAccessConnector=} [properties] Properties to set + */ + function VpcAccessConnector(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpcAccessConnector name. + * @member {string} name + * @memberof google.appengine.v1.VpcAccessConnector + * @instance + */ + VpcAccessConnector.prototype.name = ""; + + /** + * VpcAccessConnector egressSetting. + * @member {google.appengine.v1.VpcAccessConnector.EgressSetting} egressSetting + * @memberof google.appengine.v1.VpcAccessConnector + * @instance + */ + VpcAccessConnector.prototype.egressSetting = 0; + + /** + * Creates a new VpcAccessConnector instance using the specified properties. + * @function create + * @memberof google.appengine.v1.VpcAccessConnector + * @static + * @param {google.appengine.v1.IVpcAccessConnector=} [properties] Properties to set + * @returns {google.appengine.v1.VpcAccessConnector} VpcAccessConnector instance + */ + VpcAccessConnector.create = function create(properties) { + return new VpcAccessConnector(properties); + }; + + /** + * Encodes the specified VpcAccessConnector message. Does not implicitly {@link google.appengine.v1.VpcAccessConnector.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.VpcAccessConnector + * @static + * @param {google.appengine.v1.IVpcAccessConnector} message VpcAccessConnector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessConnector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.egressSetting != null && Object.hasOwnProperty.call(message, "egressSetting")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.egressSetting); + return writer; + }; + + /** + * Encodes the specified VpcAccessConnector message, length delimited. Does not implicitly {@link google.appengine.v1.VpcAccessConnector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.VpcAccessConnector + * @static + * @param {google.appengine.v1.IVpcAccessConnector} message VpcAccessConnector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessConnector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcAccessConnector message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.VpcAccessConnector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.VpcAccessConnector} VpcAccessConnector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessConnector.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.appengine.v1.VpcAccessConnector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.egressSetting = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcAccessConnector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.VpcAccessConnector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.VpcAccessConnector} VpcAccessConnector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessConnector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcAccessConnector message. + * @function verify + * @memberof google.appengine.v1.VpcAccessConnector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcAccessConnector.verify = function verify(message) { + if (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.egressSetting != null && message.hasOwnProperty("egressSetting")) + switch (message.egressSetting) { + default: + return "egressSetting: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a VpcAccessConnector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.VpcAccessConnector + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.VpcAccessConnector} VpcAccessConnector + */ + VpcAccessConnector.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.VpcAccessConnector) + return object; + var message = new $root.google.appengine.v1.VpcAccessConnector(); + if (object.name != null) + message.name = String(object.name); + switch (object.egressSetting) { + default: + if (typeof object.egressSetting === "number") { + message.egressSetting = object.egressSetting; + break; + } + break; + case "EGRESS_SETTING_UNSPECIFIED": + case 0: + message.egressSetting = 0; + break; + case "ALL_TRAFFIC": + case 1: + message.egressSetting = 1; + break; + case "PRIVATE_IP_RANGES": + case 2: + message.egressSetting = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a VpcAccessConnector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.VpcAccessConnector + * @static + * @param {google.appengine.v1.VpcAccessConnector} message VpcAccessConnector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcAccessConnector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.egressSetting = options.enums === String ? "EGRESS_SETTING_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.egressSetting != null && message.hasOwnProperty("egressSetting")) + object.egressSetting = options.enums === String ? $root.google.appengine.v1.VpcAccessConnector.EgressSetting[message.egressSetting] === undefined ? message.egressSetting : $root.google.appengine.v1.VpcAccessConnector.EgressSetting[message.egressSetting] : message.egressSetting; + return object; + }; + + /** + * Converts this VpcAccessConnector to JSON. + * @function toJSON + * @memberof google.appengine.v1.VpcAccessConnector + * @instance + * @returns {Object.} JSON object + */ + VpcAccessConnector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcAccessConnector + * @function getTypeUrl + * @memberof google.appengine.v1.VpcAccessConnector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcAccessConnector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.VpcAccessConnector"; + }; + + /** + * EgressSetting enum. + * @name google.appengine.v1.VpcAccessConnector.EgressSetting + * @enum {number} + * @property {number} EGRESS_SETTING_UNSPECIFIED=0 EGRESS_SETTING_UNSPECIFIED value + * @property {number} ALL_TRAFFIC=1 ALL_TRAFFIC value + * @property {number} PRIVATE_IP_RANGES=2 PRIVATE_IP_RANGES value + */ + VpcAccessConnector.EgressSetting = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EGRESS_SETTING_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALL_TRAFFIC"] = 1; + values[valuesById[2] = "PRIVATE_IP_RANGES"] = 2; + return values; + })(); + + return VpcAccessConnector; + })(); + + v1.Entrypoint = (function() { + + /** + * Properties of an Entrypoint. + * @memberof google.appengine.v1 + * @interface IEntrypoint + * @property {string|null} [shell] Entrypoint shell + */ + + /** + * Constructs a new Entrypoint. + * @memberof google.appengine.v1 + * @classdesc Represents an Entrypoint. + * @implements IEntrypoint + * @constructor + * @param {google.appengine.v1.IEntrypoint=} [properties] Properties to set + */ + function Entrypoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entrypoint shell. + * @member {string|null|undefined} shell + * @memberof google.appengine.v1.Entrypoint + * @instance + */ + Entrypoint.prototype.shell = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Entrypoint command. + * @member {"shell"|undefined} command + * @memberof google.appengine.v1.Entrypoint + * @instance + */ + Object.defineProperty(Entrypoint.prototype, "command", { + get: $util.oneOfGetter($oneOfFields = ["shell"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Entrypoint instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Entrypoint + * @static + * @param {google.appengine.v1.IEntrypoint=} [properties] Properties to set + * @returns {google.appengine.v1.Entrypoint} Entrypoint instance + */ + Entrypoint.create = function create(properties) { + return new Entrypoint(properties); + }; + + /** + * Encodes the specified Entrypoint message. Does not implicitly {@link google.appengine.v1.Entrypoint.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Entrypoint + * @static + * @param {google.appengine.v1.IEntrypoint} message Entrypoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entrypoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.shell != null && Object.hasOwnProperty.call(message, "shell")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.shell); + return writer; + }; + + /** + * Encodes the specified Entrypoint message, length delimited. Does not implicitly {@link google.appengine.v1.Entrypoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Entrypoint + * @static + * @param {google.appengine.v1.IEntrypoint} message Entrypoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entrypoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entrypoint message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Entrypoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Entrypoint} Entrypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entrypoint.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.appengine.v1.Entrypoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.shell = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entrypoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Entrypoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Entrypoint} Entrypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entrypoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entrypoint message. + * @function verify + * @memberof google.appengine.v1.Entrypoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entrypoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.shell != null && message.hasOwnProperty("shell")) { + properties.command = 1; + if (!$util.isString(message.shell)) + return "shell: string expected"; + } + return null; + }; + + /** + * Creates an Entrypoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Entrypoint + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Entrypoint} Entrypoint + */ + Entrypoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Entrypoint) + return object; + var message = new $root.google.appengine.v1.Entrypoint(); + if (object.shell != null) + message.shell = String(object.shell); + return message; + }; + + /** + * Creates a plain object from an Entrypoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Entrypoint + * @static + * @param {google.appengine.v1.Entrypoint} message Entrypoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entrypoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.shell != null && message.hasOwnProperty("shell")) { + object.shell = message.shell; + if (options.oneofs) + object.command = "shell"; + } + return object; + }; + + /** + * Converts this Entrypoint to JSON. + * @function toJSON + * @memberof google.appengine.v1.Entrypoint + * @instance + * @returns {Object.} JSON object + */ + Entrypoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entrypoint + * @function getTypeUrl + * @memberof google.appengine.v1.Entrypoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entrypoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Entrypoint"; + }; + + return Entrypoint; + })(); + + v1.Deployment = (function() { + + /** + * Properties of a Deployment. + * @memberof google.appengine.v1 + * @interface IDeployment + * @property {Object.|null} [files] Deployment files + * @property {google.appengine.v1.IContainerInfo|null} [container] Deployment container + * @property {google.appengine.v1.IZipInfo|null} [zip] Deployment zip + * @property {google.appengine.v1.ICloudBuildOptions|null} [cloudBuildOptions] Deployment cloudBuildOptions + */ + + /** + * Constructs a new Deployment. + * @memberof google.appengine.v1 + * @classdesc Represents a Deployment. + * @implements IDeployment + * @constructor + * @param {google.appengine.v1.IDeployment=} [properties] Properties to set + */ + function Deployment(properties) { + this.files = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deployment files. + * @member {Object.} files + * @memberof google.appengine.v1.Deployment + * @instance + */ + Deployment.prototype.files = $util.emptyObject; + + /** + * Deployment container. + * @member {google.appengine.v1.IContainerInfo|null|undefined} container + * @memberof google.appengine.v1.Deployment + * @instance + */ + Deployment.prototype.container = null; + + /** + * Deployment zip. + * @member {google.appengine.v1.IZipInfo|null|undefined} zip + * @memberof google.appengine.v1.Deployment + * @instance + */ + Deployment.prototype.zip = null; + + /** + * Deployment cloudBuildOptions. + * @member {google.appengine.v1.ICloudBuildOptions|null|undefined} cloudBuildOptions + * @memberof google.appengine.v1.Deployment + * @instance + */ + Deployment.prototype.cloudBuildOptions = null; + + /** + * Creates a new Deployment instance using the specified properties. + * @function create + * @memberof google.appengine.v1.Deployment + * @static + * @param {google.appengine.v1.IDeployment=} [properties] Properties to set + * @returns {google.appengine.v1.Deployment} Deployment instance + */ + Deployment.create = function create(properties) { + return new Deployment(properties); + }; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.appengine.v1.Deployment.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.Deployment + * @static + * @param {google.appengine.v1.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.files != null && Object.hasOwnProperty.call(message, "files")) + for (var keys = Object.keys(message.files), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.appengine.v1.FileInfo.encode(message.files[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.container != null && Object.hasOwnProperty.call(message, "container")) + $root.google.appengine.v1.ContainerInfo.encode(message.container, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.zip != null && Object.hasOwnProperty.call(message, "zip")) + $root.google.appengine.v1.ZipInfo.encode(message.zip, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cloudBuildOptions != null && Object.hasOwnProperty.call(message, "cloudBuildOptions")) + $root.google.appengine.v1.CloudBuildOptions.encode(message.cloudBuildOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.appengine.v1.Deployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.Deployment + * @static + * @param {google.appengine.v1.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.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.appengine.v1.Deployment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.files === $util.emptyObject) + message.files = {}; + 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.appengine.v1.FileInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.files[key] = value; + break; + } + case 2: { + message.container = $root.google.appengine.v1.ContainerInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + message.zip = $root.google.appengine.v1.ZipInfo.decode(reader, reader.uint32()); + break; + } + case 6: { + message.cloudBuildOptions = $root.google.appengine.v1.CloudBuildOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deployment message. + * @function verify + * @memberof google.appengine.v1.Deployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deployment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.files != null && message.hasOwnProperty("files")) { + if (!$util.isObject(message.files)) + return "files: object expected"; + var key = Object.keys(message.files); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.appengine.v1.FileInfo.verify(message.files[key[i]]); + if (error) + return "files." + error; + } + } + if (message.container != null && message.hasOwnProperty("container")) { + var error = $root.google.appengine.v1.ContainerInfo.verify(message.container); + if (error) + return "container." + error; + } + if (message.zip != null && message.hasOwnProperty("zip")) { + var error = $root.google.appengine.v1.ZipInfo.verify(message.zip); + if (error) + return "zip." + error; + } + if (message.cloudBuildOptions != null && message.hasOwnProperty("cloudBuildOptions")) { + var error = $root.google.appengine.v1.CloudBuildOptions.verify(message.cloudBuildOptions); + if (error) + return "cloudBuildOptions." + error; + } + return null; + }; + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.Deployment + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.Deployment} Deployment + */ + Deployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.Deployment) + return object; + var message = new $root.google.appengine.v1.Deployment(); + if (object.files) { + if (typeof object.files !== "object") + throw TypeError(".google.appengine.v1.Deployment.files: object expected"); + message.files = {}; + for (var keys = Object.keys(object.files), i = 0; i < keys.length; ++i) { + if (typeof object.files[keys[i]] !== "object") + throw TypeError(".google.appengine.v1.Deployment.files: object expected"); + message.files[keys[i]] = $root.google.appengine.v1.FileInfo.fromObject(object.files[keys[i]]); + } + } + if (object.container != null) { + if (typeof object.container !== "object") + throw TypeError(".google.appengine.v1.Deployment.container: object expected"); + message.container = $root.google.appengine.v1.ContainerInfo.fromObject(object.container); + } + if (object.zip != null) { + if (typeof object.zip !== "object") + throw TypeError(".google.appengine.v1.Deployment.zip: object expected"); + message.zip = $root.google.appengine.v1.ZipInfo.fromObject(object.zip); + } + if (object.cloudBuildOptions != null) { + if (typeof object.cloudBuildOptions !== "object") + throw TypeError(".google.appengine.v1.Deployment.cloudBuildOptions: object expected"); + message.cloudBuildOptions = $root.google.appengine.v1.CloudBuildOptions.fromObject(object.cloudBuildOptions); + } + return message; + }; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.Deployment + * @static + * @param {google.appengine.v1.Deployment} message Deployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.files = {}; + if (options.defaults) { + object.container = null; + object.zip = null; + object.cloudBuildOptions = null; + } + var keys2; + if (message.files && (keys2 = Object.keys(message.files)).length) { + object.files = {}; + for (var j = 0; j < keys2.length; ++j) + object.files[keys2[j]] = $root.google.appengine.v1.FileInfo.toObject(message.files[keys2[j]], options); + } + if (message.container != null && message.hasOwnProperty("container")) + object.container = $root.google.appengine.v1.ContainerInfo.toObject(message.container, options); + if (message.zip != null && message.hasOwnProperty("zip")) + object.zip = $root.google.appengine.v1.ZipInfo.toObject(message.zip, options); + if (message.cloudBuildOptions != null && message.hasOwnProperty("cloudBuildOptions")) + object.cloudBuildOptions = $root.google.appengine.v1.CloudBuildOptions.toObject(message.cloudBuildOptions, options); + return object; + }; + + /** + * Converts this Deployment to JSON. + * @function toJSON + * @memberof google.appengine.v1.Deployment + * @instance + * @returns {Object.} JSON object + */ + Deployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deployment + * @function getTypeUrl + * @memberof google.appengine.v1.Deployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.Deployment"; + }; + + return Deployment; + })(); + + v1.FileInfo = (function() { + + /** + * Properties of a FileInfo. + * @memberof google.appengine.v1 + * @interface IFileInfo + * @property {string|null} [sourceUrl] FileInfo sourceUrl + * @property {string|null} [sha1Sum] FileInfo sha1Sum + * @property {string|null} [mimeType] FileInfo mimeType + */ + + /** + * Constructs a new FileInfo. + * @memberof google.appengine.v1 + * @classdesc Represents a FileInfo. + * @implements IFileInfo + * @constructor + * @param {google.appengine.v1.IFileInfo=} [properties] Properties to set + */ + function FileInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileInfo sourceUrl. + * @member {string} sourceUrl + * @memberof google.appengine.v1.FileInfo + * @instance + */ + FileInfo.prototype.sourceUrl = ""; + + /** + * FileInfo sha1Sum. + * @member {string} sha1Sum + * @memberof google.appengine.v1.FileInfo + * @instance + */ + FileInfo.prototype.sha1Sum = ""; + + /** + * FileInfo mimeType. + * @member {string} mimeType + * @memberof google.appengine.v1.FileInfo + * @instance + */ + FileInfo.prototype.mimeType = ""; + + /** + * Creates a new FileInfo instance using the specified properties. + * @function create + * @memberof google.appengine.v1.FileInfo + * @static + * @param {google.appengine.v1.IFileInfo=} [properties] Properties to set + * @returns {google.appengine.v1.FileInfo} FileInfo instance + */ + FileInfo.create = function create(properties) { + return new FileInfo(properties); + }; + + /** + * Encodes the specified FileInfo message. Does not implicitly {@link google.appengine.v1.FileInfo.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.FileInfo + * @static + * @param {google.appengine.v1.IFileInfo} message FileInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceUrl != null && Object.hasOwnProperty.call(message, "sourceUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceUrl); + if (message.sha1Sum != null && Object.hasOwnProperty.call(message, "sha1Sum")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sha1Sum); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified FileInfo message, length delimited. Does not implicitly {@link google.appengine.v1.FileInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.FileInfo + * @static + * @param {google.appengine.v1.IFileInfo} message FileInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileInfo message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.FileInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.FileInfo} FileInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileInfo.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.appengine.v1.FileInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceUrl = reader.string(); + break; + } + case 2: { + message.sha1Sum = reader.string(); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.FileInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.FileInfo} FileInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileInfo message. + * @function verify + * @memberof google.appengine.v1.FileInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceUrl != null && message.hasOwnProperty("sourceUrl")) + if (!$util.isString(message.sourceUrl)) + return "sourceUrl: string expected"; + if (message.sha1Sum != null && message.hasOwnProperty("sha1Sum")) + if (!$util.isString(message.sha1Sum)) + return "sha1Sum: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a FileInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.FileInfo + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.FileInfo} FileInfo + */ + FileInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.FileInfo) + return object; + var message = new $root.google.appengine.v1.FileInfo(); + if (object.sourceUrl != null) + message.sourceUrl = String(object.sourceUrl); + if (object.sha1Sum != null) + message.sha1Sum = String(object.sha1Sum); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a FileInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.FileInfo + * @static + * @param {google.appengine.v1.FileInfo} message FileInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceUrl = ""; + object.sha1Sum = ""; + object.mimeType = ""; + } + if (message.sourceUrl != null && message.hasOwnProperty("sourceUrl")) + object.sourceUrl = message.sourceUrl; + if (message.sha1Sum != null && message.hasOwnProperty("sha1Sum")) + object.sha1Sum = message.sha1Sum; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this FileInfo to JSON. + * @function toJSON + * @memberof google.appengine.v1.FileInfo + * @instance + * @returns {Object.} JSON object + */ + FileInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileInfo + * @function getTypeUrl + * @memberof google.appengine.v1.FileInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.FileInfo"; + }; + + return FileInfo; + })(); + + v1.ContainerInfo = (function() { + + /** + * Properties of a ContainerInfo. + * @memberof google.appengine.v1 + * @interface IContainerInfo + * @property {string|null} [image] ContainerInfo image + */ + + /** + * Constructs a new ContainerInfo. + * @memberof google.appengine.v1 + * @classdesc Represents a ContainerInfo. + * @implements IContainerInfo + * @constructor + * @param {google.appengine.v1.IContainerInfo=} [properties] Properties to set + */ + function ContainerInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContainerInfo image. + * @member {string} image + * @memberof google.appengine.v1.ContainerInfo + * @instance + */ + ContainerInfo.prototype.image = ""; + + /** + * Creates a new ContainerInfo instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ContainerInfo + * @static + * @param {google.appengine.v1.IContainerInfo=} [properties] Properties to set + * @returns {google.appengine.v1.ContainerInfo} ContainerInfo instance + */ + ContainerInfo.create = function create(properties) { + return new ContainerInfo(properties); + }; + + /** + * Encodes the specified ContainerInfo message. Does not implicitly {@link google.appengine.v1.ContainerInfo.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ContainerInfo + * @static + * @param {google.appengine.v1.IContainerInfo} message ContainerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.image); + return writer; + }; + + /** + * Encodes the specified ContainerInfo message, length delimited. Does not implicitly {@link google.appengine.v1.ContainerInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ContainerInfo + * @static + * @param {google.appengine.v1.IContainerInfo} message ContainerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContainerInfo message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ContainerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ContainerInfo} ContainerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerInfo.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.appengine.v1.ContainerInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.image = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContainerInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ContainerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ContainerInfo} ContainerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContainerInfo message. + * @function verify + * @memberof google.appengine.v1.ContainerInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContainerInfo.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"; + return null; + }; + + /** + * Creates a ContainerInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ContainerInfo + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ContainerInfo} ContainerInfo + */ + ContainerInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ContainerInfo) + return object; + var message = new $root.google.appengine.v1.ContainerInfo(); + if (object.image != null) + message.image = String(object.image); + return message; + }; + + /** + * Creates a plain object from a ContainerInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ContainerInfo + * @static + * @param {google.appengine.v1.ContainerInfo} message ContainerInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContainerInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.image = ""; + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + return object; + }; + + /** + * Converts this ContainerInfo to JSON. + * @function toJSON + * @memberof google.appengine.v1.ContainerInfo + * @instance + * @returns {Object.} JSON object + */ + ContainerInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContainerInfo + * @function getTypeUrl + * @memberof google.appengine.v1.ContainerInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContainerInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ContainerInfo"; + }; + + return ContainerInfo; + })(); + + v1.CloudBuildOptions = (function() { + + /** + * Properties of a CloudBuildOptions. + * @memberof google.appengine.v1 + * @interface ICloudBuildOptions + * @property {string|null} [appYamlPath] CloudBuildOptions appYamlPath + * @property {google.protobuf.IDuration|null} [cloudBuildTimeout] CloudBuildOptions cloudBuildTimeout + */ + + /** + * Constructs a new CloudBuildOptions. + * @memberof google.appengine.v1 + * @classdesc Represents a CloudBuildOptions. + * @implements ICloudBuildOptions + * @constructor + * @param {google.appengine.v1.ICloudBuildOptions=} [properties] Properties to set + */ + function CloudBuildOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudBuildOptions appYamlPath. + * @member {string} appYamlPath + * @memberof google.appengine.v1.CloudBuildOptions + * @instance + */ + CloudBuildOptions.prototype.appYamlPath = ""; + + /** + * CloudBuildOptions cloudBuildTimeout. + * @member {google.protobuf.IDuration|null|undefined} cloudBuildTimeout + * @memberof google.appengine.v1.CloudBuildOptions + * @instance + */ + CloudBuildOptions.prototype.cloudBuildTimeout = null; + + /** + * Creates a new CloudBuildOptions instance using the specified properties. + * @function create + * @memberof google.appengine.v1.CloudBuildOptions + * @static + * @param {google.appengine.v1.ICloudBuildOptions=} [properties] Properties to set + * @returns {google.appengine.v1.CloudBuildOptions} CloudBuildOptions instance + */ + CloudBuildOptions.create = function create(properties) { + return new CloudBuildOptions(properties); + }; + + /** + * Encodes the specified CloudBuildOptions message. Does not implicitly {@link google.appengine.v1.CloudBuildOptions.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.CloudBuildOptions + * @static + * @param {google.appengine.v1.ICloudBuildOptions} message CloudBuildOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudBuildOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appYamlPath != null && Object.hasOwnProperty.call(message, "appYamlPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.appYamlPath); + if (message.cloudBuildTimeout != null && Object.hasOwnProperty.call(message, "cloudBuildTimeout")) + $root.google.protobuf.Duration.encode(message.cloudBuildTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudBuildOptions message, length delimited. Does not implicitly {@link google.appengine.v1.CloudBuildOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.CloudBuildOptions + * @static + * @param {google.appengine.v1.ICloudBuildOptions} message CloudBuildOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudBuildOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudBuildOptions message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.CloudBuildOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.CloudBuildOptions} CloudBuildOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudBuildOptions.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.appengine.v1.CloudBuildOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.appYamlPath = reader.string(); + break; + } + case 2: { + message.cloudBuildTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudBuildOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.CloudBuildOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.CloudBuildOptions} CloudBuildOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudBuildOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudBuildOptions message. + * @function verify + * @memberof google.appengine.v1.CloudBuildOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudBuildOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appYamlPath != null && message.hasOwnProperty("appYamlPath")) + if (!$util.isString(message.appYamlPath)) + return "appYamlPath: string expected"; + if (message.cloudBuildTimeout != null && message.hasOwnProperty("cloudBuildTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.cloudBuildTimeout); + if (error) + return "cloudBuildTimeout." + error; + } + return null; + }; + + /** + * Creates a CloudBuildOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.CloudBuildOptions + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.CloudBuildOptions} CloudBuildOptions + */ + CloudBuildOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.CloudBuildOptions) + return object; + var message = new $root.google.appengine.v1.CloudBuildOptions(); + if (object.appYamlPath != null) + message.appYamlPath = String(object.appYamlPath); + if (object.cloudBuildTimeout != null) { + if (typeof object.cloudBuildTimeout !== "object") + throw TypeError(".google.appengine.v1.CloudBuildOptions.cloudBuildTimeout: object expected"); + message.cloudBuildTimeout = $root.google.protobuf.Duration.fromObject(object.cloudBuildTimeout); + } + return message; + }; + + /** + * Creates a plain object from a CloudBuildOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.CloudBuildOptions + * @static + * @param {google.appengine.v1.CloudBuildOptions} message CloudBuildOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudBuildOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.appYamlPath = ""; + object.cloudBuildTimeout = null; + } + if (message.appYamlPath != null && message.hasOwnProperty("appYamlPath")) + object.appYamlPath = message.appYamlPath; + if (message.cloudBuildTimeout != null && message.hasOwnProperty("cloudBuildTimeout")) + object.cloudBuildTimeout = $root.google.protobuf.Duration.toObject(message.cloudBuildTimeout, options); + return object; + }; + + /** + * Converts this CloudBuildOptions to JSON. + * @function toJSON + * @memberof google.appengine.v1.CloudBuildOptions + * @instance + * @returns {Object.} JSON object + */ + CloudBuildOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudBuildOptions + * @function getTypeUrl + * @memberof google.appengine.v1.CloudBuildOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudBuildOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.CloudBuildOptions"; + }; + + return CloudBuildOptions; + })(); + + v1.ZipInfo = (function() { + + /** + * Properties of a ZipInfo. + * @memberof google.appengine.v1 + * @interface IZipInfo + * @property {string|null} [sourceUrl] ZipInfo sourceUrl + * @property {number|null} [filesCount] ZipInfo filesCount + */ + + /** + * Constructs a new ZipInfo. + * @memberof google.appengine.v1 + * @classdesc Represents a ZipInfo. + * @implements IZipInfo + * @constructor + * @param {google.appengine.v1.IZipInfo=} [properties] Properties to set + */ + function ZipInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ZipInfo sourceUrl. + * @member {string} sourceUrl + * @memberof google.appengine.v1.ZipInfo + * @instance + */ + ZipInfo.prototype.sourceUrl = ""; + + /** + * ZipInfo filesCount. + * @member {number} filesCount + * @memberof google.appengine.v1.ZipInfo + * @instance + */ + ZipInfo.prototype.filesCount = 0; + + /** + * Creates a new ZipInfo instance using the specified properties. + * @function create + * @memberof google.appengine.v1.ZipInfo + * @static + * @param {google.appengine.v1.IZipInfo=} [properties] Properties to set + * @returns {google.appengine.v1.ZipInfo} ZipInfo instance + */ + ZipInfo.create = function create(properties) { + return new ZipInfo(properties); + }; + + /** + * Encodes the specified ZipInfo message. Does not implicitly {@link google.appengine.v1.ZipInfo.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.ZipInfo + * @static + * @param {google.appengine.v1.IZipInfo} message ZipInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZipInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceUrl != null && Object.hasOwnProperty.call(message, "sourceUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceUrl); + if (message.filesCount != null && Object.hasOwnProperty.call(message, "filesCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.filesCount); + return writer; + }; + + /** + * Encodes the specified ZipInfo message, length delimited. Does not implicitly {@link google.appengine.v1.ZipInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.ZipInfo + * @static + * @param {google.appengine.v1.IZipInfo} message ZipInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZipInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZipInfo message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.ZipInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.ZipInfo} ZipInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZipInfo.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.appengine.v1.ZipInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.sourceUrl = reader.string(); + break; + } + case 4: { + message.filesCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZipInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.ZipInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.ZipInfo} ZipInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZipInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZipInfo message. + * @function verify + * @memberof google.appengine.v1.ZipInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZipInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceUrl != null && message.hasOwnProperty("sourceUrl")) + if (!$util.isString(message.sourceUrl)) + return "sourceUrl: string expected"; + if (message.filesCount != null && message.hasOwnProperty("filesCount")) + if (!$util.isInteger(message.filesCount)) + return "filesCount: integer expected"; + return null; + }; + + /** + * Creates a ZipInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.ZipInfo + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.ZipInfo} ZipInfo + */ + ZipInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.ZipInfo) + return object; + var message = new $root.google.appengine.v1.ZipInfo(); + if (object.sourceUrl != null) + message.sourceUrl = String(object.sourceUrl); + if (object.filesCount != null) + message.filesCount = object.filesCount | 0; + return message; + }; + + /** + * Creates a plain object from a ZipInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.ZipInfo + * @static + * @param {google.appengine.v1.ZipInfo} message ZipInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZipInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceUrl = ""; + object.filesCount = 0; + } + if (message.sourceUrl != null && message.hasOwnProperty("sourceUrl")) + object.sourceUrl = message.sourceUrl; + if (message.filesCount != null && message.hasOwnProperty("filesCount")) + object.filesCount = message.filesCount; + return object; + }; + + /** + * Converts this ZipInfo to JSON. + * @function toJSON + * @memberof google.appengine.v1.ZipInfo + * @instance + * @returns {Object.} JSON object + */ + ZipInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ZipInfo + * @function getTypeUrl + * @memberof google.appengine.v1.ZipInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZipInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.ZipInfo"; + }; + + return ZipInfo; + })(); + + v1.AuditData = (function() { + + /** + * Properties of an AuditData. + * @memberof google.appengine.v1 + * @interface IAuditData + * @property {google.appengine.v1.IUpdateServiceMethod|null} [updateService] AuditData updateService + * @property {google.appengine.v1.ICreateVersionMethod|null} [createVersion] AuditData createVersion + */ + + /** + * Constructs a new AuditData. + * @memberof google.appengine.v1 + * @classdesc Represents an AuditData. + * @implements IAuditData + * @constructor + * @param {google.appengine.v1.IAuditData=} [properties] Properties to set + */ + function AuditData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditData updateService. + * @member {google.appengine.v1.IUpdateServiceMethod|null|undefined} updateService + * @memberof google.appengine.v1.AuditData + * @instance + */ + AuditData.prototype.updateService = null; + + /** + * AuditData createVersion. + * @member {google.appengine.v1.ICreateVersionMethod|null|undefined} createVersion + * @memberof google.appengine.v1.AuditData + * @instance + */ + AuditData.prototype.createVersion = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AuditData method. + * @member {"updateService"|"createVersion"|undefined} method + * @memberof google.appengine.v1.AuditData + * @instance + */ + Object.defineProperty(AuditData.prototype, "method", { + get: $util.oneOfGetter($oneOfFields = ["updateService", "createVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AuditData instance using the specified properties. + * @function create + * @memberof google.appengine.v1.AuditData + * @static + * @param {google.appengine.v1.IAuditData=} [properties] Properties to set + * @returns {google.appengine.v1.AuditData} AuditData instance + */ + AuditData.create = function create(properties) { + return new AuditData(properties); + }; + + /** + * Encodes the specified AuditData message. Does not implicitly {@link google.appengine.v1.AuditData.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.AuditData + * @static + * @param {google.appengine.v1.IAuditData} message AuditData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateService != null && Object.hasOwnProperty.call(message, "updateService")) + $root.google.appengine.v1.UpdateServiceMethod.encode(message.updateService, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.createVersion != null && Object.hasOwnProperty.call(message, "createVersion")) + $root.google.appengine.v1.CreateVersionMethod.encode(message.createVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditData message, length delimited. Does not implicitly {@link google.appengine.v1.AuditData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.AuditData + * @static + * @param {google.appengine.v1.IAuditData} message AuditData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditData message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.AuditData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.AuditData} AuditData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditData.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.appengine.v1.AuditData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateService = $root.google.appengine.v1.UpdateServiceMethod.decode(reader, reader.uint32()); + break; + } + case 2: { + message.createVersion = $root.google.appengine.v1.CreateVersionMethod.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.AuditData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.AuditData} AuditData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditData message. + * @function verify + * @memberof google.appengine.v1.AuditData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.updateService != null && message.hasOwnProperty("updateService")) { + properties.method = 1; + { + var error = $root.google.appengine.v1.UpdateServiceMethod.verify(message.updateService); + if (error) + return "updateService." + error; + } + } + if (message.createVersion != null && message.hasOwnProperty("createVersion")) { + if (properties.method === 1) + return "method: multiple values"; + properties.method = 1; + { + var error = $root.google.appengine.v1.CreateVersionMethod.verify(message.createVersion); + if (error) + return "createVersion." + error; + } + } + return null; + }; + + /** + * Creates an AuditData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.AuditData + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.AuditData} AuditData + */ + AuditData.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.AuditData) + return object; + var message = new $root.google.appengine.v1.AuditData(); + if (object.updateService != null) { + if (typeof object.updateService !== "object") + throw TypeError(".google.appengine.v1.AuditData.updateService: object expected"); + message.updateService = $root.google.appengine.v1.UpdateServiceMethod.fromObject(object.updateService); + } + if (object.createVersion != null) { + if (typeof object.createVersion !== "object") + throw TypeError(".google.appengine.v1.AuditData.createVersion: object expected"); + message.createVersion = $root.google.appengine.v1.CreateVersionMethod.fromObject(object.createVersion); + } + return message; + }; + + /** + * Creates a plain object from an AuditData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.AuditData + * @static + * @param {google.appengine.v1.AuditData} message AuditData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.updateService != null && message.hasOwnProperty("updateService")) { + object.updateService = $root.google.appengine.v1.UpdateServiceMethod.toObject(message.updateService, options); + if (options.oneofs) + object.method = "updateService"; + } + if (message.createVersion != null && message.hasOwnProperty("createVersion")) { + object.createVersion = $root.google.appengine.v1.CreateVersionMethod.toObject(message.createVersion, options); + if (options.oneofs) + object.method = "createVersion"; + } + return object; + }; + + /** + * Converts this AuditData to JSON. + * @function toJSON + * @memberof google.appengine.v1.AuditData + * @instance + * @returns {Object.} JSON object + */ + AuditData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditData + * @function getTypeUrl + * @memberof google.appengine.v1.AuditData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.AuditData"; + }; + + return AuditData; + })(); + + v1.UpdateServiceMethod = (function() { + + /** + * Properties of an UpdateServiceMethod. + * @memberof google.appengine.v1 + * @interface IUpdateServiceMethod + * @property {google.appengine.v1.IUpdateServiceRequest|null} [request] UpdateServiceMethod request + */ + + /** + * Constructs a new UpdateServiceMethod. + * @memberof google.appengine.v1 + * @classdesc Represents an UpdateServiceMethod. + * @implements IUpdateServiceMethod + * @constructor + * @param {google.appengine.v1.IUpdateServiceMethod=} [properties] Properties to set + */ + function UpdateServiceMethod(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateServiceMethod request. + * @member {google.appengine.v1.IUpdateServiceRequest|null|undefined} request + * @memberof google.appengine.v1.UpdateServiceMethod + * @instance + */ + UpdateServiceMethod.prototype.request = null; + + /** + * Creates a new UpdateServiceMethod instance using the specified properties. + * @function create + * @memberof google.appengine.v1.UpdateServiceMethod + * @static + * @param {google.appengine.v1.IUpdateServiceMethod=} [properties] Properties to set + * @returns {google.appengine.v1.UpdateServiceMethod} UpdateServiceMethod instance + */ + UpdateServiceMethod.create = function create(properties) { + return new UpdateServiceMethod(properties); + }; + + /** + * Encodes the specified UpdateServiceMethod message. Does not implicitly {@link google.appengine.v1.UpdateServiceMethod.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.UpdateServiceMethod + * @static + * @param {google.appengine.v1.IUpdateServiceMethod} message UpdateServiceMethod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServiceMethod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.appengine.v1.UpdateServiceRequest.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateServiceMethod message, length delimited. Does not implicitly {@link google.appengine.v1.UpdateServiceMethod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.UpdateServiceMethod + * @static + * @param {google.appengine.v1.IUpdateServiceMethod} message UpdateServiceMethod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServiceMethod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateServiceMethod message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.UpdateServiceMethod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.UpdateServiceMethod} UpdateServiceMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServiceMethod.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.appengine.v1.UpdateServiceMethod(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.request = $root.google.appengine.v1.UpdateServiceRequest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateServiceMethod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.UpdateServiceMethod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.UpdateServiceMethod} UpdateServiceMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServiceMethod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateServiceMethod message. + * @function verify + * @memberof google.appengine.v1.UpdateServiceMethod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateServiceMethod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.appengine.v1.UpdateServiceRequest.verify(message.request); + if (error) + return "request." + error; + } + return null; + }; + + /** + * Creates an UpdateServiceMethod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.UpdateServiceMethod + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.UpdateServiceMethod} UpdateServiceMethod + */ + UpdateServiceMethod.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.UpdateServiceMethod) + return object; + var message = new $root.google.appengine.v1.UpdateServiceMethod(); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.appengine.v1.UpdateServiceMethod.request: object expected"); + message.request = $root.google.appengine.v1.UpdateServiceRequest.fromObject(object.request); + } + return message; + }; + + /** + * Creates a plain object from an UpdateServiceMethod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.UpdateServiceMethod + * @static + * @param {google.appengine.v1.UpdateServiceMethod} message UpdateServiceMethod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateServiceMethod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.request = null; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.appengine.v1.UpdateServiceRequest.toObject(message.request, options); + return object; + }; + + /** + * Converts this UpdateServiceMethod to JSON. + * @function toJSON + * @memberof google.appengine.v1.UpdateServiceMethod + * @instance + * @returns {Object.} JSON object + */ + UpdateServiceMethod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateServiceMethod + * @function getTypeUrl + * @memberof google.appengine.v1.UpdateServiceMethod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateServiceMethod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.UpdateServiceMethod"; + }; + + return UpdateServiceMethod; + })(); + + v1.CreateVersionMethod = (function() { + + /** + * Properties of a CreateVersionMethod. + * @memberof google.appengine.v1 + * @interface ICreateVersionMethod + * @property {google.appengine.v1.ICreateVersionRequest|null} [request] CreateVersionMethod request + */ + + /** + * Constructs a new CreateVersionMethod. + * @memberof google.appengine.v1 + * @classdesc Represents a CreateVersionMethod. + * @implements ICreateVersionMethod + * @constructor + * @param {google.appengine.v1.ICreateVersionMethod=} [properties] Properties to set + */ + function CreateVersionMethod(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateVersionMethod request. + * @member {google.appengine.v1.ICreateVersionRequest|null|undefined} request + * @memberof google.appengine.v1.CreateVersionMethod + * @instance + */ + CreateVersionMethod.prototype.request = null; + + /** + * Creates a new CreateVersionMethod instance using the specified properties. + * @function create + * @memberof google.appengine.v1.CreateVersionMethod + * @static + * @param {google.appengine.v1.ICreateVersionMethod=} [properties] Properties to set + * @returns {google.appengine.v1.CreateVersionMethod} CreateVersionMethod instance + */ + CreateVersionMethod.create = function create(properties) { + return new CreateVersionMethod(properties); + }; + + /** + * Encodes the specified CreateVersionMethod message. Does not implicitly {@link google.appengine.v1.CreateVersionMethod.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.CreateVersionMethod + * @static + * @param {google.appengine.v1.ICreateVersionMethod} message CreateVersionMethod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionMethod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.appengine.v1.CreateVersionRequest.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateVersionMethod message, length delimited. Does not implicitly {@link google.appengine.v1.CreateVersionMethod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.CreateVersionMethod + * @static + * @param {google.appengine.v1.ICreateVersionMethod} message CreateVersionMethod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionMethod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateVersionMethod message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.CreateVersionMethod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.CreateVersionMethod} CreateVersionMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionMethod.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.appengine.v1.CreateVersionMethod(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.request = $root.google.appengine.v1.CreateVersionRequest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateVersionMethod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.CreateVersionMethod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.CreateVersionMethod} CreateVersionMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionMethod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateVersionMethod message. + * @function verify + * @memberof google.appengine.v1.CreateVersionMethod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateVersionMethod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.appengine.v1.CreateVersionRequest.verify(message.request); + if (error) + return "request." + error; + } + return null; + }; + + /** + * Creates a CreateVersionMethod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.CreateVersionMethod + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.CreateVersionMethod} CreateVersionMethod + */ + CreateVersionMethod.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.CreateVersionMethod) + return object; + var message = new $root.google.appengine.v1.CreateVersionMethod(); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.appengine.v1.CreateVersionMethod.request: object expected"); + message.request = $root.google.appengine.v1.CreateVersionRequest.fromObject(object.request); + } + return message; + }; + + /** + * Creates a plain object from a CreateVersionMethod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.CreateVersionMethod + * @static + * @param {google.appengine.v1.CreateVersionMethod} message CreateVersionMethod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateVersionMethod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.request = null; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.appengine.v1.CreateVersionRequest.toObject(message.request, options); + return object; + }; + + /** + * Converts this CreateVersionMethod to JSON. + * @function toJSON + * @memberof google.appengine.v1.CreateVersionMethod + * @instance + * @returns {Object.} JSON object + */ + CreateVersionMethod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateVersionMethod + * @function getTypeUrl + * @memberof google.appengine.v1.CreateVersionMethod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateVersionMethod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.CreateVersionMethod"; + }; + + return CreateVersionMethod; + })(); + + v1.LocationMetadata = (function() { + + /** + * Properties of a LocationMetadata. + * @memberof google.appengine.v1 + * @interface ILocationMetadata + * @property {boolean|null} [standardEnvironmentAvailable] LocationMetadata standardEnvironmentAvailable + * @property {boolean|null} [flexibleEnvironmentAvailable] LocationMetadata flexibleEnvironmentAvailable + * @property {boolean|null} [searchApiAvailable] LocationMetadata searchApiAvailable + */ + + /** + * Constructs a new LocationMetadata. + * @memberof google.appengine.v1 + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.appengine.v1.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationMetadata standardEnvironmentAvailable. + * @member {boolean} standardEnvironmentAvailable + * @memberof google.appengine.v1.LocationMetadata + * @instance + */ + LocationMetadata.prototype.standardEnvironmentAvailable = false; + + /** + * LocationMetadata flexibleEnvironmentAvailable. + * @member {boolean} flexibleEnvironmentAvailable + * @memberof google.appengine.v1.LocationMetadata + * @instance + */ + LocationMetadata.prototype.flexibleEnvironmentAvailable = false; + + /** + * LocationMetadata searchApiAvailable. + * @member {boolean} searchApiAvailable + * @memberof google.appengine.v1.LocationMetadata + * @instance + */ + LocationMetadata.prototype.searchApiAvailable = false; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.appengine.v1.LocationMetadata + * @static + * @param {google.appengine.v1.ILocationMetadata=} [properties] Properties to set + * @returns {google.appengine.v1.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.appengine.v1.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.LocationMetadata + * @static + * @param {google.appengine.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.standardEnvironmentAvailable != null && Object.hasOwnProperty.call(message, "standardEnvironmentAvailable")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.standardEnvironmentAvailable); + if (message.flexibleEnvironmentAvailable != null && Object.hasOwnProperty.call(message, "flexibleEnvironmentAvailable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.flexibleEnvironmentAvailable); + if (message.searchApiAvailable != null && Object.hasOwnProperty.call(message, "searchApiAvailable")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.searchApiAvailable); + return writer; + }; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.appengine.v1.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.LocationMetadata + * @static + * @param {google.appengine.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.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.appengine.v1.LocationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.standardEnvironmentAvailable = reader.bool(); + break; + } + case 4: { + message.flexibleEnvironmentAvailable = reader.bool(); + break; + } + case 6: { + message.searchApiAvailable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.appengine.v1.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.standardEnvironmentAvailable != null && message.hasOwnProperty("standardEnvironmentAvailable")) + if (typeof message.standardEnvironmentAvailable !== "boolean") + return "standardEnvironmentAvailable: boolean expected"; + if (message.flexibleEnvironmentAvailable != null && message.hasOwnProperty("flexibleEnvironmentAvailable")) + if (typeof message.flexibleEnvironmentAvailable !== "boolean") + return "flexibleEnvironmentAvailable: boolean expected"; + if (message.searchApiAvailable != null && message.hasOwnProperty("searchApiAvailable")) + if (typeof message.searchApiAvailable !== "boolean") + return "searchApiAvailable: boolean expected"; + return null; + }; + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.LocationMetadata) + return object; + var message = new $root.google.appengine.v1.LocationMetadata(); + if (object.standardEnvironmentAvailable != null) + message.standardEnvironmentAvailable = Boolean(object.standardEnvironmentAvailable); + if (object.flexibleEnvironmentAvailable != null) + message.flexibleEnvironmentAvailable = Boolean(object.flexibleEnvironmentAvailable); + if (object.searchApiAvailable != null) + message.searchApiAvailable = Boolean(object.searchApiAvailable); + return message; + }; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.LocationMetadata + * @static + * @param {google.appengine.v1.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.standardEnvironmentAvailable = false; + object.flexibleEnvironmentAvailable = false; + object.searchApiAvailable = false; + } + if (message.standardEnvironmentAvailable != null && message.hasOwnProperty("standardEnvironmentAvailable")) + object.standardEnvironmentAvailable = message.standardEnvironmentAvailable; + if (message.flexibleEnvironmentAvailable != null && message.hasOwnProperty("flexibleEnvironmentAvailable")) + object.flexibleEnvironmentAvailable = message.flexibleEnvironmentAvailable; + if (message.searchApiAvailable != null && message.hasOwnProperty("searchApiAvailable")) + object.searchApiAvailable = message.searchApiAvailable; + return object; + }; + + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.appengine.v1.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationMetadata + * @function getTypeUrl + * @memberof google.appengine.v1.LocationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.LocationMetadata"; + }; + + return LocationMetadata; + })(); + + v1.OperationMetadataV1 = (function() { + + /** + * Properties of an OperationMetadataV1. + * @memberof google.appengine.v1 + * @interface IOperationMetadataV1 + * @property {string|null} [method] OperationMetadataV1 method + * @property {google.protobuf.ITimestamp|null} [insertTime] OperationMetadataV1 insertTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadataV1 endTime + * @property {string|null} [user] OperationMetadataV1 user + * @property {string|null} [target] OperationMetadataV1 target + * @property {string|null} [ephemeralMessage] OperationMetadataV1 ephemeralMessage + * @property {Array.|null} [warning] OperationMetadataV1 warning + * @property {google.appengine.v1.ICreateVersionMetadataV1|null} [createVersionMetadata] OperationMetadataV1 createVersionMetadata + */ + + /** + * Constructs a new OperationMetadataV1. + * @memberof google.appengine.v1 + * @classdesc Represents an OperationMetadataV1. + * @implements IOperationMetadataV1 + * @constructor + * @param {google.appengine.v1.IOperationMetadataV1=} [properties] Properties to set + */ + function OperationMetadataV1(properties) { + this.warning = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadataV1 method. + * @member {string} method + * @memberof google.appengine.v1.OperationMetadataV1 + * @instance + */ + OperationMetadataV1.prototype.method = ""; + + /** + * OperationMetadataV1 insertTime. + * @member {google.protobuf.ITimestamp|null|undefined} insertTime + * @memberof google.appengine.v1.OperationMetadataV1 + * @instance + */ + OperationMetadataV1.prototype.insertTime = null; + + /** + * OperationMetadataV1 endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.appengine.v1.OperationMetadataV1 + * @instance + */ + OperationMetadataV1.prototype.endTime = null; + + /** + * OperationMetadataV1 user. + * @member {string} user + * @memberof google.appengine.v1.OperationMetadataV1 + * @instance + */ + OperationMetadataV1.prototype.user = ""; + + /** + * OperationMetadataV1 target. + * @member {string} target + * @memberof google.appengine.v1.OperationMetadataV1 + * @instance + */ + OperationMetadataV1.prototype.target = ""; + + /** + * OperationMetadataV1 ephemeralMessage. + * @member {string} ephemeralMessage + * @memberof google.appengine.v1.OperationMetadataV1 + * @instance + */ + OperationMetadataV1.prototype.ephemeralMessage = ""; + + /** + * OperationMetadataV1 warning. + * @member {Array.} warning + * @memberof google.appengine.v1.OperationMetadataV1 + * @instance + */ + OperationMetadataV1.prototype.warning = $util.emptyArray; + + /** + * OperationMetadataV1 createVersionMetadata. + * @member {google.appengine.v1.ICreateVersionMetadataV1|null|undefined} createVersionMetadata + * @memberof google.appengine.v1.OperationMetadataV1 + * @instance + */ + OperationMetadataV1.prototype.createVersionMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadataV1 methodMetadata. + * @member {"createVersionMetadata"|undefined} methodMetadata + * @memberof google.appengine.v1.OperationMetadataV1 + * @instance + */ + Object.defineProperty(OperationMetadataV1.prototype, "methodMetadata", { + get: $util.oneOfGetter($oneOfFields = ["createVersionMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadataV1 instance using the specified properties. + * @function create + * @memberof google.appengine.v1.OperationMetadataV1 + * @static + * @param {google.appengine.v1.IOperationMetadataV1=} [properties] Properties to set + * @returns {google.appengine.v1.OperationMetadataV1} OperationMetadataV1 instance + */ + OperationMetadataV1.create = function create(properties) { + return new OperationMetadataV1(properties); + }; + + /** + * Encodes the specified OperationMetadataV1 message. Does not implicitly {@link google.appengine.v1.OperationMetadataV1.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.OperationMetadataV1 + * @static + * @param {google.appengine.v1.IOperationMetadataV1} message OperationMetadataV1 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadataV1.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.method); + if (message.insertTime != null && Object.hasOwnProperty.call(message, "insertTime")) + $root.google.protobuf.Timestamp.encode(message.insertTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.user); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.target); + if (message.ephemeralMessage != null && Object.hasOwnProperty.call(message, "ephemeralMessage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.ephemeralMessage); + if (message.warning != null && message.warning.length) + for (var i = 0; i < message.warning.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.warning[i]); + if (message.createVersionMetadata != null && Object.hasOwnProperty.call(message, "createVersionMetadata")) + $root.google.appengine.v1.CreateVersionMetadataV1.encode(message.createVersionMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadataV1 message, length delimited. Does not implicitly {@link google.appengine.v1.OperationMetadataV1.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.OperationMetadataV1 + * @static + * @param {google.appengine.v1.IOperationMetadataV1} message OperationMetadataV1 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadataV1.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadataV1 message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.OperationMetadataV1 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.OperationMetadataV1} OperationMetadataV1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadataV1.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.appengine.v1.OperationMetadataV1(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.method = reader.string(); + break; + } + case 2: { + message.insertTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.user = reader.string(); + break; + } + case 5: { + message.target = reader.string(); + break; + } + case 6: { + message.ephemeralMessage = reader.string(); + break; + } + case 7: { + if (!(message.warning && message.warning.length)) + message.warning = []; + message.warning.push(reader.string()); + break; + } + case 8: { + message.createVersionMetadata = $root.google.appengine.v1.CreateVersionMetadataV1.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadataV1 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.OperationMetadataV1 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.OperationMetadataV1} OperationMetadataV1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadataV1.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadataV1 message. + * @function verify + * @memberof google.appengine.v1.OperationMetadataV1 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadataV1.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.method != null && message.hasOwnProperty("method")) + if (!$util.isString(message.method)) + return "method: string expected"; + if (message.insertTime != null && message.hasOwnProperty("insertTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.insertTime); + if (error) + return "insertTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.ephemeralMessage != null && message.hasOwnProperty("ephemeralMessage")) + if (!$util.isString(message.ephemeralMessage)) + return "ephemeralMessage: string expected"; + if (message.warning != null && message.hasOwnProperty("warning")) { + if (!Array.isArray(message.warning)) + return "warning: array expected"; + for (var i = 0; i < message.warning.length; ++i) + if (!$util.isString(message.warning[i])) + return "warning: string[] expected"; + } + if (message.createVersionMetadata != null && message.hasOwnProperty("createVersionMetadata")) { + properties.methodMetadata = 1; + { + var error = $root.google.appengine.v1.CreateVersionMetadataV1.verify(message.createVersionMetadata); + if (error) + return "createVersionMetadata." + error; + } + } + return null; + }; + + /** + * Creates an OperationMetadataV1 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.OperationMetadataV1 + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.OperationMetadataV1} OperationMetadataV1 + */ + OperationMetadataV1.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.OperationMetadataV1) + return object; + var message = new $root.google.appengine.v1.OperationMetadataV1(); + if (object.method != null) + message.method = String(object.method); + if (object.insertTime != null) { + if (typeof object.insertTime !== "object") + throw TypeError(".google.appengine.v1.OperationMetadataV1.insertTime: object expected"); + message.insertTime = $root.google.protobuf.Timestamp.fromObject(object.insertTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.appengine.v1.OperationMetadataV1.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.user != null) + message.user = String(object.user); + if (object.target != null) + message.target = String(object.target); + if (object.ephemeralMessage != null) + message.ephemeralMessage = String(object.ephemeralMessage); + if (object.warning) { + if (!Array.isArray(object.warning)) + throw TypeError(".google.appengine.v1.OperationMetadataV1.warning: array expected"); + message.warning = []; + for (var i = 0; i < object.warning.length; ++i) + message.warning[i] = String(object.warning[i]); + } + if (object.createVersionMetadata != null) { + if (typeof object.createVersionMetadata !== "object") + throw TypeError(".google.appengine.v1.OperationMetadataV1.createVersionMetadata: object expected"); + message.createVersionMetadata = $root.google.appengine.v1.CreateVersionMetadataV1.fromObject(object.createVersionMetadata); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadataV1 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.OperationMetadataV1 + * @static + * @param {google.appengine.v1.OperationMetadataV1} message OperationMetadataV1 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadataV1.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.warning = []; + if (options.defaults) { + object.method = ""; + object.insertTime = null; + object.endTime = null; + object.user = ""; + object.target = ""; + object.ephemeralMessage = ""; + } + if (message.method != null && message.hasOwnProperty("method")) + object.method = message.method; + if (message.insertTime != null && message.hasOwnProperty("insertTime")) + object.insertTime = $root.google.protobuf.Timestamp.toObject(message.insertTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.ephemeralMessage != null && message.hasOwnProperty("ephemeralMessage")) + object.ephemeralMessage = message.ephemeralMessage; + if (message.warning && message.warning.length) { + object.warning = []; + for (var j = 0; j < message.warning.length; ++j) + object.warning[j] = message.warning[j]; + } + if (message.createVersionMetadata != null && message.hasOwnProperty("createVersionMetadata")) { + object.createVersionMetadata = $root.google.appengine.v1.CreateVersionMetadataV1.toObject(message.createVersionMetadata, options); + if (options.oneofs) + object.methodMetadata = "createVersionMetadata"; + } + return object; + }; + + /** + * Converts this OperationMetadataV1 to JSON. + * @function toJSON + * @memberof google.appengine.v1.OperationMetadataV1 + * @instance + * @returns {Object.} JSON object + */ + OperationMetadataV1.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadataV1 + * @function getTypeUrl + * @memberof google.appengine.v1.OperationMetadataV1 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadataV1.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.OperationMetadataV1"; + }; + + return OperationMetadataV1; + })(); + + v1.CreateVersionMetadataV1 = (function() { + + /** + * Properties of a CreateVersionMetadataV1. + * @memberof google.appengine.v1 + * @interface ICreateVersionMetadataV1 + * @property {string|null} [cloudBuildId] CreateVersionMetadataV1 cloudBuildId + */ + + /** + * Constructs a new CreateVersionMetadataV1. + * @memberof google.appengine.v1 + * @classdesc Represents a CreateVersionMetadataV1. + * @implements ICreateVersionMetadataV1 + * @constructor + * @param {google.appengine.v1.ICreateVersionMetadataV1=} [properties] Properties to set + */ + function CreateVersionMetadataV1(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateVersionMetadataV1 cloudBuildId. + * @member {string} cloudBuildId + * @memberof google.appengine.v1.CreateVersionMetadataV1 + * @instance + */ + CreateVersionMetadataV1.prototype.cloudBuildId = ""; + + /** + * Creates a new CreateVersionMetadataV1 instance using the specified properties. + * @function create + * @memberof google.appengine.v1.CreateVersionMetadataV1 + * @static + * @param {google.appengine.v1.ICreateVersionMetadataV1=} [properties] Properties to set + * @returns {google.appengine.v1.CreateVersionMetadataV1} CreateVersionMetadataV1 instance + */ + CreateVersionMetadataV1.create = function create(properties) { + return new CreateVersionMetadataV1(properties); + }; + + /** + * Encodes the specified CreateVersionMetadataV1 message. Does not implicitly {@link google.appengine.v1.CreateVersionMetadataV1.verify|verify} messages. + * @function encode + * @memberof google.appengine.v1.CreateVersionMetadataV1 + * @static + * @param {google.appengine.v1.ICreateVersionMetadataV1} message CreateVersionMetadataV1 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionMetadataV1.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudBuildId != null && Object.hasOwnProperty.call(message, "cloudBuildId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudBuildId); + return writer; + }; + + /** + * Encodes the specified CreateVersionMetadataV1 message, length delimited. Does not implicitly {@link google.appengine.v1.CreateVersionMetadataV1.verify|verify} messages. + * @function encodeDelimited + * @memberof google.appengine.v1.CreateVersionMetadataV1 + * @static + * @param {google.appengine.v1.ICreateVersionMetadataV1} message CreateVersionMetadataV1 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionMetadataV1.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateVersionMetadataV1 message from the specified reader or buffer. + * @function decode + * @memberof google.appengine.v1.CreateVersionMetadataV1 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.appengine.v1.CreateVersionMetadataV1} CreateVersionMetadataV1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionMetadataV1.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.appengine.v1.CreateVersionMetadataV1(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cloudBuildId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateVersionMetadataV1 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.appengine.v1.CreateVersionMetadataV1 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.appengine.v1.CreateVersionMetadataV1} CreateVersionMetadataV1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionMetadataV1.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateVersionMetadataV1 message. + * @function verify + * @memberof google.appengine.v1.CreateVersionMetadataV1 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateVersionMetadataV1.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudBuildId != null && message.hasOwnProperty("cloudBuildId")) + if (!$util.isString(message.cloudBuildId)) + return "cloudBuildId: string expected"; + return null; + }; + + /** + * Creates a CreateVersionMetadataV1 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.appengine.v1.CreateVersionMetadataV1 + * @static + * @param {Object.} object Plain object + * @returns {google.appengine.v1.CreateVersionMetadataV1} CreateVersionMetadataV1 + */ + CreateVersionMetadataV1.fromObject = function fromObject(object) { + if (object instanceof $root.google.appengine.v1.CreateVersionMetadataV1) + return object; + var message = new $root.google.appengine.v1.CreateVersionMetadataV1(); + if (object.cloudBuildId != null) + message.cloudBuildId = String(object.cloudBuildId); + return message; + }; + + /** + * Creates a plain object from a CreateVersionMetadataV1 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.appengine.v1.CreateVersionMetadataV1 + * @static + * @param {google.appengine.v1.CreateVersionMetadataV1} message CreateVersionMetadataV1 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateVersionMetadataV1.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cloudBuildId = ""; + if (message.cloudBuildId != null && message.hasOwnProperty("cloudBuildId")) + object.cloudBuildId = message.cloudBuildId; + return object; + }; + + /** + * Converts this CreateVersionMetadataV1 to JSON. + * @function toJSON + * @memberof google.appengine.v1.CreateVersionMetadataV1 + * @instance + * @returns {Object.} JSON object + */ + CreateVersionMetadataV1.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateVersionMetadataV1 + * @function getTypeUrl + * @memberof google.appengine.v1.CreateVersionMetadataV1 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateVersionMetadataV1.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.appengine.v1.CreateVersionMetadataV1"; + }; + + return CreateVersionMetadataV1; + })(); + + return v1; + })(); + + return appengine; + })(); + + 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) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-appengine/protos/protos.json b/packages/google-appengine/protos/protos.json new file mode 100644 index 00000000000..3e06cb6d4e5 --- /dev/null +++ b/packages/google-appengine/protos/protos.json @@ -0,0 +1,4185 @@ +{ + "nested": { + "google": { + "nested": { + "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": { + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "appengine": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.AppEngine.V1", + "go_package": "google.golang.org/genproto/googleapis/appengine/v1;appengine", + "java_multiple_files": true, + "java_outer_classname": "OperationProto", + "java_package": "com.google.appengine.v1", + "php_namespace": "Google\\Cloud\\AppEngine\\V1", + "ruby_package": "Google::Cloud::AppEngine::V1" + }, + "nested": { + "ApiConfigHandler": { + "fields": { + "authFailAction": { + "type": "AuthFailAction", + "id": 1 + }, + "login": { + "type": "LoginRequirement", + "id": 2 + }, + "script": { + "type": "string", + "id": 3 + }, + "securityLevel": { + "type": "SecurityLevel", + "id": 4 + }, + "url": { + "type": "string", + "id": 5 + } + } + }, + "ErrorHandler": { + "fields": { + "errorCode": { + "type": "ErrorCode", + "id": 1 + }, + "staticFile": { + "type": "string", + "id": 2 + }, + "mimeType": { + "type": "string", + "id": 3 + } + }, + "nested": { + "ErrorCode": { + "options": { + "allow_alias": true + }, + "values": { + "ERROR_CODE_UNSPECIFIED": 0, + "ERROR_CODE_DEFAULT": 0, + "ERROR_CODE_OVER_QUOTA": 1, + "ERROR_CODE_DOS_API_DENIAL": 2, + "ERROR_CODE_TIMEOUT": 3 + } + } + } + }, + "UrlMap": { + "oneofs": { + "handlerType": { + "oneof": [ + "staticFiles", + "script", + "apiEndpoint" + ] + } + }, + "fields": { + "urlRegex": { + "type": "string", + "id": 1 + }, + "staticFiles": { + "type": "StaticFilesHandler", + "id": 2 + }, + "script": { + "type": "ScriptHandler", + "id": 3 + }, + "apiEndpoint": { + "type": "ApiEndpointHandler", + "id": 4 + }, + "securityLevel": { + "type": "SecurityLevel", + "id": 5 + }, + "login": { + "type": "LoginRequirement", + "id": 6 + }, + "authFailAction": { + "type": "AuthFailAction", + "id": 7 + }, + "redirectHttpResponseCode": { + "type": "RedirectHttpResponseCode", + "id": 8 + } + }, + "nested": { + "RedirectHttpResponseCode": { + "values": { + "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED": 0, + "REDIRECT_HTTP_RESPONSE_CODE_301": 1, + "REDIRECT_HTTP_RESPONSE_CODE_302": 2, + "REDIRECT_HTTP_RESPONSE_CODE_303": 3, + "REDIRECT_HTTP_RESPONSE_CODE_307": 4 + } + } + } + }, + "StaticFilesHandler": { + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "uploadPathRegex": { + "type": "string", + "id": 2 + }, + "httpHeaders": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "mimeType": { + "type": "string", + "id": 4 + }, + "expiration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "requireMatchingFile": { + "type": "bool", + "id": 6 + }, + "applicationReadable": { + "type": "bool", + "id": 7 + } + } + }, + "ScriptHandler": { + "fields": { + "scriptPath": { + "type": "string", + "id": 1 + } + } + }, + "ApiEndpointHandler": { + "fields": { + "scriptPath": { + "type": "string", + "id": 1 + } + } + }, + "HealthCheck": { + "fields": { + "disableHealthCheck": { + "type": "bool", + "id": 1 + }, + "host": { + "type": "string", + "id": 2 + }, + "healthyThreshold": { + "type": "uint32", + "id": 3 + }, + "unhealthyThreshold": { + "type": "uint32", + "id": 4 + }, + "restartThreshold": { + "type": "uint32", + "id": 5 + }, + "checkInterval": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 7 + } + } + }, + "ReadinessCheck": { + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "host": { + "type": "string", + "id": 2 + }, + "failureThreshold": { + "type": "uint32", + "id": 3 + }, + "successThreshold": { + "type": "uint32", + "id": 4 + }, + "checkInterval": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "appStartTimeout": { + "type": "google.protobuf.Duration", + "id": 7 + } + } + }, + "LivenessCheck": { + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "host": { + "type": "string", + "id": 2 + }, + "failureThreshold": { + "type": "uint32", + "id": 3 + }, + "successThreshold": { + "type": "uint32", + "id": 4 + }, + "checkInterval": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "initialDelay": { + "type": "google.protobuf.Duration", + "id": 7 + } + } + }, + "Library": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + } + } + }, + "AuthFailAction": { + "values": { + "AUTH_FAIL_ACTION_UNSPECIFIED": 0, + "AUTH_FAIL_ACTION_REDIRECT": 1, + "AUTH_FAIL_ACTION_UNAUTHORIZED": 2 + } + }, + "LoginRequirement": { + "values": { + "LOGIN_UNSPECIFIED": 0, + "LOGIN_OPTIONAL": 1, + "LOGIN_ADMIN": 2, + "LOGIN_REQUIRED": 3 + } + }, + "SecurityLevel": { + "options": { + "allow_alias": true + }, + "values": { + "SECURE_UNSPECIFIED": 0, + "SECURE_DEFAULT": 0, + "SECURE_NEVER": 1, + "SECURE_OPTIONAL": 2, + "SECURE_ALWAYS": 3 + } + }, + "Applications": { + "options": { + "(google.api.default_host)": "appengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/appengine.admin,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "GetApplication": { + "requestType": "GetApplicationRequest", + "responseType": "Application", + "options": { + "(google.api.http).get": "/v1/{name=apps/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=apps/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApplication": { + "requestType": "CreateApplicationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/apps", + "(google.api.http).body": "application", + "(google.longrunning.operation_info).response_type": "Application", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/apps", + "body": "application" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Application", + "metadata_type": "OperationMetadataV1" + } + } + ] + }, + "UpdateApplication": { + "requestType": "UpdateApplicationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{name=apps/*}", + "(google.api.http).body": "application", + "(google.longrunning.operation_info).response_type": "Application", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=apps/*}", + "body": "application" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Application", + "metadata_type": "OperationMetadataV1" + } + } + ] + }, + "RepairApplication": { + "requestType": "RepairApplicationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=apps/*}:repair", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Application", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=apps/*}:repair", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Application", + "metadata_type": "OperationMetadataV1" + } + } + ] + } + } + }, + "GetApplicationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "CreateApplicationRequest": { + "fields": { + "application": { + "type": "Application", + "id": 2 + } + } + }, + "UpdateApplicationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "application": { + "type": "Application", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "RepairApplicationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "Services": { + "options": { + "(google.api.default_host)": "appengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/appengine.admin,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ListServices": { + "requestType": "ListServicesRequest", + "responseType": "ListServicesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=apps/*}/services" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=apps/*}/services" + } + } + ] + }, + "GetService": { + "requestType": "GetServiceRequest", + "responseType": "Service", + "options": { + "(google.api.http).get": "/v1/{name=apps/*/services/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=apps/*/services/*}" + } + } + ] + }, + "UpdateService": { + "requestType": "UpdateServiceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{name=apps/*/services/*}", + "(google.api.http).body": "service", + "(google.longrunning.operation_info).response_type": "Service", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=apps/*/services/*}", + "body": "service" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Service", + "metadata_type": "OperationMetadataV1" + } + } + ] + }, + "DeleteService": { + "requestType": "DeleteServiceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=apps/*/services/*}", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=apps/*/services/*}" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadataV1" + } + } + ] + } + } + }, + "ListServicesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListServicesResponse": { + "fields": { + "services": { + "rule": "repeated", + "type": "Service", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetServiceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "UpdateServiceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "service": { + "type": "Service", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + }, + "migrateTraffic": { + "type": "bool", + "id": 4 + } + } + }, + "DeleteServiceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "Versions": { + "options": { + "(google.api.default_host)": "appengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/appengine.admin,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ListVersions": { + "requestType": "ListVersionsRequest", + "responseType": "ListVersionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=apps/*/services/*}/versions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=apps/*/services/*}/versions" + } + } + ] + }, + "GetVersion": { + "requestType": "GetVersionRequest", + "responseType": "Version", + "options": { + "(google.api.http).get": "/v1/{name=apps/*/services/*/versions/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=apps/*/services/*/versions/*}" + } + } + ] + }, + "CreateVersion": { + "requestType": "CreateVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=apps/*/services/*}/versions", + "(google.api.http).body": "version", + "(google.longrunning.operation_info).response_type": "Version", + "(google.longrunning.operation_info).metadata_type": "CreateVersionMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=apps/*/services/*}/versions", + "body": "version" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Version", + "metadata_type": "CreateVersionMetadataV1" + } + } + ] + }, + "UpdateVersion": { + "requestType": "UpdateVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{name=apps/*/services/*/versions/*}", + "(google.api.http).body": "version", + "(google.longrunning.operation_info).response_type": "Version", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=apps/*/services/*/versions/*}", + "body": "version" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Version", + "metadata_type": "OperationMetadataV1" + } + } + ] + }, + "DeleteVersion": { + "requestType": "DeleteVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=apps/*/services/*/versions/*}", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=apps/*/services/*/versions/*}" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadataV1" + } + } + ] + } + } + }, + "ListVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "view": { + "type": "VersionView", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListVersionsResponse": { + "fields": { + "versions": { + "rule": "repeated", + "type": "Version", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "VersionView": { + "values": { + "BASIC": 0, + "FULL": 1 + } + }, + "GetVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "view": { + "type": "VersionView", + "id": 2 + } + } + }, + "CreateVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "version": { + "type": "Version", + "id": 2 + } + } + }, + "UpdateVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "version": { + "type": "Version", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeleteVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "Instances": { + "options": { + "(google.api.default_host)": "appengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/appengine.admin,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=apps/*/services/*/versions/*}/instances" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=apps/*/services/*/versions/*}/instances" + } + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1/{name=apps/*/services/*/versions/*/instances/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=apps/*/services/*/versions/*/instances/*}" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=apps/*/services/*/versions/*/instances/*}", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=apps/*/services/*/versions/*/instances/*}" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadataV1" + } + } + ] + }, + "DebugInstance": { + "requestType": "DebugInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=apps/*/services/*/versions/*/instances/*}:debug", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=apps/*/services/*/versions/*/instances/*}:debug", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadataV1" + } + } + ] + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DebugInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "sshKey": { + "type": "string", + "id": 2 + } + } + }, + "Firewall": { + "options": { + "(google.api.default_host)": "appengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/appengine.admin,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ListIngressRules": { + "requestType": "ListIngressRulesRequest", + "responseType": "ListIngressRulesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=apps/*}/firewall/ingressRules" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=apps/*}/firewall/ingressRules" + } + } + ] + }, + "BatchUpdateIngressRules": { + "requestType": "BatchUpdateIngressRulesRequest", + "responseType": "BatchUpdateIngressRulesResponse", + "options": { + "(google.api.http).post": "/v1/{name=apps/*/firewall/ingressRules}:batchUpdate", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=apps/*/firewall/ingressRules}:batchUpdate", + "body": "*" + } + } + ] + }, + "CreateIngressRule": { + "requestType": "CreateIngressRuleRequest", + "responseType": "google.appengine.v1.FirewallRule", + "options": { + "(google.api.http).post": "/v1/{parent=apps/*}/firewall/ingressRules", + "(google.api.http).body": "rule" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=apps/*}/firewall/ingressRules", + "body": "rule" + } + } + ] + }, + "GetIngressRule": { + "requestType": "GetIngressRuleRequest", + "responseType": "google.appengine.v1.FirewallRule", + "options": { + "(google.api.http).get": "/v1/{name=apps/*/firewall/ingressRules/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=apps/*/firewall/ingressRules/*}" + } + } + ] + }, + "UpdateIngressRule": { + "requestType": "UpdateIngressRuleRequest", + "responseType": "google.appengine.v1.FirewallRule", + "options": { + "(google.api.http).patch": "/v1/{name=apps/*/firewall/ingressRules/*}", + "(google.api.http).body": "rule" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=apps/*/firewall/ingressRules/*}", + "body": "rule" + } + } + ] + }, + "DeleteIngressRule": { + "requestType": "DeleteIngressRuleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=apps/*/firewall/ingressRules/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=apps/*/firewall/ingressRules/*}" + } + } + ] + } + } + }, + "ListIngressRulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "matchingAddress": { + "type": "string", + "id": 4 + } + } + }, + "ListIngressRulesResponse": { + "fields": { + "ingressRules": { + "rule": "repeated", + "type": "google.appengine.v1.FirewallRule", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "BatchUpdateIngressRulesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "ingressRules": { + "rule": "repeated", + "type": "google.appengine.v1.FirewallRule", + "id": 2 + } + } + }, + "BatchUpdateIngressRulesResponse": { + "fields": { + "ingressRules": { + "rule": "repeated", + "type": "google.appengine.v1.FirewallRule", + "id": 1 + } + } + }, + "CreateIngressRuleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "rule": { + "type": "google.appengine.v1.FirewallRule", + "id": 2 + } + } + }, + "GetIngressRuleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "UpdateIngressRuleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "rule": { + "type": "google.appengine.v1.FirewallRule", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeleteIngressRuleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "AuthorizedDomains": { + "options": { + "(google.api.default_host)": "appengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/appengine.admin,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ListAuthorizedDomains": { + "requestType": "ListAuthorizedDomainsRequest", + "responseType": "ListAuthorizedDomainsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=apps/*}/authorizedDomains" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=apps/*}/authorizedDomains" + } + } + ] + } + } + }, + "ListAuthorizedDomainsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListAuthorizedDomainsResponse": { + "fields": { + "domains": { + "rule": "repeated", + "type": "google.appengine.v1.AuthorizedDomain", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "AuthorizedCertificates": { + "options": { + "(google.api.default_host)": "appengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/appengine.admin,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ListAuthorizedCertificates": { + "requestType": "ListAuthorizedCertificatesRequest", + "responseType": "ListAuthorizedCertificatesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=apps/*}/authorizedCertificates" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=apps/*}/authorizedCertificates" + } + } + ] + }, + "GetAuthorizedCertificate": { + "requestType": "GetAuthorizedCertificateRequest", + "responseType": "google.appengine.v1.AuthorizedCertificate", + "options": { + "(google.api.http).get": "/v1/{name=apps/*/authorizedCertificates/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=apps/*/authorizedCertificates/*}" + } + } + ] + }, + "CreateAuthorizedCertificate": { + "requestType": "CreateAuthorizedCertificateRequest", + "responseType": "google.appengine.v1.AuthorizedCertificate", + "options": { + "(google.api.http).post": "/v1/{parent=apps/*}/authorizedCertificates", + "(google.api.http).body": "certificate" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=apps/*}/authorizedCertificates", + "body": "certificate" + } + } + ] + }, + "UpdateAuthorizedCertificate": { + "requestType": "UpdateAuthorizedCertificateRequest", + "responseType": "google.appengine.v1.AuthorizedCertificate", + "options": { + "(google.api.http).patch": "/v1/{name=apps/*/authorizedCertificates/*}", + "(google.api.http).body": "certificate" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=apps/*/authorizedCertificates/*}", + "body": "certificate" + } + } + ] + }, + "DeleteAuthorizedCertificate": { + "requestType": "DeleteAuthorizedCertificateRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=apps/*/authorizedCertificates/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=apps/*/authorizedCertificates/*}" + } + } + ] + } + } + }, + "ListAuthorizedCertificatesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "view": { + "type": "AuthorizedCertificateView", + "id": 4 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListAuthorizedCertificatesResponse": { + "fields": { + "certificates": { + "rule": "repeated", + "type": "google.appengine.v1.AuthorizedCertificate", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAuthorizedCertificateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "view": { + "type": "AuthorizedCertificateView", + "id": 2 + } + } + }, + "AuthorizedCertificateView": { + "values": { + "BASIC_CERTIFICATE": 0, + "FULL_CERTIFICATE": 1 + } + }, + "CreateAuthorizedCertificateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "certificate": { + "type": "google.appengine.v1.AuthorizedCertificate", + "id": 2 + } + } + }, + "UpdateAuthorizedCertificateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "certificate": { + "type": "google.appengine.v1.AuthorizedCertificate", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeleteAuthorizedCertificateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DomainMappings": { + "options": { + "(google.api.default_host)": "appengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/appengine.admin,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ListDomainMappings": { + "requestType": "ListDomainMappingsRequest", + "responseType": "ListDomainMappingsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=apps/*}/domainMappings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=apps/*}/domainMappings" + } + } + ] + }, + "GetDomainMapping": { + "requestType": "GetDomainMappingRequest", + "responseType": "google.appengine.v1.DomainMapping", + "options": { + "(google.api.http).get": "/v1/{name=apps/*/domainMappings/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=apps/*/domainMappings/*}" + } + } + ] + }, + "CreateDomainMapping": { + "requestType": "CreateDomainMappingRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=apps/*}/domainMappings", + "(google.api.http).body": "domain_mapping", + "(google.longrunning.operation_info).response_type": "DomainMapping", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=apps/*}/domainMappings", + "body": "domain_mapping" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DomainMapping", + "metadata_type": "OperationMetadataV1" + } + } + ] + }, + "UpdateDomainMapping": { + "requestType": "UpdateDomainMappingRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{name=apps/*/domainMappings/*}", + "(google.api.http).body": "domain_mapping", + "(google.longrunning.operation_info).response_type": "DomainMapping", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=apps/*/domainMappings/*}", + "body": "domain_mapping" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DomainMapping", + "metadata_type": "OperationMetadataV1" + } + } + ] + }, + "DeleteDomainMapping": { + "requestType": "DeleteDomainMappingRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=apps/*/domainMappings/*}", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadataV1" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=apps/*/domainMappings/*}" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadataV1" + } + } + ] + } + } + }, + "ListDomainMappingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDomainMappingsResponse": { + "fields": { + "domainMappings": { + "rule": "repeated", + "type": "google.appengine.v1.DomainMapping", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetDomainMappingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DomainOverrideStrategy": { + "values": { + "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY": 0, + "STRICT": 1, + "OVERRIDE": 2 + } + }, + "CreateDomainMappingRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "domainMapping": { + "type": "google.appengine.v1.DomainMapping", + "id": 2 + }, + "overrideStrategy": { + "type": "DomainOverrideStrategy", + "id": 4 + } + } + }, + "UpdateDomainMappingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "domainMapping": { + "type": "google.appengine.v1.DomainMapping", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeleteDomainMappingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "Application": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "dispatchRules": { + "rule": "repeated", + "type": "UrlDispatchRule", + "id": 3 + }, + "authDomain": { + "type": "string", + "id": 6 + }, + "locationId": { + "type": "string", + "id": 7 + }, + "codeBucket": { + "type": "string", + "id": 8 + }, + "defaultCookieExpiration": { + "type": "google.protobuf.Duration", + "id": 9 + }, + "servingStatus": { + "type": "ServingStatus", + "id": 10 + }, + "defaultHostname": { + "type": "string", + "id": 11 + }, + "defaultBucket": { + "type": "string", + "id": 12 + }, + "serviceAccount": { + "type": "string", + "id": 13 + }, + "iap": { + "type": "IdentityAwareProxy", + "id": 14 + }, + "gcrDomain": { + "type": "string", + "id": 16 + }, + "databaseType": { + "type": "DatabaseType", + "id": 17 + }, + "featureSettings": { + "type": "FeatureSettings", + "id": 18 + } + }, + "nested": { + "ServingStatus": { + "values": { + "UNSPECIFIED": 0, + "SERVING": 1, + "USER_DISABLED": 2, + "SYSTEM_DISABLED": 3 + } + }, + "IdentityAwareProxy": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + }, + "oauth2ClientId": { + "type": "string", + "id": 2 + }, + "oauth2ClientSecret": { + "type": "string", + "id": 3 + }, + "oauth2ClientSecretSha256": { + "type": "string", + "id": 4 + } + } + }, + "DatabaseType": { + "values": { + "DATABASE_TYPE_UNSPECIFIED": 0, + "CLOUD_DATASTORE": 1, + "CLOUD_FIRESTORE": 2, + "CLOUD_DATASTORE_COMPATIBILITY": 3 + } + }, + "FeatureSettings": { + "fields": { + "splitHealthChecks": { + "type": "bool", + "id": 1 + }, + "useContainerOptimizedOs": { + "type": "bool", + "id": 2 + } + } + } + } + }, + "UrlDispatchRule": { + "fields": { + "domain": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + }, + "service": { + "type": "string", + "id": 3 + } + } + }, + "AuthorizedCertificate": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "domainNames": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "certificateRawData": { + "type": "CertificateRawData", + "id": 6 + }, + "managedCertificate": { + "type": "ManagedCertificate", + "id": 7 + }, + "visibleDomainMappings": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "domainMappingsCount": { + "type": "int32", + "id": 9 + } + } + }, + "CertificateRawData": { + "fields": { + "publicCertificate": { + "type": "string", + "id": 1 + }, + "privateKey": { + "type": "string", + "id": 2 + } + } + }, + "ManagementStatus": { + "values": { + "MANAGEMENT_STATUS_UNSPECIFIED": 0, + "OK": 1, + "PENDING": 2, + "FAILED_RETRYING_NOT_VISIBLE": 4, + "FAILED_PERMANENT": 6, + "FAILED_RETRYING_CAA_FORBIDDEN": 7, + "FAILED_RETRYING_CAA_CHECKING": 8 + } + }, + "ManagedCertificate": { + "fields": { + "lastRenewalTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "status": { + "type": "ManagementStatus", + "id": 2 + } + } + }, + "AuthorizedDomain": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + } + } + }, + "DomainMapping": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "sslSettings": { + "type": "SslSettings", + "id": 3 + }, + "resourceRecords": { + "rule": "repeated", + "type": "ResourceRecord", + "id": 4 + } + } + }, + "SslSettings": { + "fields": { + "certificateId": { + "type": "string", + "id": 1 + }, + "sslManagementType": { + "type": "SslManagementType", + "id": 3 + }, + "pendingManagedCertificateId": { + "type": "string", + "id": 4 + } + }, + "nested": { + "SslManagementType": { + "values": { + "SSL_MANAGEMENT_TYPE_UNSPECIFIED": 0, + "AUTOMATIC": 1, + "MANUAL": 2 + } + } + } + }, + "ResourceRecord": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "rrdata": { + "type": "string", + "id": 2 + }, + "type": { + "type": "RecordType", + "id": 3 + } + }, + "nested": { + "RecordType": { + "values": { + "RECORD_TYPE_UNSPECIFIED": 0, + "A": 1, + "AAAA": 2, + "CNAME": 3 + } + } + } + }, + "FirewallRule": { + "fields": { + "priority": { + "type": "int32", + "id": 1 + }, + "action": { + "type": "Action", + "id": 2 + }, + "sourceRange": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "UNSPECIFIED_ACTION": 0, + "ALLOW": 1, + "DENY": 2 + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "appengine.googleapis.com/Instance", + "(google.api.resource).pattern": "apps/{app}/services/{service}/versions/{version}/instances/{instance}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "appEngineRelease": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "availability": { + "type": "Availability", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vmName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vmZoneName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vmId": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requests": { + "type": "int32", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errors": { + "type": "int32", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "qps": { + "type": "float", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "averageLatency": { + "type": "int32", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "memoryUsage": { + "type": "int64", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vmStatus": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vmDebugEnabled": { + "type": "bool", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vmIp": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vmLiveness": { + "type": "Liveness.LivenessState", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Availability": { + "values": { + "UNSPECIFIED": 0, + "RESIDENT": 1, + "DYNAMIC": 2 + } + }, + "Liveness": { + "fields": {}, + "nested": { + "LivenessState": { + "values": { + "LIVENESS_STATE_UNSPECIFIED": 0, + "UNKNOWN": 1, + "HEALTHY": 2, + "UNHEALTHY": 3, + "DRAINING": 4, + "TIMEOUT": 5 + } + } + } + } + } + }, + "Service": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "split": { + "type": "TrafficSplit", + "id": 3 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "networkSettings": { + "type": "NetworkSettings", + "id": 6 + } + } + }, + "TrafficSplit": { + "fields": { + "shardBy": { + "type": "ShardBy", + "id": 1 + }, + "allocations": { + "keyType": "string", + "type": "double", + "id": 2 + } + }, + "nested": { + "ShardBy": { + "values": { + "UNSPECIFIED": 0, + "COOKIE": 1, + "IP": 2, + "RANDOM": 3 + } + } + } + }, + "NetworkSettings": { + "fields": { + "ingressTrafficAllowed": { + "type": "IngressTrafficAllowed", + "id": 1 + } + }, + "nested": { + "IngressTrafficAllowed": { + "values": { + "INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED": 0, + "INGRESS_TRAFFIC_ALLOWED_ALL": 1, + "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY": 2, + "INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB": 3 + } + } + } + }, + "Version": { + "oneofs": { + "scaling": { + "oneof": [ + "automaticScaling", + "basicScaling", + "manualScaling" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "automaticScaling": { + "type": "AutomaticScaling", + "id": 3 + }, + "basicScaling": { + "type": "BasicScaling", + "id": 4 + }, + "manualScaling": { + "type": "ManualScaling", + "id": 5 + }, + "inboundServices": { + "rule": "repeated", + "type": "InboundServiceType", + "id": 6 + }, + "instanceClass": { + "type": "string", + "id": 7 + }, + "network": { + "type": "Network", + "id": 8 + }, + "zones": { + "rule": "repeated", + "type": "string", + "id": 118 + }, + "resources": { + "type": "Resources", + "id": 9 + }, + "runtime": { + "type": "string", + "id": 10 + }, + "runtimeChannel": { + "type": "string", + "id": 117 + }, + "threadsafe": { + "type": "bool", + "id": 11 + }, + "vm": { + "type": "bool", + "id": 12 + }, + "appEngineApis": { + "type": "bool", + "id": 128 + }, + "betaSettings": { + "keyType": "string", + "type": "string", + "id": 13 + }, + "env": { + "type": "string", + "id": 14 + }, + "servingStatus": { + "type": "ServingStatus", + "id": 15 + }, + "createdBy": { + "type": "string", + "id": 16 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 17 + }, + "diskUsageBytes": { + "type": "int64", + "id": 18 + }, + "runtimeApiVersion": { + "type": "string", + "id": 21 + }, + "runtimeMainExecutablePath": { + "type": "string", + "id": 22 + }, + "serviceAccount": { + "type": "string", + "id": 127 + }, + "handlers": { + "rule": "repeated", + "type": "UrlMap", + "id": 100 + }, + "errorHandlers": { + "rule": "repeated", + "type": "ErrorHandler", + "id": 101 + }, + "libraries": { + "rule": "repeated", + "type": "Library", + "id": 102 + }, + "apiConfig": { + "type": "ApiConfigHandler", + "id": 103 + }, + "envVariables": { + "keyType": "string", + "type": "string", + "id": 104 + }, + "buildEnvVariables": { + "keyType": "string", + "type": "string", + "id": 125 + }, + "defaultExpiration": { + "type": "google.protobuf.Duration", + "id": 105 + }, + "healthCheck": { + "type": "HealthCheck", + "id": 106 + }, + "readinessCheck": { + "type": "ReadinessCheck", + "id": 112 + }, + "livenessCheck": { + "type": "LivenessCheck", + "id": 113 + }, + "nobuildFilesRegex": { + "type": "string", + "id": 107 + }, + "deployment": { + "type": "Deployment", + "id": 108 + }, + "versionUrl": { + "type": "string", + "id": 109 + }, + "endpointsApiService": { + "type": "EndpointsApiService", + "id": 110 + }, + "entrypoint": { + "type": "Entrypoint", + "id": 122 + }, + "vpcAccessConnector": { + "type": "VpcAccessConnector", + "id": 121 + } + } + }, + "EndpointsApiService": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "configId": { + "type": "string", + "id": 2 + }, + "rolloutStrategy": { + "type": "RolloutStrategy", + "id": 3 + }, + "disableTraceSampling": { + "type": "bool", + "id": 4 + } + }, + "nested": { + "RolloutStrategy": { + "values": { + "UNSPECIFIED_ROLLOUT_STRATEGY": 0, + "FIXED": 1, + "MANAGED": 2 + } + } + } + }, + "AutomaticScaling": { + "fields": { + "coolDownPeriod": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "cpuUtilization": { + "type": "CpuUtilization", + "id": 2 + }, + "maxConcurrentRequests": { + "type": "int32", + "id": 3 + }, + "maxIdleInstances": { + "type": "int32", + "id": 4 + }, + "maxTotalInstances": { + "type": "int32", + "id": 5 + }, + "maxPendingLatency": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "minIdleInstances": { + "type": "int32", + "id": 7 + }, + "minTotalInstances": { + "type": "int32", + "id": 8 + }, + "minPendingLatency": { + "type": "google.protobuf.Duration", + "id": 9 + }, + "requestUtilization": { + "type": "RequestUtilization", + "id": 10 + }, + "diskUtilization": { + "type": "DiskUtilization", + "id": 11 + }, + "networkUtilization": { + "type": "NetworkUtilization", + "id": 12 + }, + "standardSchedulerSettings": { + "type": "StandardSchedulerSettings", + "id": 20 + } + } + }, + "BasicScaling": { + "fields": { + "idleTimeout": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "maxInstances": { + "type": "int32", + "id": 2 + } + } + }, + "ManualScaling": { + "fields": { + "instances": { + "type": "int32", + "id": 1 + } + } + }, + "CpuUtilization": { + "fields": { + "aggregationWindowLength": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "targetUtilization": { + "type": "double", + "id": 2 + } + } + }, + "RequestUtilization": { + "fields": { + "targetRequestCountPerSecond": { + "type": "int32", + "id": 1 + }, + "targetConcurrentRequests": { + "type": "int32", + "id": 2 + } + } + }, + "DiskUtilization": { + "fields": { + "targetWriteBytesPerSecond": { + "type": "int32", + "id": 14 + }, + "targetWriteOpsPerSecond": { + "type": "int32", + "id": 15 + }, + "targetReadBytesPerSecond": { + "type": "int32", + "id": 16 + }, + "targetReadOpsPerSecond": { + "type": "int32", + "id": 17 + } + } + }, + "NetworkUtilization": { + "fields": { + "targetSentBytesPerSecond": { + "type": "int32", + "id": 1 + }, + "targetSentPacketsPerSecond": { + "type": "int32", + "id": 11 + }, + "targetReceivedBytesPerSecond": { + "type": "int32", + "id": 12 + }, + "targetReceivedPacketsPerSecond": { + "type": "int32", + "id": 13 + } + } + }, + "StandardSchedulerSettings": { + "fields": { + "targetCpuUtilization": { + "type": "double", + "id": 1 + }, + "targetThroughputUtilization": { + "type": "double", + "id": 2 + }, + "minInstances": { + "type": "int32", + "id": 3 + }, + "maxInstances": { + "type": "int32", + "id": 4 + } + } + }, + "Network": { + "fields": { + "forwardedPorts": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "instanceTag": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + }, + "subnetworkName": { + "type": "string", + "id": 4 + }, + "sessionAffinity": { + "type": "bool", + "id": 5 + } + } + }, + "Volume": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "volumeType": { + "type": "string", + "id": 2 + }, + "sizeGb": { + "type": "double", + "id": 3 + } + } + }, + "Resources": { + "fields": { + "cpu": { + "type": "double", + "id": 1 + }, + "diskGb": { + "type": "double", + "id": 2 + }, + "memoryGb": { + "type": "double", + "id": 3 + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 4 + }, + "kmsKeyReference": { + "type": "string", + "id": 5 + } + } + }, + "InboundServiceType": { + "values": { + "INBOUND_SERVICE_UNSPECIFIED": 0, + "INBOUND_SERVICE_MAIL": 1, + "INBOUND_SERVICE_MAIL_BOUNCE": 2, + "INBOUND_SERVICE_XMPP_ERROR": 3, + "INBOUND_SERVICE_XMPP_MESSAGE": 4, + "INBOUND_SERVICE_XMPP_SUBSCRIBE": 5, + "INBOUND_SERVICE_XMPP_PRESENCE": 6, + "INBOUND_SERVICE_CHANNEL_PRESENCE": 7, + "INBOUND_SERVICE_WARMUP": 9 + } + }, + "ServingStatus": { + "values": { + "SERVING_STATUS_UNSPECIFIED": 0, + "SERVING": 1, + "STOPPED": 2 + } + }, + "VpcAccessConnector": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "egressSetting": { + "type": "EgressSetting", + "id": 2 + } + }, + "nested": { + "EgressSetting": { + "values": { + "EGRESS_SETTING_UNSPECIFIED": 0, + "ALL_TRAFFIC": 1, + "PRIVATE_IP_RANGES": 2 + } + } + } + }, + "Entrypoint": { + "oneofs": { + "command": { + "oneof": [ + "shell" + ] + } + }, + "fields": { + "shell": { + "type": "string", + "id": 1 + } + } + }, + "Deployment": { + "fields": { + "files": { + "keyType": "string", + "type": "FileInfo", + "id": 1 + }, + "container": { + "type": "ContainerInfo", + "id": 2 + }, + "zip": { + "type": "ZipInfo", + "id": 3 + }, + "cloudBuildOptions": { + "type": "CloudBuildOptions", + "id": 6 + } + } + }, + "FileInfo": { + "fields": { + "sourceUrl": { + "type": "string", + "id": 1 + }, + "sha1Sum": { + "type": "string", + "id": 2 + }, + "mimeType": { + "type": "string", + "id": 3 + } + } + }, + "ContainerInfo": { + "fields": { + "image": { + "type": "string", + "id": 1 + } + } + }, + "CloudBuildOptions": { + "fields": { + "appYamlPath": { + "type": "string", + "id": 1 + }, + "cloudBuildTimeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "ZipInfo": { + "fields": { + "sourceUrl": { + "type": "string", + "id": 3 + }, + "filesCount": { + "type": "int32", + "id": 4 + } + } + }, + "AuditData": { + "oneofs": { + "method": { + "oneof": [ + "updateService", + "createVersion" + ] + } + }, + "fields": { + "updateService": { + "type": "UpdateServiceMethod", + "id": 1 + }, + "createVersion": { + "type": "CreateVersionMethod", + "id": 2 + } + } + }, + "UpdateServiceMethod": { + "fields": { + "request": { + "type": "UpdateServiceRequest", + "id": 1 + } + } + }, + "CreateVersionMethod": { + "fields": { + "request": { + "type": "CreateVersionRequest", + "id": 1 + } + } + }, + "LocationMetadata": { + "fields": { + "standardEnvironmentAvailable": { + "type": "bool", + "id": 2 + }, + "flexibleEnvironmentAvailable": { + "type": "bool", + "id": 4 + }, + "searchApiAvailable": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OperationMetadataV1": { + "oneofs": { + "methodMetadata": { + "oneof": [ + "createVersionMetadata" + ] + } + }, + "fields": { + "method": { + "type": "string", + "id": 1 + }, + "insertTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "user": { + "type": "string", + "id": 4 + }, + "target": { + "type": "string", + "id": 5 + }, + "ephemeralMessage": { + "type": "string", + "id": 6 + }, + "warning": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "createVersionMetadata": { + "type": "CreateVersionMetadataV1", + "id": 8 + } + } + }, + "CreateVersionMetadataV1": { + "fields": { + "cloudBuildId": { + "type": "string", + "id": 1 + } + } + } + } + } + } + }, + "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 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-appengine/samples/README.md b/packages/google-appengine/samples/README.md new file mode 100644 index 00000000000..0a6ef549e2f --- /dev/null +++ b/packages/google-appengine/samples/README.md @@ -0,0 +1,680 @@ +[//]: # "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 + +# [App Engine Admin API: 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) + * [Applications.create_application](#applications.create_application) + * [Applications.get_application](#applications.get_application) + * [Applications.repair_application](#applications.repair_application) + * [Applications.update_application](#applications.update_application) + * [Authorized_certificates.create_authorized_certificate](#authorized_certificates.create_authorized_certificate) + * [Authorized_certificates.delete_authorized_certificate](#authorized_certificates.delete_authorized_certificate) + * [Authorized_certificates.get_authorized_certificate](#authorized_certificates.get_authorized_certificate) + * [Authorized_certificates.list_authorized_certificates](#authorized_certificates.list_authorized_certificates) + * [Authorized_certificates.update_authorized_certificate](#authorized_certificates.update_authorized_certificate) + * [Authorized_domains.list_authorized_domains](#authorized_domains.list_authorized_domains) + * [Domain_mappings.create_domain_mapping](#domain_mappings.create_domain_mapping) + * [Domain_mappings.delete_domain_mapping](#domain_mappings.delete_domain_mapping) + * [Domain_mappings.get_domain_mapping](#domain_mappings.get_domain_mapping) + * [Domain_mappings.list_domain_mappings](#domain_mappings.list_domain_mappings) + * [Domain_mappings.update_domain_mapping](#domain_mappings.update_domain_mapping) + * [Firewall.batch_update_ingress_rules](#firewall.batch_update_ingress_rules) + * [Firewall.create_ingress_rule](#firewall.create_ingress_rule) + * [Firewall.delete_ingress_rule](#firewall.delete_ingress_rule) + * [Firewall.get_ingress_rule](#firewall.get_ingress_rule) + * [Firewall.list_ingress_rules](#firewall.list_ingress_rules) + * [Firewall.update_ingress_rule](#firewall.update_ingress_rule) + * [Instances.debug_instance](#instances.debug_instance) + * [Instances.delete_instance](#instances.delete_instance) + * [Instances.get_instance](#instances.get_instance) + * [Instances.list_instances](#instances.list_instances) + * [Services.delete_service](#services.delete_service) + * [Services.get_service](#services.get_service) + * [Services.list_services](#services.list_services) + * [Services.update_service](#services.update_service) + * [Versions.create_version](#versions.create_version) + * [Versions.delete_version](#versions.delete_version) + * [Versions.get_version](#versions.get_version) + * [Versions.list_versions](#versions.list_versions) + * [Versions.update_version](#versions.update_version) + * [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 + + + +### Applications.create_application + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/applications.create_application.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-appengine/samples/generated/v1/applications.create_application.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/applications.create_application.js` + + +----- + + + + +### Applications.get_application + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/applications.get_application.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-appengine/samples/generated/v1/applications.get_application.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/applications.get_application.js` + + +----- + + + + +### Applications.repair_application + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/applications.repair_application.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-appengine/samples/generated/v1/applications.repair_application.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/applications.repair_application.js` + + +----- + + + + +### Applications.update_application + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/applications.update_application.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-appengine/samples/generated/v1/applications.update_application.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/applications.update_application.js` + + +----- + + + + +### Authorized_certificates.create_authorized_certificate + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.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-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.js` + + +----- + + + + +### Authorized_certificates.delete_authorized_certificate + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.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-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.js` + + +----- + + + + +### Authorized_certificates.get_authorized_certificate + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.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-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.js` + + +----- + + + + +### Authorized_certificates.list_authorized_certificates + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.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-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.js` + + +----- + + + + +### Authorized_certificates.update_authorized_certificate + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.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-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.js` + + +----- + + + + +### Authorized_domains.list_authorized_domains + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.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-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.js` + + +----- + + + + +### Domain_mappings.create_domain_mapping + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.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-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.js` + + +----- + + + + +### Domain_mappings.delete_domain_mapping + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.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-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.js` + + +----- + + + + +### Domain_mappings.get_domain_mapping + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.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-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.js` + + +----- + + + + +### Domain_mappings.list_domain_mappings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.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-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.js` + + +----- + + + + +### Domain_mappings.update_domain_mapping + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.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-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.js` + + +----- + + + + +### Firewall.batch_update_ingress_rules + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.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-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.js` + + +----- + + + + +### Firewall.create_ingress_rule + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.create_ingress_rule.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-appengine/samples/generated/v1/firewall.create_ingress_rule.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/firewall.create_ingress_rule.js` + + +----- + + + + +### Firewall.delete_ingress_rule + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.delete_ingress_rule.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-appengine/samples/generated/v1/firewall.delete_ingress_rule.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/firewall.delete_ingress_rule.js` + + +----- + + + + +### Firewall.get_ingress_rule + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.get_ingress_rule.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-appengine/samples/generated/v1/firewall.get_ingress_rule.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/firewall.get_ingress_rule.js` + + +----- + + + + +### Firewall.list_ingress_rules + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.list_ingress_rules.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-appengine/samples/generated/v1/firewall.list_ingress_rules.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/firewall.list_ingress_rules.js` + + +----- + + + + +### Firewall.update_ingress_rule + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/firewall.update_ingress_rule.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-appengine/samples/generated/v1/firewall.update_ingress_rule.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/firewall.update_ingress_rule.js` + + +----- + + + + +### Instances.debug_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/instances.debug_instance.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-appengine/samples/generated/v1/instances.debug_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/instances.debug_instance.js` + + +----- + + + + +### Instances.delete_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/instances.delete_instance.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-appengine/samples/generated/v1/instances.delete_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/instances.delete_instance.js` + + +----- + + + + +### Instances.get_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/instances.get_instance.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-appengine/samples/generated/v1/instances.get_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/instances.get_instance.js` + + +----- + + + + +### Instances.list_instances + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/instances.list_instances.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-appengine/samples/generated/v1/instances.list_instances.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/instances.list_instances.js` + + +----- + + + + +### Services.delete_service + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/services.delete_service.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-appengine/samples/generated/v1/services.delete_service.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/services.delete_service.js` + + +----- + + + + +### Services.get_service + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/services.get_service.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-appengine/samples/generated/v1/services.get_service.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/services.get_service.js` + + +----- + + + + +### Services.list_services + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/services.list_services.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-appengine/samples/generated/v1/services.list_services.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/services.list_services.js` + + +----- + + + + +### Services.update_service + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/services.update_service.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-appengine/samples/generated/v1/services.update_service.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/services.update_service.js` + + +----- + + + + +### Versions.create_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/versions.create_version.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-appengine/samples/generated/v1/versions.create_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/versions.create_version.js` + + +----- + + + + +### Versions.delete_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/versions.delete_version.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-appengine/samples/generated/v1/versions.delete_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/versions.delete_version.js` + + +----- + + + + +### Versions.get_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/versions.get_version.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-appengine/samples/generated/v1/versions.get_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/versions.get_version.js` + + +----- + + + + +### Versions.list_versions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/versions.list_versions.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-appengine/samples/generated/v1/versions.list_versions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/versions.list_versions.js` + + +----- + + + + +### Versions.update_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/samples/generated/v1/versions.update_version.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-appengine/samples/generated/v1/versions.update_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/generated/v1/versions.update_version.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/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-appengine/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-appengine/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-appengine/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-appengine/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/appengine/docs/admin-api/ diff --git a/packages/google-appengine/samples/generated/v1/applications.create_application.js b/packages/google-appengine/samples/generated/v1/applications.create_application.js new file mode 100644 index 00000000000..c7bb6c91036 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/applications.create_application.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() { + // [START appengine_v1_generated_Applications_CreateApplication_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Application configuration. + */ + // const application = {} + + // Imports the Appengine library + const {ApplicationsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new ApplicationsClient(); + + async function callCreateApplication() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.createApplication(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateApplication(); + // [END appengine_v1_generated_Applications_CreateApplication_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/applications.get_application.js b/packages/google-appengine/samples/generated/v1/applications.get_application.js new file mode 100644 index 00000000000..4af2378080d --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/applications.get_application.js @@ -0,0 +1,60 @@ +// 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() { + // [START appengine_v1_generated_Applications_GetApplication_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Application resource to get. Example: `apps/myapp`. + */ + // const name = 'abc123' + + // Imports the Appengine library + const {ApplicationsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new ApplicationsClient(); + + async function callGetApplication() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.getApplication(request); + console.log(response); + } + + callGetApplication(); + // [END appengine_v1_generated_Applications_GetApplication_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/applications.repair_application.js b/packages/google-appengine/samples/generated/v1/applications.repair_application.js new file mode 100644 index 00000000000..7730c2c38e5 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/applications.repair_application.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() { + // [START appengine_v1_generated_Applications_RepairApplication_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the application to repair. Example: `apps/myapp` + */ + // const name = 'abc123' + + // Imports the Appengine library + const {ApplicationsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new ApplicationsClient(); + + async function callRepairApplication() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.repairApplication(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRepairApplication(); + // [END appengine_v1_generated_Applications_RepairApplication_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/applications.update_application.js b/packages/google-appengine/samples/generated/v1/applications.update_application.js new file mode 100644 index 00000000000..48fe715a274 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/applications.update_application.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START appengine_v1_generated_Applications_UpdateApplication_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Application resource to update. Example: `apps/myapp`. + */ + // const name = 'abc123' + /** + * An Application containing the updated resource. + */ + // const application = {} + /** + * Required. Standard field mask for the set of fields to be updated. + */ + // const updateMask = {} + + // Imports the Appengine library + const {ApplicationsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new ApplicationsClient(); + + async function callUpdateApplication() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.updateApplication(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateApplication(); + // [END appengine_v1_generated_Applications_UpdateApplication_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.js b/packages/google-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.js new file mode 100644 index 00000000000..9822c697189 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.js @@ -0,0 +1,64 @@ +// 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() { + // [START appengine_v1_generated_AuthorizedCertificates_CreateAuthorizedCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the parent `Application` resource. Example: `apps/myapp`. + */ + // const parent = 'abc123' + /** + * SSL certificate data. + */ + // const certificate = {} + + // Imports the Appengine library + const {AuthorizedCertificatesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new AuthorizedCertificatesClient(); + + async function callCreateAuthorizedCertificate() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.createAuthorizedCertificate(request); + console.log(response); + } + + callCreateAuthorizedCertificate(); + // [END appengine_v1_generated_AuthorizedCertificates_CreateAuthorizedCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.js b/packages/google-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.js new file mode 100644 index 00000000000..a0be34c5b88 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.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() { + // [START appengine_v1_generated_AuthorizedCertificates_DeleteAuthorizedCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource to delete. Example: + * `apps/myapp/authorizedCertificates/12345`. + */ + // const name = 'abc123' + + // Imports the Appengine library + const {AuthorizedCertificatesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new AuthorizedCertificatesClient(); + + async function callDeleteAuthorizedCertificate() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.deleteAuthorizedCertificate(request); + console.log(response); + } + + callDeleteAuthorizedCertificate(); + // [END appengine_v1_generated_AuthorizedCertificates_DeleteAuthorizedCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.js b/packages/google-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.js new file mode 100644 index 00000000000..eabbb7486c5 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.js @@ -0,0 +1,65 @@ +// 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() { + // [START appengine_v1_generated_AuthorizedCertificates_GetAuthorizedCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource requested. Example: + * `apps/myapp/authorizedCertificates/12345`. + */ + // const name = 'abc123' + /** + * Controls the set of fields returned in the `GET` response. + */ + // const view = {} + + // Imports the Appengine library + const {AuthorizedCertificatesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new AuthorizedCertificatesClient(); + + async function callGetAuthorizedCertificate() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.getAuthorizedCertificate(request); + console.log(response); + } + + callGetAuthorizedCertificate(); + // [END appengine_v1_generated_AuthorizedCertificates_GetAuthorizedCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.js b/packages/google-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.js new file mode 100644 index 00000000000..8d5604c1e20 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START appengine_v1_generated_AuthorizedCertificates_ListAuthorizedCertificates_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the parent `Application` resource. Example: `apps/myapp`. + */ + // const parent = 'abc123' + /** + * Controls the set of fields returned in the `LIST` response. + */ + // const view = {} + /** + * Maximum results to return per page. + */ + // const pageSize = 1234 + /** + * Continuation token for fetching the next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Appengine library + const {AuthorizedCertificatesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new AuthorizedCertificatesClient(); + + async function callListAuthorizedCertificates() { + // Construct request + const request = { + }; + + // Run request + const iterable = await appengineClient.listAuthorizedCertificatesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAuthorizedCertificates(); + // [END appengine_v1_generated_AuthorizedCertificates_ListAuthorizedCertificates_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.js b/packages/google-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.js new file mode 100644 index 00000000000..6cafe50852d --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.js @@ -0,0 +1,71 @@ +// 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() { + // [START appengine_v1_generated_AuthorizedCertificates_UpdateAuthorizedCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource to update. Example: + * `apps/myapp/authorizedCertificates/12345`. + */ + // const name = 'abc123' + /** + * An `AuthorizedCertificate` containing the updated resource. Only fields set + * in the field mask will be updated. + */ + // const certificate = {} + /** + * Standard field mask for the set of fields to be updated. Updates are only + * supported on the `certificate_raw_data` and `display_name` fields. + */ + // const updateMask = {} + + // Imports the Appengine library + const {AuthorizedCertificatesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new AuthorizedCertificatesClient(); + + async function callUpdateAuthorizedCertificate() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.updateAuthorizedCertificate(request); + console.log(response); + } + + callUpdateAuthorizedCertificate(); + // [END appengine_v1_generated_AuthorizedCertificates_UpdateAuthorizedCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.js b/packages/google-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.js new file mode 100644 index 00000000000..1c5bf95f2f7 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.js @@ -0,0 +1,70 @@ +// 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() { + // [START appengine_v1_generated_AuthorizedDomains_ListAuthorizedDomains_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the parent Application resource. Example: `apps/myapp`. + */ + // const parent = 'abc123' + /** + * Maximum results to return per page. + */ + // const pageSize = 1234 + /** + * Continuation token for fetching the next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Appengine library + const {AuthorizedDomainsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new AuthorizedDomainsClient(); + + async function callListAuthorizedDomains() { + // Construct request + const request = { + }; + + // Run request + const iterable = await appengineClient.listAuthorizedDomainsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAuthorizedDomains(); + // [END appengine_v1_generated_AuthorizedDomains_ListAuthorizedDomains_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.js b/packages/google-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.js new file mode 100644 index 00000000000..f1f5c58b985 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.js @@ -0,0 +1,70 @@ +// 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() { + // [START appengine_v1_generated_DomainMappings_CreateDomainMapping_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the parent Application resource. Example: `apps/myapp`. + */ + // const parent = 'abc123' + /** + * Domain mapping configuration. + */ + // const domainMapping = {} + /** + * Whether the domain creation should override any existing mappings for this + * domain. By default, overrides are rejected. + */ + // const overrideStrategy = {} + + // Imports the Appengine library + const {DomainMappingsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new DomainMappingsClient(); + + async function callCreateDomainMapping() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.createDomainMapping(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateDomainMapping(); + // [END appengine_v1_generated_DomainMappings_CreateDomainMapping_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.js b/packages/google-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.js new file mode 100644 index 00000000000..37e4c3226a5 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.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() { + // [START appengine_v1_generated_DomainMappings_DeleteDomainMapping_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource to delete. Example: + * `apps/myapp/domainMappings/example.com`. + */ + // const name = 'abc123' + + // Imports the Appengine library + const {DomainMappingsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new DomainMappingsClient(); + + async function callDeleteDomainMapping() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.deleteDomainMapping(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDomainMapping(); + // [END appengine_v1_generated_DomainMappings_DeleteDomainMapping_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.js b/packages/google-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.js new file mode 100644 index 00000000000..dc4797421bb --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.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() { + // [START appengine_v1_generated_DomainMappings_GetDomainMapping_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource requested. Example: + * `apps/myapp/domainMappings/example.com`. + */ + // const name = 'abc123' + + // Imports the Appengine library + const {DomainMappingsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new DomainMappingsClient(); + + async function callGetDomainMapping() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.getDomainMapping(request); + console.log(response); + } + + callGetDomainMapping(); + // [END appengine_v1_generated_DomainMappings_GetDomainMapping_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.js b/packages/google-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.js new file mode 100644 index 00000000000..a4b7018ad23 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.js @@ -0,0 +1,70 @@ +// 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() { + // [START appengine_v1_generated_DomainMappings_ListDomainMappings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the parent Application resource. Example: `apps/myapp`. + */ + // const parent = 'abc123' + /** + * Maximum results to return per page. + */ + // const pageSize = 1234 + /** + * Continuation token for fetching the next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Appengine library + const {DomainMappingsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new DomainMappingsClient(); + + async function callListDomainMappings() { + // Construct request + const request = { + }; + + // Run request + const iterable = await appengineClient.listDomainMappingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDomainMappings(); + // [END appengine_v1_generated_DomainMappings_ListDomainMappings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.js b/packages/google-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.js new file mode 100644 index 00000000000..7dab51c3c07 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.js @@ -0,0 +1,71 @@ +// 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() { + // [START appengine_v1_generated_DomainMappings_UpdateDomainMapping_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource to update. Example: + * `apps/myapp/domainMappings/example.com`. + */ + // const name = 'abc123' + /** + * A domain mapping containing the updated resource. Only fields set + * in the field mask will be updated. + */ + // const domainMapping = {} + /** + * Required. Standard field mask for the set of fields to be updated. + */ + // const updateMask = {} + + // Imports the Appengine library + const {DomainMappingsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new DomainMappingsClient(); + + async function callUpdateDomainMapping() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.updateDomainMapping(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateDomainMapping(); + // [END appengine_v1_generated_DomainMappings_UpdateDomainMapping_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.js b/packages/google-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.js new file mode 100644 index 00000000000..08b177a511f --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.js @@ -0,0 +1,65 @@ +// 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() { + // [START appengine_v1_generated_Firewall_BatchUpdateIngressRules_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Firewall collection to set. + * Example: `apps/myapp/firewall/ingressRules`. + */ + // const name = 'abc123' + /** + * A list of FirewallRules to replace the existing set. + */ + // const ingressRules = 1234 + + // Imports the Appengine library + const {FirewallClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new FirewallClient(); + + async function callBatchUpdateIngressRules() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.batchUpdateIngressRules(request); + console.log(response); + } + + callBatchUpdateIngressRules(); + // [END appengine_v1_generated_Firewall_BatchUpdateIngressRules_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/firewall.create_ingress_rule.js b/packages/google-appengine/samples/generated/v1/firewall.create_ingress_rule.js new file mode 100644 index 00000000000..e53d90a28f0 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/firewall.create_ingress_rule.js @@ -0,0 +1,72 @@ +// 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() { + // [START appengine_v1_generated_Firewall_CreateIngressRule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the parent Firewall collection in which to create a new rule. + * Example: `apps/myapp/firewall/ingressRules`. + */ + // const parent = 'abc123' + /** + * A FirewallRule containing the new resource. + * The user may optionally provide a position at which the new rule will be + * placed. The positions define a sequential list starting at 1. If a rule + * already exists at the given position, rules greater than the provided + * position will be moved forward by one. + * If no position is provided, the server will place the rule as the second to + * last rule in the sequence before the required default allow-all or deny-all + * rule. + */ + // const rule = {} + + // Imports the Appengine library + const {FirewallClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new FirewallClient(); + + async function callCreateIngressRule() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.createIngressRule(request); + console.log(response); + } + + callCreateIngressRule(); + // [END appengine_v1_generated_Firewall_CreateIngressRule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/firewall.delete_ingress_rule.js b/packages/google-appengine/samples/generated/v1/firewall.delete_ingress_rule.js new file mode 100644 index 00000000000..cf3e2079368 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/firewall.delete_ingress_rule.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() { + // [START appengine_v1_generated_Firewall_DeleteIngressRule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Firewall resource to delete. + * Example: `apps/myapp/firewall/ingressRules/100`. + */ + // const name = 'abc123' + + // Imports the Appengine library + const {FirewallClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new FirewallClient(); + + async function callDeleteIngressRule() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.deleteIngressRule(request); + console.log(response); + } + + callDeleteIngressRule(); + // [END appengine_v1_generated_Firewall_DeleteIngressRule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/firewall.get_ingress_rule.js b/packages/google-appengine/samples/generated/v1/firewall.get_ingress_rule.js new file mode 100644 index 00000000000..dc3f0966416 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/firewall.get_ingress_rule.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() { + // [START appengine_v1_generated_Firewall_GetIngressRule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Firewall resource to retrieve. + * Example: `apps/myapp/firewall/ingressRules/100`. + */ + // const name = 'abc123' + + // Imports the Appengine library + const {FirewallClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new FirewallClient(); + + async function callGetIngressRule() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.getIngressRule(request); + console.log(response); + } + + callGetIngressRule(); + // [END appengine_v1_generated_Firewall_GetIngressRule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/firewall.list_ingress_rules.js b/packages/google-appengine/samples/generated/v1/firewall.list_ingress_rules.js new file mode 100644 index 00000000000..0cc3a260564 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/firewall.list_ingress_rules.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START appengine_v1_generated_Firewall_ListIngressRules_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Firewall collection to retrieve. + * Example: `apps/myapp/firewall/ingressRules`. + */ + // const parent = 'abc123' + /** + * Maximum results to return per page. + */ + // const pageSize = 1234 + /** + * Continuation token for fetching the next page of results. + */ + // const pageToken = 'abc123' + /** + * A valid IP Address. If set, only rules matching this address will be + * returned. The first returned rule will be the rule that fires on requests + * from this IP. + */ + // const matchingAddress = 'abc123' + + // Imports the Appengine library + const {FirewallClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new FirewallClient(); + + async function callListIngressRules() { + // Construct request + const request = { + }; + + // Run request + const iterable = await appengineClient.listIngressRulesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListIngressRules(); + // [END appengine_v1_generated_Firewall_ListIngressRules_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/firewall.update_ingress_rule.js b/packages/google-appengine/samples/generated/v1/firewall.update_ingress_rule.js new file mode 100644 index 00000000000..c371af1eff9 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/firewall.update_ingress_rule.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START appengine_v1_generated_Firewall_UpdateIngressRule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Firewall resource to update. + * Example: `apps/myapp/firewall/ingressRules/100`. + */ + // const name = 'abc123' + /** + * A FirewallRule containing the updated resource + */ + // const rule = {} + /** + * Standard field mask for the set of fields to be updated. + */ + // const updateMask = {} + + // Imports the Appengine library + const {FirewallClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new FirewallClient(); + + async function callUpdateIngressRule() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.updateIngressRule(request); + console.log(response); + } + + callUpdateIngressRule(); + // [END appengine_v1_generated_Firewall_UpdateIngressRule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/instances.debug_instance.js b/packages/google-appengine/samples/generated/v1/instances.debug_instance.js new file mode 100644 index 00000000000..c5652950940 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/instances.debug_instance.js @@ -0,0 +1,70 @@ +// 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() { + // [START appengine_v1_generated_Instances_DebugInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource requested. Example: + * `apps/myapp/services/default/versions/v1/instances/instance-1`. + */ + // const name = 'abc123' + /** + * Public SSH key to add to the instance. Examples: + * * `[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]` + * * `[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}` + * For more information, see + * Adding and Removing SSH Keys (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). + */ + // const sshKey = 'abc123' + + // Imports the Appengine library + const {InstancesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new InstancesClient(); + + async function callDebugInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.debugInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDebugInstance(); + // [END appengine_v1_generated_Instances_DebugInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/instances.delete_instance.js b/packages/google-appengine/samples/generated/v1/instances.delete_instance.js new file mode 100644 index 00000000000..996c4bb4bbc --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/instances.delete_instance.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() { + // [START appengine_v1_generated_Instances_DeleteInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource requested. Example: + * `apps/myapp/services/default/versions/v1/instances/instance-1`. + */ + // const name = 'abc123' + + // Imports the Appengine library + const {InstancesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new InstancesClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END appengine_v1_generated_Instances_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/instances.get_instance.js b/packages/google-appengine/samples/generated/v1/instances.get_instance.js new file mode 100644 index 00000000000..261dd293788 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/instances.get_instance.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() { + // [START appengine_v1_generated_Instances_GetInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource requested. Example: + * `apps/myapp/services/default/versions/v1/instances/instance-1`. + */ + // const name = 'abc123' + + // Imports the Appengine library + const {InstancesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new InstancesClient(); + + async function callGetInstance() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END appengine_v1_generated_Instances_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/instances.list_instances.js b/packages/google-appengine/samples/generated/v1/instances.list_instances.js new file mode 100644 index 00000000000..0bb072531a0 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/instances.list_instances.js @@ -0,0 +1,71 @@ +// 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() { + // [START appengine_v1_generated_Instances_ListInstances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the parent Version resource. Example: + * `apps/myapp/services/default/versions/v1`. + */ + // const parent = 'abc123' + /** + * Maximum results to return per page. + */ + // const pageSize = 1234 + /** + * Continuation token for fetching the next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Appengine library + const {InstancesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new InstancesClient(); + + async function callListInstances() { + // Construct request + const request = { + }; + + // Run request + const iterable = await appengineClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END appengine_v1_generated_Instances_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/services.delete_service.js b/packages/google-appengine/samples/generated/v1/services.delete_service.js new file mode 100644 index 00000000000..2de63604b7e --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/services.delete_service.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() { + // [START appengine_v1_generated_Services_DeleteService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource requested. Example: `apps/myapp/services/default`. + */ + // const name = 'abc123' + + // Imports the Appengine library + const {ServicesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new ServicesClient(); + + async function callDeleteService() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.deleteService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteService(); + // [END appengine_v1_generated_Services_DeleteService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/services.get_service.js b/packages/google-appengine/samples/generated/v1/services.get_service.js new file mode 100644 index 00000000000..3d38709f120 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/services.get_service.js @@ -0,0 +1,60 @@ +// 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() { + // [START appengine_v1_generated_Services_GetService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource requested. Example: `apps/myapp/services/default`. + */ + // const name = 'abc123' + + // Imports the Appengine library + const {ServicesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new ServicesClient(); + + async function callGetService() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.getService(request); + console.log(response); + } + + callGetService(); + // [END appengine_v1_generated_Services_GetService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/services.list_services.js b/packages/google-appengine/samples/generated/v1/services.list_services.js new file mode 100644 index 00000000000..713b0945488 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/services.list_services.js @@ -0,0 +1,70 @@ +// 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() { + // [START appengine_v1_generated_Services_ListServices_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the parent Application resource. Example: `apps/myapp`. + */ + // const parent = 'abc123' + /** + * Maximum results to return per page. + */ + // const pageSize = 1234 + /** + * Continuation token for fetching the next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Appengine library + const {ServicesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new ServicesClient(); + + async function callListServices() { + // Construct request + const request = { + }; + + // Run request + const iterable = await appengineClient.listServicesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListServices(); + // [END appengine_v1_generated_Services_ListServices_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/services.update_service.js b/packages/google-appengine/samples/generated/v1/services.update_service.js new file mode 100644 index 00000000000..2fe04fd9e13 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/services.update_service.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() { + // [START appengine_v1_generated_Services_UpdateService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource to update. Example: `apps/myapp/services/default`. + */ + // const name = 'abc123' + /** + * A Service resource containing the updated service. Only fields set in the + * field mask will be updated. + */ + // const service = {} + /** + * Required. Standard field mask for the set of fields to be updated. + */ + // const updateMask = {} + /** + * Set to `true` to gradually shift traffic to one or more versions that you + * specify. By default, traffic is shifted immediately. + * For gradual traffic migration, the target versions + * must be located within instances that are configured for both + * warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType) + * and + * automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling). + * You must specify the + * `shardBy` (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy) + * field in the Service resource. Gradual traffic migration is not + * supported in the App Engine flexible environment. For examples, see + * Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + */ + // const migrateTraffic = true + + // Imports the Appengine library + const {ServicesClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new ServicesClient(); + + async function callUpdateService() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.updateService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateService(); + // [END appengine_v1_generated_Services_UpdateService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/snippet_metadata.google.appengine.v1.json b/packages/google-appengine/samples/generated/v1/snippet_metadata.google.appengine.v1.json new file mode 100644 index 00000000000..e2a0c948d12 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/snippet_metadata.google.appengine.v1.json @@ -0,0 +1,1531 @@ +{ + "clientLibrary": { + "name": "nodejs-appengine", + "version": "2.1.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.appengine.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "appengine_v1_generated_Applications_GetApplication_async", + "title": "Applications getApplication Sample", + "origin": "API_DEFINITION", + "description": " Gets information about an application.", + "canonical": true, + "file": "applications.get_application.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApplication", + "fullName": "google.appengine.v1.Applications.GetApplication", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.Application", + "client": { + "shortName": "ApplicationsClient", + "fullName": "google.appengine.v1.ApplicationsClient" + }, + "method": { + "shortName": "GetApplication", + "fullName": "google.appengine.v1.Applications.GetApplication", + "service": { + "shortName": "Applications", + "fullName": "google.appengine.v1.Applications" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Applications_CreateApplication_async", + "title": "Applications createApplication Sample", + "origin": "API_DEFINITION", + "description": " Creates an App Engine application for a Google Cloud Platform project. Required fields: * `id` - The ID of the target Cloud Platform project. * *location* - The [region](https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located. For more information about App Engine applications, see [Managing Projects, Applications, and Billing](https://cloud.google.com/appengine/docs/standard/python/console/).", + "canonical": true, + "file": "applications.create_application.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApplication", + "fullName": "google.appengine.v1.Applications.CreateApplication", + "async": true, + "parameters": [ + { + "name": "application", + "type": ".google.appengine.v1.Application" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ApplicationsClient", + "fullName": "google.appengine.v1.ApplicationsClient" + }, + "method": { + "shortName": "CreateApplication", + "fullName": "google.appengine.v1.Applications.CreateApplication", + "service": { + "shortName": "Applications", + "fullName": "google.appengine.v1.Applications" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Applications_UpdateApplication_async", + "title": "Applications updateApplication Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified Application resource. You can update the following fields: * `auth_domain` - Google authentication domain for controlling user access to the application. * `default_cookie_expiration` - Cookie expiration policy for the application. * `iap` - Identity-Aware Proxy properties for the application.", + "canonical": true, + "file": "applications.update_application.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApplication", + "fullName": "google.appengine.v1.Applications.UpdateApplication", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "application", + "type": ".google.appengine.v1.Application" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ApplicationsClient", + "fullName": "google.appengine.v1.ApplicationsClient" + }, + "method": { + "shortName": "UpdateApplication", + "fullName": "google.appengine.v1.Applications.UpdateApplication", + "service": { + "shortName": "Applications", + "fullName": "google.appengine.v1.Applications" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Applications_RepairApplication_async", + "title": "Applications repairApplication Sample", + "origin": "API_DEFINITION", + "description": " Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, *Error retrieving the App Engine service account*. If you have deleted your App Engine service account, this will not be able to recreate it. Instead, you should attempt to use the IAM undelete API if possible at https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B\"name\"%3A\"projects%2F-%2FserviceAccounts%2Funique_id\"%2C\"resource\"%3A%7B%7D%7D . If the deletion was recent, the numeric ID can be found in the Cloud Console Activity Log.", + "canonical": true, + "file": "applications.repair_application.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RepairApplication", + "fullName": "google.appengine.v1.Applications.RepairApplication", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ApplicationsClient", + "fullName": "google.appengine.v1.ApplicationsClient" + }, + "method": { + "shortName": "RepairApplication", + "fullName": "google.appengine.v1.Applications.RepairApplication", + "service": { + "shortName": "Applications", + "fullName": "google.appengine.v1.Applications" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_AuthorizedCertificates_ListAuthorizedCertificates_async", + "title": "Applications listAuthorizedCertificates Sample", + "origin": "API_DEFINITION", + "description": " Lists all SSL certificates the user is authorized to administer.", + "canonical": true, + "file": "authorized_certificates.list_authorized_certificates.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAuthorizedCertificates", + "fullName": "google.appengine.v1.AuthorizedCertificates.ListAuthorizedCertificates", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.appengine.v1.AuthorizedCertificateView" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.ListAuthorizedCertificatesResponse", + "client": { + "shortName": "AuthorizedCertificatesClient", + "fullName": "google.appengine.v1.AuthorizedCertificatesClient" + }, + "method": { + "shortName": "ListAuthorizedCertificates", + "fullName": "google.appengine.v1.AuthorizedCertificates.ListAuthorizedCertificates", + "service": { + "shortName": "AuthorizedCertificates", + "fullName": "google.appengine.v1.AuthorizedCertificates" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_AuthorizedCertificates_GetAuthorizedCertificate_async", + "title": "Applications getAuthorizedCertificate Sample", + "origin": "API_DEFINITION", + "description": " Gets the specified SSL certificate.", + "canonical": true, + "file": "authorized_certificates.get_authorized_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAuthorizedCertificate", + "fullName": "google.appengine.v1.AuthorizedCertificates.GetAuthorizedCertificate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.appengine.v1.AuthorizedCertificateView" + } + ], + "resultType": ".google.appengine.v1.AuthorizedCertificate", + "client": { + "shortName": "AuthorizedCertificatesClient", + "fullName": "google.appengine.v1.AuthorizedCertificatesClient" + }, + "method": { + "shortName": "GetAuthorizedCertificate", + "fullName": "google.appengine.v1.AuthorizedCertificates.GetAuthorizedCertificate", + "service": { + "shortName": "AuthorizedCertificates", + "fullName": "google.appengine.v1.AuthorizedCertificates" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_AuthorizedCertificates_CreateAuthorizedCertificate_async", + "title": "Applications createAuthorizedCertificate Sample", + "origin": "API_DEFINITION", + "description": " Uploads the specified SSL certificate.", + "canonical": true, + "file": "authorized_certificates.create_authorized_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAuthorizedCertificate", + "fullName": "google.appengine.v1.AuthorizedCertificates.CreateAuthorizedCertificate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "certificate", + "type": ".google.appengine.v1.AuthorizedCertificate" + } + ], + "resultType": ".google.appengine.v1.AuthorizedCertificate", + "client": { + "shortName": "AuthorizedCertificatesClient", + "fullName": "google.appengine.v1.AuthorizedCertificatesClient" + }, + "method": { + "shortName": "CreateAuthorizedCertificate", + "fullName": "google.appengine.v1.AuthorizedCertificates.CreateAuthorizedCertificate", + "service": { + "shortName": "AuthorizedCertificates", + "fullName": "google.appengine.v1.AuthorizedCertificates" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_AuthorizedCertificates_UpdateAuthorizedCertificate_async", + "title": "Applications updateAuthorizedCertificate Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update `certificate_data` with a new certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate `display_name` may also be updated.", + "canonical": true, + "file": "authorized_certificates.update_authorized_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAuthorizedCertificate", + "fullName": "google.appengine.v1.AuthorizedCertificates.UpdateAuthorizedCertificate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "certificate", + "type": ".google.appengine.v1.AuthorizedCertificate" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.appengine.v1.AuthorizedCertificate", + "client": { + "shortName": "AuthorizedCertificatesClient", + "fullName": "google.appengine.v1.AuthorizedCertificatesClient" + }, + "method": { + "shortName": "UpdateAuthorizedCertificate", + "fullName": "google.appengine.v1.AuthorizedCertificates.UpdateAuthorizedCertificate", + "service": { + "shortName": "AuthorizedCertificates", + "fullName": "google.appengine.v1.AuthorizedCertificates" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_AuthorizedCertificates_DeleteAuthorizedCertificate_async", + "title": "Applications deleteAuthorizedCertificate Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified SSL certificate.", + "canonical": true, + "file": "authorized_certificates.delete_authorized_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAuthorizedCertificate", + "fullName": "google.appengine.v1.AuthorizedCertificates.DeleteAuthorizedCertificate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AuthorizedCertificatesClient", + "fullName": "google.appengine.v1.AuthorizedCertificatesClient" + }, + "method": { + "shortName": "DeleteAuthorizedCertificate", + "fullName": "google.appengine.v1.AuthorizedCertificates.DeleteAuthorizedCertificate", + "service": { + "shortName": "AuthorizedCertificates", + "fullName": "google.appengine.v1.AuthorizedCertificates" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_AuthorizedDomains_ListAuthorizedDomains_async", + "title": "Applications listAuthorizedDomains Sample", + "origin": "API_DEFINITION", + "description": " Lists all domains the user is authorized to administer.", + "canonical": true, + "file": "authorized_domains.list_authorized_domains.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAuthorizedDomains", + "fullName": "google.appengine.v1.AuthorizedDomains.ListAuthorizedDomains", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.ListAuthorizedDomainsResponse", + "client": { + "shortName": "AuthorizedDomainsClient", + "fullName": "google.appengine.v1.AuthorizedDomainsClient" + }, + "method": { + "shortName": "ListAuthorizedDomains", + "fullName": "google.appengine.v1.AuthorizedDomains.ListAuthorizedDomains", + "service": { + "shortName": "AuthorizedDomains", + "fullName": "google.appengine.v1.AuthorizedDomains" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_DomainMappings_ListDomainMappings_async", + "title": "Applications listDomainMappings Sample", + "origin": "API_DEFINITION", + "description": " Lists the domain mappings on an application.", + "canonical": true, + "file": "domain_mappings.list_domain_mappings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDomainMappings", + "fullName": "google.appengine.v1.DomainMappings.ListDomainMappings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.ListDomainMappingsResponse", + "client": { + "shortName": "DomainMappingsClient", + "fullName": "google.appengine.v1.DomainMappingsClient" + }, + "method": { + "shortName": "ListDomainMappings", + "fullName": "google.appengine.v1.DomainMappings.ListDomainMappings", + "service": { + "shortName": "DomainMappings", + "fullName": "google.appengine.v1.DomainMappings" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_DomainMappings_GetDomainMapping_async", + "title": "Applications getDomainMapping Sample", + "origin": "API_DEFINITION", + "description": " Gets the specified domain mapping.", + "canonical": true, + "file": "domain_mappings.get_domain_mapping.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDomainMapping", + "fullName": "google.appengine.v1.DomainMappings.GetDomainMapping", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.DomainMapping", + "client": { + "shortName": "DomainMappingsClient", + "fullName": "google.appengine.v1.DomainMappingsClient" + }, + "method": { + "shortName": "GetDomainMapping", + "fullName": "google.appengine.v1.DomainMappings.GetDomainMapping", + "service": { + "shortName": "DomainMappings", + "fullName": "google.appengine.v1.DomainMappings" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_DomainMappings_CreateDomainMapping_async", + "title": "Applications createDomainMapping Sample", + "origin": "API_DEFINITION", + "description": " Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see [`AuthorizedDomains.ListAuthorizedDomains`]().", + "canonical": true, + "file": "domain_mappings.create_domain_mapping.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDomainMapping", + "fullName": "google.appengine.v1.DomainMappings.CreateDomainMapping", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "domain_mapping", + "type": ".google.appengine.v1.DomainMapping" + }, + { + "name": "override_strategy", + "type": ".google.appengine.v1.DomainOverrideStrategy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DomainMappingsClient", + "fullName": "google.appengine.v1.DomainMappingsClient" + }, + "method": { + "shortName": "CreateDomainMapping", + "fullName": "google.appengine.v1.DomainMappings.CreateDomainMapping", + "service": { + "shortName": "DomainMappings", + "fullName": "google.appengine.v1.DomainMappings" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_DomainMappings_UpdateDomainMapping_async", + "title": "Applications updateDomainMapping Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update `certificate_id` to point to an `AuthorizedCertificate` resource. A user must be authorized to administer the associated domain in order to update a `DomainMapping` resource.", + "canonical": true, + "file": "domain_mappings.update_domain_mapping.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDomainMapping", + "fullName": "google.appengine.v1.DomainMappings.UpdateDomainMapping", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "domain_mapping", + "type": ".google.appengine.v1.DomainMapping" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DomainMappingsClient", + "fullName": "google.appengine.v1.DomainMappingsClient" + }, + "method": { + "shortName": "UpdateDomainMapping", + "fullName": "google.appengine.v1.DomainMappings.UpdateDomainMapping", + "service": { + "shortName": "DomainMappings", + "fullName": "google.appengine.v1.DomainMappings" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_DomainMappings_DeleteDomainMapping_async", + "title": "Applications deleteDomainMapping Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a `DomainMapping` resource.", + "canonical": true, + "file": "domain_mappings.delete_domain_mapping.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDomainMapping", + "fullName": "google.appengine.v1.DomainMappings.DeleteDomainMapping", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DomainMappingsClient", + "fullName": "google.appengine.v1.DomainMappingsClient" + }, + "method": { + "shortName": "DeleteDomainMapping", + "fullName": "google.appengine.v1.DomainMappings.DeleteDomainMapping", + "service": { + "shortName": "DomainMappings", + "fullName": "google.appengine.v1.DomainMappings" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Firewall_ListIngressRules_async", + "title": "Applications listIngressRules Sample", + "origin": "API_DEFINITION", + "description": " Lists the firewall rules of an application.", + "canonical": true, + "file": "firewall.list_ingress_rules.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListIngressRules", + "fullName": "google.appengine.v1.Firewall.ListIngressRules", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "matching_address", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.ListIngressRulesResponse", + "client": { + "shortName": "FirewallClient", + "fullName": "google.appengine.v1.FirewallClient" + }, + "method": { + "shortName": "ListIngressRules", + "fullName": "google.appengine.v1.Firewall.ListIngressRules", + "service": { + "shortName": "Firewall", + "fullName": "google.appengine.v1.Firewall" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Firewall_BatchUpdateIngressRules_async", + "title": "Applications batchUpdateIngressRules Sample", + "origin": "API_DEFINITION", + "description": " Replaces the entire firewall ruleset in one bulk operation. This overrides and replaces the rules of an existing firewall with the new rules. If the final rule does not match traffic with the '*' wildcard IP range, then an \"allow all\" rule is explicitly added to the end of the list.", + "canonical": true, + "file": "firewall.batch_update_ingress_rules.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchUpdateIngressRules", + "fullName": "google.appengine.v1.Firewall.BatchUpdateIngressRules", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "ingress_rules", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.appengine.v1.BatchUpdateIngressRulesResponse", + "client": { + "shortName": "FirewallClient", + "fullName": "google.appengine.v1.FirewallClient" + }, + "method": { + "shortName": "BatchUpdateIngressRules", + "fullName": "google.appengine.v1.Firewall.BatchUpdateIngressRules", + "service": { + "shortName": "Firewall", + "fullName": "google.appengine.v1.Firewall" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Firewall_CreateIngressRule_async", + "title": "Applications createIngressRule Sample", + "origin": "API_DEFINITION", + "description": " Creates a firewall rule for the application.", + "canonical": true, + "file": "firewall.create_ingress_rule.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateIngressRule", + "fullName": "google.appengine.v1.Firewall.CreateIngressRule", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "rule", + "type": ".google.appengine.v1.FirewallRule" + } + ], + "resultType": ".google.appengine.v1.FirewallRule", + "client": { + "shortName": "FirewallClient", + "fullName": "google.appengine.v1.FirewallClient" + }, + "method": { + "shortName": "CreateIngressRule", + "fullName": "google.appengine.v1.Firewall.CreateIngressRule", + "service": { + "shortName": "Firewall", + "fullName": "google.appengine.v1.Firewall" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Firewall_GetIngressRule_async", + "title": "Applications getIngressRule Sample", + "origin": "API_DEFINITION", + "description": " Gets the specified firewall rule.", + "canonical": true, + "file": "firewall.get_ingress_rule.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIngressRule", + "fullName": "google.appengine.v1.Firewall.GetIngressRule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.FirewallRule", + "client": { + "shortName": "FirewallClient", + "fullName": "google.appengine.v1.FirewallClient" + }, + "method": { + "shortName": "GetIngressRule", + "fullName": "google.appengine.v1.Firewall.GetIngressRule", + "service": { + "shortName": "Firewall", + "fullName": "google.appengine.v1.Firewall" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Firewall_UpdateIngressRule_async", + "title": "Applications updateIngressRule Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified firewall rule.", + "canonical": true, + "file": "firewall.update_ingress_rule.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateIngressRule", + "fullName": "google.appengine.v1.Firewall.UpdateIngressRule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "rule", + "type": ".google.appengine.v1.FirewallRule" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.appengine.v1.FirewallRule", + "client": { + "shortName": "FirewallClient", + "fullName": "google.appengine.v1.FirewallClient" + }, + "method": { + "shortName": "UpdateIngressRule", + "fullName": "google.appengine.v1.Firewall.UpdateIngressRule", + "service": { + "shortName": "Firewall", + "fullName": "google.appengine.v1.Firewall" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Firewall_DeleteIngressRule_async", + "title": "Applications deleteIngressRule Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified firewall rule.", + "canonical": true, + "file": "firewall.delete_ingress_rule.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteIngressRule", + "fullName": "google.appengine.v1.Firewall.DeleteIngressRule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "FirewallClient", + "fullName": "google.appengine.v1.FirewallClient" + }, + "method": { + "shortName": "DeleteIngressRule", + "fullName": "google.appengine.v1.Firewall.DeleteIngressRule", + "service": { + "shortName": "Firewall", + "fullName": "google.appengine.v1.Firewall" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Instances_ListInstances_async", + "title": "Applications listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists the instances of a version. Tip: To aggregate details about instances over time, see the [Stackdriver Monitoring API](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).", + "canonical": true, + "file": "instances.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.appengine.v1.Instances.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.ListInstancesResponse", + "client": { + "shortName": "InstancesClient", + "fullName": "google.appengine.v1.InstancesClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.appengine.v1.Instances.ListInstances", + "service": { + "shortName": "Instances", + "fullName": "google.appengine.v1.Instances" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Instances_GetInstance_async", + "title": "Applications getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets instance information.", + "canonical": true, + "file": "instances.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.appengine.v1.Instances.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.Instance", + "client": { + "shortName": "InstancesClient", + "fullName": "google.appengine.v1.InstancesClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.appengine.v1.Instances.GetInstance", + "service": { + "shortName": "Instances", + "fullName": "google.appengine.v1.Instances" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Instances_DeleteInstance_async", + "title": "Applications deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Stops a running instance. The instance might be automatically recreated based on the scaling settings of the version. For more information, see \"How Instances are Managed\" ([standard environment](https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed) | [flexible environment](https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed)). To ensure that instances are not re-created and avoid getting billed, you can stop all instances within the target version by changing the serving status of the version to `STOPPED` with the [`apps.services.versions.patch`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch) method.", + "canonical": true, + "file": "instances.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.appengine.v1.Instances.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.appengine.v1.InstancesClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.appengine.v1.Instances.DeleteInstance", + "service": { + "shortName": "Instances", + "fullName": "google.appengine.v1.Instances" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Instances_DebugInstance_async", + "title": "Applications debugInstance Sample", + "origin": "API_DEFINITION", + "description": " Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in \"debug mode\", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started. Only applicable for instances in App Engine flexible environment.", + "canonical": true, + "file": "instances.debug_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DebugInstance", + "fullName": "google.appengine.v1.Instances.DebugInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "ssh_key", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.appengine.v1.InstancesClient" + }, + "method": { + "shortName": "DebugInstance", + "fullName": "google.appengine.v1.Instances.DebugInstance", + "service": { + "shortName": "Instances", + "fullName": "google.appengine.v1.Instances" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Services_ListServices_async", + "title": "Applications listServices Sample", + "origin": "API_DEFINITION", + "description": " Lists all the services in the application.", + "canonical": true, + "file": "services.list_services.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListServices", + "fullName": "google.appengine.v1.Services.ListServices", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.ListServicesResponse", + "client": { + "shortName": "ServicesClient", + "fullName": "google.appengine.v1.ServicesClient" + }, + "method": { + "shortName": "ListServices", + "fullName": "google.appengine.v1.Services.ListServices", + "service": { + "shortName": "Services", + "fullName": "google.appengine.v1.Services" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Services_GetService_async", + "title": "Applications getService Sample", + "origin": "API_DEFINITION", + "description": " Gets the current configuration of the specified service.", + "canonical": true, + "file": "services.get_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetService", + "fullName": "google.appengine.v1.Services.GetService", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.Service", + "client": { + "shortName": "ServicesClient", + "fullName": "google.appengine.v1.ServicesClient" + }, + "method": { + "shortName": "GetService", + "fullName": "google.appengine.v1.Services.GetService", + "service": { + "shortName": "Services", + "fullName": "google.appengine.v1.Services" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Services_UpdateService_async", + "title": "Applications updateService Sample", + "origin": "API_DEFINITION", + "description": " Updates the configuration of the specified service.", + "canonical": true, + "file": "services.update_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateService", + "fullName": "google.appengine.v1.Services.UpdateService", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "service", + "type": ".google.appengine.v1.Service" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "migrate_traffic", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ServicesClient", + "fullName": "google.appengine.v1.ServicesClient" + }, + "method": { + "shortName": "UpdateService", + "fullName": "google.appengine.v1.Services.UpdateService", + "service": { + "shortName": "Services", + "fullName": "google.appengine.v1.Services" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Services_DeleteService_async", + "title": "Applications deleteService Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified service and all enclosed versions.", + "canonical": true, + "file": "services.delete_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteService", + "fullName": "google.appengine.v1.Services.DeleteService", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ServicesClient", + "fullName": "google.appengine.v1.ServicesClient" + }, + "method": { + "shortName": "DeleteService", + "fullName": "google.appengine.v1.Services.DeleteService", + "service": { + "shortName": "Services", + "fullName": "google.appengine.v1.Services" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Versions_ListVersions_async", + "title": "Applications listVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists the versions of a service.", + "canonical": true, + "file": "versions.list_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListVersions", + "fullName": "google.appengine.v1.Versions.ListVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.appengine.v1.VersionView" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.appengine.v1.ListVersionsResponse", + "client": { + "shortName": "VersionsClient", + "fullName": "google.appengine.v1.VersionsClient" + }, + "method": { + "shortName": "ListVersions", + "fullName": "google.appengine.v1.Versions.ListVersions", + "service": { + "shortName": "Versions", + "fullName": "google.appengine.v1.Versions" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Versions_GetVersion_async", + "title": "Applications getVersion Sample", + "origin": "API_DEFINITION", + "description": " Gets the specified Version resource. By default, only a `BASIC_VIEW` will be returned. Specify the `FULL_VIEW` parameter to get the full resource.", + "canonical": true, + "file": "versions.get_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetVersion", + "fullName": "google.appengine.v1.Versions.GetVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.appengine.v1.VersionView" + } + ], + "resultType": ".google.appengine.v1.Version", + "client": { + "shortName": "VersionsClient", + "fullName": "google.appengine.v1.VersionsClient" + }, + "method": { + "shortName": "GetVersion", + "fullName": "google.appengine.v1.Versions.GetVersion", + "service": { + "shortName": "Versions", + "fullName": "google.appengine.v1.Versions" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Versions_CreateVersion_async", + "title": "Applications createVersion Sample", + "origin": "API_DEFINITION", + "description": " Deploys code and resource files to a new version.", + "canonical": true, + "file": "versions.create_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateVersion", + "fullName": "google.appengine.v1.Versions.CreateVersion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "version", + "type": ".google.appengine.v1.Version" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VersionsClient", + "fullName": "google.appengine.v1.VersionsClient" + }, + "method": { + "shortName": "CreateVersion", + "fullName": "google.appengine.v1.Versions.CreateVersion", + "service": { + "shortName": "Versions", + "fullName": "google.appengine.v1.Versions" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Versions_UpdateVersion_async", + "title": "Applications updateVersion Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: **Standard environment** * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class) *automatic scaling* in the standard environment: * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) * [`automaticScaling.standard_scheduler_settings.max_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) * [`automaticScaling.standard_scheduler_settings.min_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) * [`automaticScaling.standard_scheduler_settings.target_cpu_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) * [`automaticScaling.standard_scheduler_settings.target_throughput_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) *basic scaling* or *manual scaling* in the standard environment: * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status) * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling) **Flexible environment** * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status) *automatic scaling* in the flexible environment: * [`automatic_scaling.min_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) * [`automatic_scaling.max_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) * [`automatic_scaling.cool_down_period_sec`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) * [`automatic_scaling.cpu_utilization.target_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) *manual scaling* in the flexible environment: * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling)", + "canonical": true, + "file": "versions.update_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateVersion", + "fullName": "google.appengine.v1.Versions.UpdateVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "version", + "type": ".google.appengine.v1.Version" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VersionsClient", + "fullName": "google.appengine.v1.VersionsClient" + }, + "method": { + "shortName": "UpdateVersion", + "fullName": "google.appengine.v1.Versions.UpdateVersion", + "service": { + "shortName": "Versions", + "fullName": "google.appengine.v1.Versions" + } + } + } + }, + { + "regionTag": "appengine_v1_generated_Versions_DeleteVersion_async", + "title": "Applications deleteVersion Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing Version resource.", + "canonical": true, + "file": "versions.delete_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteVersion", + "fullName": "google.appengine.v1.Versions.DeleteVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VersionsClient", + "fullName": "google.appengine.v1.VersionsClient" + }, + "method": { + "shortName": "DeleteVersion", + "fullName": "google.appengine.v1.Versions.DeleteVersion", + "service": { + "shortName": "Versions", + "fullName": "google.appengine.v1.Versions" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-appengine/samples/generated/v1/versions.create_version.js b/packages/google-appengine/samples/generated/v1/versions.create_version.js new file mode 100644 index 00000000000..276186c4dc3 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/versions.create_version.js @@ -0,0 +1,66 @@ +// 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() { + // [START appengine_v1_generated_Versions_CreateVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the parent resource to create this version under. Example: + * `apps/myapp/services/default`. + */ + // const parent = 'abc123' + /** + * Application deployment configuration. + */ + // const version = {} + + // Imports the Appengine library + const {VersionsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new VersionsClient(); + + async function callCreateVersion() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.createVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateVersion(); + // [END appengine_v1_generated_Versions_CreateVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/versions.delete_version.js b/packages/google-appengine/samples/generated/v1/versions.delete_version.js new file mode 100644 index 00000000000..0222462b369 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/versions.delete_version.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() { + // [START appengine_v1_generated_Versions_DeleteVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource requested. Example: + * `apps/myapp/services/default/versions/v1`. + */ + // const name = 'abc123' + + // Imports the Appengine library + const {VersionsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new VersionsClient(); + + async function callDeleteVersion() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.deleteVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteVersion(); + // [END appengine_v1_generated_Versions_DeleteVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/versions.get_version.js b/packages/google-appengine/samples/generated/v1/versions.get_version.js new file mode 100644 index 00000000000..3c3f3b872b2 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/versions.get_version.js @@ -0,0 +1,65 @@ +// 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() { + // [START appengine_v1_generated_Versions_GetVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource requested. Example: + * `apps/myapp/services/default/versions/v1`. + */ + // const name = 'abc123' + /** + * Controls the set of fields returned in the `Get` response. + */ + // const view = {} + + // Imports the Appengine library + const {VersionsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new VersionsClient(); + + async function callGetVersion() { + // Construct request + const request = { + }; + + // Run request + const response = await appengineClient.getVersion(request); + console.log(response); + } + + callGetVersion(); + // [END appengine_v1_generated_Versions_GetVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/versions.list_versions.js b/packages/google-appengine/samples/generated/v1/versions.list_versions.js new file mode 100644 index 00000000000..be939d3057e --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/versions.list_versions.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START appengine_v1_generated_Versions_ListVersions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the parent Service resource. Example: + * `apps/myapp/services/default`. + */ + // const parent = 'abc123' + /** + * Controls the set of fields returned in the `List` response. + */ + // const view = {} + /** + * Maximum results to return per page. + */ + // const pageSize = 1234 + /** + * Continuation token for fetching the next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Appengine library + const {VersionsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new VersionsClient(); + + async function callListVersions() { + // Construct request + const request = { + }; + + // Run request + const iterable = await appengineClient.listVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListVersions(); + // [END appengine_v1_generated_Versions_ListVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/generated/v1/versions.update_version.js b/packages/google-appengine/samples/generated/v1/versions.update_version.js new file mode 100644 index 00000000000..cc89e90abc5 --- /dev/null +++ b/packages/google-appengine/samples/generated/v1/versions.update_version.js @@ -0,0 +1,71 @@ +// 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() { + // [START appengine_v1_generated_Versions_UpdateVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the resource to update. Example: + * `apps/myapp/services/default/versions/1`. + */ + // const name = 'abc123' + /** + * A Version containing the updated resource. Only fields set in the field + * mask will be updated. + */ + // const version = {} + /** + * Standard field mask for the set of fields to be updated. + */ + // const updateMask = {} + + // Imports the Appengine library + const {VersionsClient} = require('@google-cloud/appengine-admin').v1; + + // Instantiates a client + const appengineClient = new VersionsClient(); + + async function callUpdateVersion() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await appengineClient.updateVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateVersion(); + // [END appengine_v1_generated_Versions_UpdateVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-appengine/samples/package.json b/packages/google-appengine/samples/package.json new file mode 100644 index 00000000000..6b9eb4095b5 --- /dev/null +++ b/packages/google-appengine/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-appengine-admin", + "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/appengine-admin": "^2.1.2" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} \ No newline at end of file diff --git a/packages/google-appengine/samples/quickstart.js b/packages/google-appengine/samples/quickstart.js new file mode 100644 index 00000000000..86cdd703ddb --- /dev/null +++ b/packages/google-appengine/samples/quickstart.js @@ -0,0 +1,45 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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'; + +async function main(projectId) { + // [START nodejs_appengine_admin_quickstart] + // Imports the Google Cloud client library + + const {ServicesClient} = require('@google-cloud/appengine-admin'); + + // TODO(developer): replace with your prefered project ID. + // const projectId = 'my-project' + + // Creates a client + const client = new ServicesClient(); + + async function listVersions() { + const [versions] = await client.listServices({ + parent: `apps/${projectId}`, + }); + console.info(versions); + } + listVersions(); + // [END nodejs_appengine_admin_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-appengine/samples/test/quickstart.js b/packages/google-appengine/samples/test/quickstart.js new file mode 100644 index 00000000000..95d2c9e9d85 --- /dev/null +++ b/packages/google-appengine/samples/test/quickstart.js @@ -0,0 +1,45 @@ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file 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 {ServicesClient} = require('@google-cloud/appengine-admin'); +// 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 ServicesClient(); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync(`node ./quickstart.js ${projectId}`, {cwd}); + assert.match(stdout, /\[[\s\S]*\[[\s\S]*\][\s\S]*\]/); + }); +}); diff --git a/packages/google-appengine/src/index.ts b/packages/google-appengine/src/index.ts new file mode 100644 index 00000000000..2dfc69cc8d8 --- /dev/null +++ b/packages/google-appengine/src/index.ts @@ -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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const ApplicationsClient = v1.ApplicationsClient; +type ApplicationsClient = v1.ApplicationsClient; +const AuthorizedCertificatesClient = v1.AuthorizedCertificatesClient; +type AuthorizedCertificatesClient = v1.AuthorizedCertificatesClient; +const AuthorizedDomainsClient = v1.AuthorizedDomainsClient; +type AuthorizedDomainsClient = v1.AuthorizedDomainsClient; +const DomainMappingsClient = v1.DomainMappingsClient; +type DomainMappingsClient = v1.DomainMappingsClient; +const FirewallClient = v1.FirewallClient; +type FirewallClient = v1.FirewallClient; +const InstancesClient = v1.InstancesClient; +type InstancesClient = v1.InstancesClient; +const ServicesClient = v1.ServicesClient; +type ServicesClient = v1.ServicesClient; +const VersionsClient = v1.VersionsClient; +type VersionsClient = v1.VersionsClient; + +export { + v1, + ApplicationsClient, + AuthorizedCertificatesClient, + AuthorizedDomainsClient, + DomainMappingsClient, + FirewallClient, + InstancesClient, + ServicesClient, + VersionsClient, +}; +export default { + v1, + ApplicationsClient, + AuthorizedCertificatesClient, + AuthorizedDomainsClient, + DomainMappingsClient, + FirewallClient, + InstancesClient, + ServicesClient, + VersionsClient, +}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-appengine/src/v1/applications_client.ts b/packages/google-appengine/src/v1/applications_client.ts new file mode 100644 index 00000000000..109bd922275 --- /dev/null +++ b/packages/google-appengine/src/v1/applications_client.ts @@ -0,0 +1,999 @@ +// 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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/applications_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './applications_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages App Engine applications. + * @class + * @memberof v1 + */ +export class ApplicationsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + applicationsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ApplicationsClient. + * + * @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 ApplicationsClient({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 ApplicationsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'apps/{app}/services/{service}/versions/{version}/instances/{instance}' + ), + }; + + 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=apps/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=apps/*}/locations', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=apps/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=apps/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createApplicationResponse = protoFilesRoot.lookup( + '.google.appengine.v1.Application' + ) as gax.protobuf.Type; + const createApplicationMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + const updateApplicationResponse = protoFilesRoot.lookup( + '.google.appengine.v1.Application' + ) as gax.protobuf.Type; + const updateApplicationMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + const repairApplicationResponse = protoFilesRoot.lookup( + '.google.appengine.v1.Application' + ) as gax.protobuf.Type; + const repairApplicationMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createApplication: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createApplicationResponse.decode.bind(createApplicationResponse), + createApplicationMetadata.decode.bind(createApplicationMetadata) + ), + updateApplication: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateApplicationResponse.decode.bind(updateApplicationResponse), + updateApplicationMetadata.decode.bind(updateApplicationMetadata) + ), + repairApplication: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + repairApplicationResponse.decode.bind(repairApplicationResponse), + repairApplicationMetadata.decode.bind(repairApplicationMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.appengine.v1.Applications', + 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.applicationsStub) { + return this.applicationsStub; + } + + // Put together the "service stub" for + // google.appengine.v1.Applications. + this.applicationsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.appengine.v1.Applications' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.appengine.v1.Applications, + 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 applicationsStubMethods = [ + 'getApplication', + 'createApplication', + 'updateApplication', + 'repairApplication', + ]; + for (const methodName of applicationsStubMethods) { + const callPromise = this.applicationsStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.applicationsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'appengine.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 'appengine.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/appengine.admin', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets information about an application. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Application resource to get. Example: `apps/myapp`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Application]{@link google.appengine.v1.Application}. + * 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/applications.get_application.js + * region_tag:appengine_v1_generated_Applications_GetApplication_async + */ + getApplication( + request?: protos.google.appengine.v1.IGetApplicationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IGetApplicationRequest | undefined, + {} | undefined + ] + >; + getApplication( + request: protos.google.appengine.v1.IGetApplicationRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IGetApplicationRequest | null | undefined, + {} | null | undefined + > + ): void; + getApplication( + request: protos.google.appengine.v1.IGetApplicationRequest, + callback: Callback< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IGetApplicationRequest | null | undefined, + {} | null | undefined + > + ): void; + getApplication( + request?: protos.google.appengine.v1.IGetApplicationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IGetApplicationRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IGetApplicationRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IGetApplicationRequest | 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.getApplication(request, options, callback); + } + + /** + * Creates an App Engine application for a Google Cloud Platform project. + * Required fields: + * + * * `id` - The ID of the target Cloud Platform project. + * * *location* - The [region](https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located. + * + * For more information about App Engine applications, see [Managing Projects, Applications, and Billing](https://cloud.google.com/appengine/docs/standard/python/console/). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.appengine.v1.Application} request.application + * Application 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 + * 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/applications.create_application.js + * region_tag:appengine_v1_generated_Applications_CreateApplication_async + */ + createApplication( + request?: protos.google.appengine.v1.ICreateApplicationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createApplication( + request: protos.google.appengine.v1.ICreateApplicationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createApplication( + request: protos.google.appengine.v1.ICreateApplicationRequest, + callback: Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createApplication( + request?: protos.google.appengine.v1.ICreateApplicationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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 || {}; + this.initialize(); + return this.innerApiCalls.createApplication(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createApplication()`. + * @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/applications.create_application.js + * region_tag:appengine_v1_generated_Applications_CreateApplication_async + */ + async checkCreateApplicationProgress( + name: string + ): Promise< + LROperation< + protos.google.appengine.v1.Application, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + 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.createApplication, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.appengine.v1.Application, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + /** + * Updates the specified Application resource. + * You can update the following fields: + * + * * `auth_domain` - Google authentication domain for controlling user access to the application. + * * `default_cookie_expiration` - Cookie expiration policy for the application. + * * `iap` - Identity-Aware Proxy properties for the application. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Application resource to update. Example: `apps/myapp`. + * @param {google.appengine.v1.Application} request.application + * An Application containing the updated resource. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Standard field mask for the set of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/applications.update_application.js + * region_tag:appengine_v1_generated_Applications_UpdateApplication_async + */ + updateApplication( + request?: protos.google.appengine.v1.IUpdateApplicationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateApplication( + request: protos.google.appengine.v1.IUpdateApplicationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateApplication( + request: protos.google.appengine.v1.IUpdateApplicationRequest, + callback: Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateApplication( + request?: protos.google.appengine.v1.IUpdateApplicationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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.updateApplication(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateApplication()`. + * @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/applications.update_application.js + * region_tag:appengine_v1_generated_Applications_UpdateApplication_async + */ + async checkUpdateApplicationProgress( + name: string + ): Promise< + LROperation< + protos.google.appengine.v1.Application, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + 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.updateApplication, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.appengine.v1.Application, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + /** + * Recreates the required App Engine features for the specified App Engine + * application, for example a Cloud Storage bucket or App Engine service + * account. + * Use this method if you receive an error message about a missing feature, + * for example, *Error retrieving the App Engine service account*. + * If you have deleted your App Engine service account, this will + * not be able to recreate it. Instead, you should attempt to use the + * IAM undelete API if possible at https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B"name"%3A"projects%2F-%2FserviceAccounts%2Funique_id"%2C"resource"%3A%7B%7D%7D . + * If the deletion was recent, the numeric ID can be found in the Cloud + * Console Activity Log. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the application to repair. Example: `apps/myapp` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/applications.repair_application.js + * region_tag:appengine_v1_generated_Applications_RepairApplication_async + */ + repairApplication( + request?: protos.google.appengine.v1.IRepairApplicationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + repairApplication( + request: protos.google.appengine.v1.IRepairApplicationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + repairApplication( + request: protos.google.appengine.v1.IRepairApplicationRequest, + callback: Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + repairApplication( + request?: protos.google.appengine.v1.IRepairApplicationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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.repairApplication(request, options, callback); + } + /** + * Check the status of the long running operation returned by `repairApplication()`. + * @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/applications.repair_application.js + * region_tag:appengine_v1_generated_Applications_RepairApplication_async + */ + async checkRepairApplicationProgress( + name: string + ): Promise< + LROperation< + protos.google.appengine.v1.Application, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + 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.repairApplication, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.appengine.v1.Application, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} app + * @param {string} service + * @param {string} version + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + app: string, + service: string, + version: string, + instance: string + ) { + return this.pathTemplates.instancePathTemplate.render({ + app: app, + service: service, + version: version, + instance: instance, + }); + } + + /** + * Parse the app from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the app. + */ + matchAppFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).app; + } + + /** + * Parse the service from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the service. + */ + matchServiceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).service; + } + + /** + * Parse the version from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the version. + */ + matchVersionFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).version; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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.applicationsStub && !this._terminated) { + return this.applicationsStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-appengine/src/v1/applications_client_config.json b/packages/google-appengine/src/v1/applications_client_config.json new file mode 100644 index 00000000000..2e17b8b8e5e --- /dev/null +++ b/packages/google-appengine/src/v1/applications_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.appengine.v1.Applications": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetApplication": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateApplication": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateApplication": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RepairApplication": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-appengine/src/v1/applications_proto_list.json b/packages/google-appengine/src/v1/applications_proto_list.json new file mode 100644 index 00000000000..1720df9ca9e --- /dev/null +++ b/packages/google-appengine/src/v1/applications_proto_list.json @@ -0,0 +1,18 @@ +[ + "../../protos/google/appengine/v1/app_yaml.proto", + "../../protos/google/appengine/v1/appengine.proto", + "../../protos/google/appengine/v1/application.proto", + "../../protos/google/appengine/v1/audit_data.proto", + "../../protos/google/appengine/v1/certificate.proto", + "../../protos/google/appengine/v1/deploy.proto", + "../../protos/google/appengine/v1/deployed_files.proto", + "../../protos/google/appengine/v1/domain.proto", + "../../protos/google/appengine/v1/domain_mapping.proto", + "../../protos/google/appengine/v1/firewall.proto", + "../../protos/google/appengine/v1/instance.proto", + "../../protos/google/appengine/v1/location.proto", + "../../protos/google/appengine/v1/network_settings.proto", + "../../protos/google/appengine/v1/operation.proto", + "../../protos/google/appengine/v1/service.proto", + "../../protos/google/appengine/v1/version.proto" +] diff --git a/packages/google-appengine/src/v1/authorized_certificates_client.ts b/packages/google-appengine/src/v1/authorized_certificates_client.ts new file mode 100644 index 00000000000..2ea6326d3f3 --- /dev/null +++ b/packages/google-appengine/src/v1/authorized_certificates_client.ts @@ -0,0 +1,1039 @@ +// 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, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/authorized_certificates_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './authorized_certificates_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages SSL certificates a user is authorized to administer. A user can + * administer any SSL certificates applicable to their authorized domains. + * @class + * @memberof v1 + */ +export class AuthorizedCertificatesClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + authorizedCertificatesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AuthorizedCertificatesClient. + * + * @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 AuthorizedCertificatesClient({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 AuthorizedCertificatesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'apps/{app}/services/{service}/versions/{version}/instances/{instance}' + ), + }; + + // 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 = { + listAuthorizedCertificates: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificates' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.appengine.v1.AuthorizedCertificates', + 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.authorizedCertificatesStub) { + return this.authorizedCertificatesStub; + } + + // Put together the "service stub" for + // google.appengine.v1.AuthorizedCertificates. + this.authorizedCertificatesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.appengine.v1.AuthorizedCertificates' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.appengine.v1.AuthorizedCertificates, + 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 authorizedCertificatesStubMethods = [ + 'listAuthorizedCertificates', + 'getAuthorizedCertificate', + 'createAuthorizedCertificate', + 'updateAuthorizedCertificate', + 'deleteAuthorizedCertificate', + ]; + for (const methodName of authorizedCertificatesStubMethods) { + const callPromise = this.authorizedCertificatesStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.authorizedCertificatesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'appengine.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 'appengine.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/appengine.admin', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets the specified SSL certificate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource requested. Example: + * `apps/myapp/authorizedCertificates/12345`. + * @param {google.appengine.v1.AuthorizedCertificateView} request.view + * Controls the set of fields returned in the `GET` response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AuthorizedCertificate]{@link google.appengine.v1.AuthorizedCertificate}. + * 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/authorized_certificates.get_authorized_certificate.js + * region_tag:appengine_v1_generated_AuthorizedCertificates_GetAuthorizedCertificate_async + */ + getAuthorizedCertificate( + request?: protos.google.appengine.v1.IGetAuthorizedCertificateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IAuthorizedCertificate, + protos.google.appengine.v1.IGetAuthorizedCertificateRequest | undefined, + {} | undefined + ] + >; + getAuthorizedCertificate( + request: protos.google.appengine.v1.IGetAuthorizedCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.IGetAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAuthorizedCertificate( + request: protos.google.appengine.v1.IGetAuthorizedCertificateRequest, + callback: Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.IGetAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAuthorizedCertificate( + request?: protos.google.appengine.v1.IGetAuthorizedCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.IGetAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.IGetAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IAuthorizedCertificate, + protos.google.appengine.v1.IGetAuthorizedCertificateRequest | 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.getAuthorizedCertificate( + request, + options, + callback + ); + } + /** + * Uploads the specified SSL certificate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent `Application` resource. Example: `apps/myapp`. + * @param {google.appengine.v1.AuthorizedCertificate} request.certificate + * SSL certificate data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AuthorizedCertificate]{@link google.appengine.v1.AuthorizedCertificate}. + * 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/authorized_certificates.create_authorized_certificate.js + * region_tag:appengine_v1_generated_AuthorizedCertificates_CreateAuthorizedCertificate_async + */ + createAuthorizedCertificate( + request?: protos.google.appengine.v1.ICreateAuthorizedCertificateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IAuthorizedCertificate, + ( + | protos.google.appengine.v1.ICreateAuthorizedCertificateRequest + | undefined + ), + {} | undefined + ] + >; + createAuthorizedCertificate( + request: protos.google.appengine.v1.ICreateAuthorizedCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.ICreateAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAuthorizedCertificate( + request: protos.google.appengine.v1.ICreateAuthorizedCertificateRequest, + callback: Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.ICreateAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAuthorizedCertificate( + request?: protos.google.appengine.v1.ICreateAuthorizedCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.ICreateAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.ICreateAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IAuthorizedCertificate, + ( + | protos.google.appengine.v1.ICreateAuthorizedCertificateRequest + | 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.createAuthorizedCertificate( + request, + options, + callback + ); + } + /** + * Updates the specified SSL certificate. To renew a certificate and maintain + * its existing domain mappings, update `certificate_data` with a new + * certificate. The new certificate must be applicable to the same domains as + * the original certificate. The certificate `display_name` may also be + * updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource to update. Example: + * `apps/myapp/authorizedCertificates/12345`. + * @param {google.appengine.v1.AuthorizedCertificate} request.certificate + * An `AuthorizedCertificate` containing the updated resource. Only fields set + * in the field mask will be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Standard field mask for the set of fields to be updated. Updates are only + * supported on the `certificate_raw_data` and `display_name` fields. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AuthorizedCertificate]{@link google.appengine.v1.AuthorizedCertificate}. + * 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/authorized_certificates.update_authorized_certificate.js + * region_tag:appengine_v1_generated_AuthorizedCertificates_UpdateAuthorizedCertificate_async + */ + updateAuthorizedCertificate( + request?: protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IAuthorizedCertificate, + ( + | protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest + | undefined + ), + {} | undefined + ] + >; + updateAuthorizedCertificate( + request: protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAuthorizedCertificate( + request: protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest, + callback: Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAuthorizedCertificate( + request?: protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IAuthorizedCertificate, + ( + | protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest + | 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.updateAuthorizedCertificate( + request, + options, + callback + ); + } + /** + * Deletes the specified SSL certificate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource to delete. Example: + * `apps/myapp/authorizedCertificates/12345`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * 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/authorized_certificates.delete_authorized_certificate.js + * region_tag:appengine_v1_generated_AuthorizedCertificates_DeleteAuthorizedCertificate_async + */ + deleteAuthorizedCertificate( + request?: protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest + | undefined + ), + {} | undefined + ] + >; + deleteAuthorizedCertificate( + request: protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAuthorizedCertificate( + request: protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAuthorizedCertificate( + request?: protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest + | 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.deleteAuthorizedCertificate( + request, + options, + callback + ); + } + + /** + * Lists all SSL certificates the user is authorized to administer. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent `Application` resource. Example: `apps/myapp`. + * @param {google.appengine.v1.AuthorizedCertificateView} request.view + * Controls the set of fields returned in the `LIST` response. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [AuthorizedCertificate]{@link google.appengine.v1.AuthorizedCertificate}. + * 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 `listAuthorizedCertificatesAsync()` + * 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. + */ + listAuthorizedCertificates( + request?: protos.google.appengine.v1.IListAuthorizedCertificatesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IAuthorizedCertificate[], + protos.google.appengine.v1.IListAuthorizedCertificatesRequest | null, + protos.google.appengine.v1.IListAuthorizedCertificatesResponse + ] + >; + listAuthorizedCertificates( + request: protos.google.appengine.v1.IListAuthorizedCertificatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.appengine.v1.IListAuthorizedCertificatesRequest, + | protos.google.appengine.v1.IListAuthorizedCertificatesResponse + | null + | undefined, + protos.google.appengine.v1.IAuthorizedCertificate + > + ): void; + listAuthorizedCertificates( + request: protos.google.appengine.v1.IListAuthorizedCertificatesRequest, + callback: PaginationCallback< + protos.google.appengine.v1.IListAuthorizedCertificatesRequest, + | protos.google.appengine.v1.IListAuthorizedCertificatesResponse + | null + | undefined, + protos.google.appengine.v1.IAuthorizedCertificate + > + ): void; + listAuthorizedCertificates( + request?: protos.google.appengine.v1.IListAuthorizedCertificatesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.appengine.v1.IListAuthorizedCertificatesRequest, + | protos.google.appengine.v1.IListAuthorizedCertificatesResponse + | null + | undefined, + protos.google.appengine.v1.IAuthorizedCertificate + >, + callback?: PaginationCallback< + protos.google.appengine.v1.IListAuthorizedCertificatesRequest, + | protos.google.appengine.v1.IListAuthorizedCertificatesResponse + | null + | undefined, + protos.google.appengine.v1.IAuthorizedCertificate + > + ): Promise< + [ + protos.google.appengine.v1.IAuthorizedCertificate[], + protos.google.appengine.v1.IListAuthorizedCertificatesRequest | null, + protos.google.appengine.v1.IListAuthorizedCertificatesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listAuthorizedCertificates( + 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 + * Name of the parent `Application` resource. Example: `apps/myapp`. + * @param {google.appengine.v1.AuthorizedCertificateView} request.view + * Controls the set of fields returned in the `LIST` response. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [AuthorizedCertificate]{@link google.appengine.v1.AuthorizedCertificate} 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 `listAuthorizedCertificatesAsync()` + * 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. + */ + listAuthorizedCertificatesStream( + request?: protos.google.appengine.v1.IListAuthorizedCertificatesRequest, + 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['listAuthorizedCertificates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAuthorizedCertificates.createStream( + this.innerApiCalls.listAuthorizedCertificates as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAuthorizedCertificates`, 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 + * Name of the parent `Application` resource. Example: `apps/myapp`. + * @param {google.appengine.v1.AuthorizedCertificateView} request.view + * Controls the set of fields returned in the `LIST` response. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [AuthorizedCertificate]{@link google.appengine.v1.AuthorizedCertificate}. 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/authorized_certificates.list_authorized_certificates.js + * region_tag:appengine_v1_generated_AuthorizedCertificates_ListAuthorizedCertificates_async + */ + listAuthorizedCertificatesAsync( + request?: protos.google.appengine.v1.IListAuthorizedCertificatesRequest, + 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['listAuthorizedCertificates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAuthorizedCertificates.asyncIterate( + this.innerApiCalls['listAuthorizedCertificates'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} app + * @param {string} service + * @param {string} version + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + app: string, + service: string, + version: string, + instance: string + ) { + return this.pathTemplates.instancePathTemplate.render({ + app: app, + service: service, + version: version, + instance: instance, + }); + } + + /** + * Parse the app from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the app. + */ + matchAppFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).app; + } + + /** + * Parse the service from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the service. + */ + matchServiceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).service; + } + + /** + * Parse the version from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the version. + */ + matchVersionFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).version; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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.authorizedCertificatesStub && !this._terminated) { + return this.authorizedCertificatesStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-appengine/src/v1/authorized_certificates_client_config.json b/packages/google-appengine/src/v1/authorized_certificates_client_config.json new file mode 100644 index 00000000000..8ca93693780 --- /dev/null +++ b/packages/google-appengine/src/v1/authorized_certificates_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.appengine.v1.AuthorizedCertificates": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAuthorizedCertificates": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAuthorizedCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAuthorizedCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAuthorizedCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAuthorizedCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-appengine/src/v1/authorized_certificates_proto_list.json b/packages/google-appengine/src/v1/authorized_certificates_proto_list.json new file mode 100644 index 00000000000..1720df9ca9e --- /dev/null +++ b/packages/google-appengine/src/v1/authorized_certificates_proto_list.json @@ -0,0 +1,18 @@ +[ + "../../protos/google/appengine/v1/app_yaml.proto", + "../../protos/google/appengine/v1/appengine.proto", + "../../protos/google/appengine/v1/application.proto", + "../../protos/google/appengine/v1/audit_data.proto", + "../../protos/google/appengine/v1/certificate.proto", + "../../protos/google/appengine/v1/deploy.proto", + "../../protos/google/appengine/v1/deployed_files.proto", + "../../protos/google/appengine/v1/domain.proto", + "../../protos/google/appengine/v1/domain_mapping.proto", + "../../protos/google/appengine/v1/firewall.proto", + "../../protos/google/appengine/v1/instance.proto", + "../../protos/google/appengine/v1/location.proto", + "../../protos/google/appengine/v1/network_settings.proto", + "../../protos/google/appengine/v1/operation.proto", + "../../protos/google/appengine/v1/service.proto", + "../../protos/google/appengine/v1/version.proto" +] diff --git a/packages/google-appengine/src/v1/authorized_domains_client.ts b/packages/google-appengine/src/v1/authorized_domains_client.ts new file mode 100644 index 00000000000..0e4986e3c50 --- /dev/null +++ b/packages/google-appengine/src/v1/authorized_domains_client.ts @@ -0,0 +1,608 @@ +// 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, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/authorized_domains_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './authorized_domains_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages domains a user is authorized to administer. To authorize use of a + * domain, verify ownership via + * [Webmaster Central](https://www.google.com/webmasters/verification/home). + * @class + * @memberof v1 + */ +export class AuthorizedDomainsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + authorizedDomainsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AuthorizedDomainsClient. + * + * @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 AuthorizedDomainsClient({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 AuthorizedDomainsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'apps/{app}/services/{service}/versions/{version}/instances/{instance}' + ), + }; + + // 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 = { + listAuthorizedDomains: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'domains' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.appengine.v1.AuthorizedDomains', + 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.authorizedDomainsStub) { + return this.authorizedDomainsStub; + } + + // Put together the "service stub" for + // google.appengine.v1.AuthorizedDomains. + this.authorizedDomainsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.appengine.v1.AuthorizedDomains' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.appengine.v1.AuthorizedDomains, + 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 authorizedDomainsStubMethods = ['listAuthorizedDomains']; + for (const methodName of authorizedDomainsStubMethods) { + const callPromise = this.authorizedDomainsStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.authorizedDomainsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'appengine.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 'appengine.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/appengine.admin', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Lists all domains the user is authorized to administer. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent Application resource. Example: `apps/myapp`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [AuthorizedDomain]{@link google.appengine.v1.AuthorizedDomain}. + * 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 `listAuthorizedDomainsAsync()` + * 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. + */ + listAuthorizedDomains( + request?: protos.google.appengine.v1.IListAuthorizedDomainsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IAuthorizedDomain[], + protos.google.appengine.v1.IListAuthorizedDomainsRequest | null, + protos.google.appengine.v1.IListAuthorizedDomainsResponse + ] + >; + listAuthorizedDomains( + request: protos.google.appengine.v1.IListAuthorizedDomainsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.appengine.v1.IListAuthorizedDomainsRequest, + | protos.google.appengine.v1.IListAuthorizedDomainsResponse + | null + | undefined, + protos.google.appengine.v1.IAuthorizedDomain + > + ): void; + listAuthorizedDomains( + request: protos.google.appengine.v1.IListAuthorizedDomainsRequest, + callback: PaginationCallback< + protos.google.appengine.v1.IListAuthorizedDomainsRequest, + | protos.google.appengine.v1.IListAuthorizedDomainsResponse + | null + | undefined, + protos.google.appengine.v1.IAuthorizedDomain + > + ): void; + listAuthorizedDomains( + request?: protos.google.appengine.v1.IListAuthorizedDomainsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.appengine.v1.IListAuthorizedDomainsRequest, + | protos.google.appengine.v1.IListAuthorizedDomainsResponse + | null + | undefined, + protos.google.appengine.v1.IAuthorizedDomain + >, + callback?: PaginationCallback< + protos.google.appengine.v1.IListAuthorizedDomainsRequest, + | protos.google.appengine.v1.IListAuthorizedDomainsResponse + | null + | undefined, + protos.google.appengine.v1.IAuthorizedDomain + > + ): Promise< + [ + protos.google.appengine.v1.IAuthorizedDomain[], + protos.google.appengine.v1.IListAuthorizedDomainsRequest | null, + protos.google.appengine.v1.IListAuthorizedDomainsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listAuthorizedDomains(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 + * Name of the parent Application resource. Example: `apps/myapp`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [AuthorizedDomain]{@link google.appengine.v1.AuthorizedDomain} 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 `listAuthorizedDomainsAsync()` + * 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. + */ + listAuthorizedDomainsStream( + request?: protos.google.appengine.v1.IListAuthorizedDomainsRequest, + 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['listAuthorizedDomains']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAuthorizedDomains.createStream( + this.innerApiCalls.listAuthorizedDomains as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAuthorizedDomains`, 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 + * Name of the parent Application resource. Example: `apps/myapp`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [AuthorizedDomain]{@link google.appengine.v1.AuthorizedDomain}. 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/authorized_domains.list_authorized_domains.js + * region_tag:appengine_v1_generated_AuthorizedDomains_ListAuthorizedDomains_async + */ + listAuthorizedDomainsAsync( + request?: protos.google.appengine.v1.IListAuthorizedDomainsRequest, + 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['listAuthorizedDomains']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAuthorizedDomains.asyncIterate( + this.innerApiCalls['listAuthorizedDomains'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} app + * @param {string} service + * @param {string} version + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + app: string, + service: string, + version: string, + instance: string + ) { + return this.pathTemplates.instancePathTemplate.render({ + app: app, + service: service, + version: version, + instance: instance, + }); + } + + /** + * Parse the app from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the app. + */ + matchAppFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).app; + } + + /** + * Parse the service from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the service. + */ + matchServiceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).service; + } + + /** + * Parse the version from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the version. + */ + matchVersionFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).version; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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.authorizedDomainsStub && !this._terminated) { + return this.authorizedDomainsStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-appengine/src/v1/authorized_domains_client_config.json b/packages/google-appengine/src/v1/authorized_domains_client_config.json new file mode 100644 index 00000000000..895f9837c5b --- /dev/null +++ b/packages/google-appengine/src/v1/authorized_domains_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.appengine.v1.AuthorizedDomains": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAuthorizedDomains": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-appengine/src/v1/authorized_domains_proto_list.json b/packages/google-appengine/src/v1/authorized_domains_proto_list.json new file mode 100644 index 00000000000..1720df9ca9e --- /dev/null +++ b/packages/google-appengine/src/v1/authorized_domains_proto_list.json @@ -0,0 +1,18 @@ +[ + "../../protos/google/appengine/v1/app_yaml.proto", + "../../protos/google/appengine/v1/appengine.proto", + "../../protos/google/appengine/v1/application.proto", + "../../protos/google/appengine/v1/audit_data.proto", + "../../protos/google/appengine/v1/certificate.proto", + "../../protos/google/appengine/v1/deploy.proto", + "../../protos/google/appengine/v1/deployed_files.proto", + "../../protos/google/appengine/v1/domain.proto", + "../../protos/google/appengine/v1/domain_mapping.proto", + "../../protos/google/appengine/v1/firewall.proto", + "../../protos/google/appengine/v1/instance.proto", + "../../protos/google/appengine/v1/location.proto", + "../../protos/google/appengine/v1/network_settings.proto", + "../../protos/google/appengine/v1/operation.proto", + "../../protos/google/appengine/v1/service.proto", + "../../protos/google/appengine/v1/version.proto" +] diff --git a/packages/google-appengine/src/v1/domain_mappings_client.ts b/packages/google-appengine/src/v1/domain_mappings_client.ts new file mode 100644 index 00000000000..cc6362688e4 --- /dev/null +++ b/packages/google-appengine/src/v1/domain_mappings_client.ts @@ -0,0 +1,1201 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/domain_mappings_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './domain_mappings_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages domains serving an application. + * @class + * @memberof v1 + */ +export class DomainMappingsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + domainMappingsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DomainMappingsClient. + * + * @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 DomainMappingsClient({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 DomainMappingsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'apps/{app}/services/{service}/versions/{version}/instances/{instance}' + ), + }; + + // 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 = { + listDomainMappings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'domainMappings' + ), + }; + + 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=apps/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=apps/*}/locations', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=apps/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=apps/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createDomainMappingResponse = protoFilesRoot.lookup( + '.google.appengine.v1.DomainMapping' + ) as gax.protobuf.Type; + const createDomainMappingMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + const updateDomainMappingResponse = protoFilesRoot.lookup( + '.google.appengine.v1.DomainMapping' + ) as gax.protobuf.Type; + const updateDomainMappingMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + const deleteDomainMappingResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteDomainMappingMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createDomainMapping: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDomainMappingResponse.decode.bind(createDomainMappingResponse), + createDomainMappingMetadata.decode.bind(createDomainMappingMetadata) + ), + updateDomainMapping: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDomainMappingResponse.decode.bind(updateDomainMappingResponse), + updateDomainMappingMetadata.decode.bind(updateDomainMappingMetadata) + ), + deleteDomainMapping: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDomainMappingResponse.decode.bind(deleteDomainMappingResponse), + deleteDomainMappingMetadata.decode.bind(deleteDomainMappingMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.appengine.v1.DomainMappings', + 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.domainMappingsStub) { + return this.domainMappingsStub; + } + + // Put together the "service stub" for + // google.appengine.v1.DomainMappings. + this.domainMappingsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.appengine.v1.DomainMappings' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.appengine.v1.DomainMappings, + 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 domainMappingsStubMethods = [ + 'listDomainMappings', + 'getDomainMapping', + 'createDomainMapping', + 'updateDomainMapping', + 'deleteDomainMapping', + ]; + for (const methodName of domainMappingsStubMethods) { + const callPromise = this.domainMappingsStub.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.domainMappingsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'appengine.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 'appengine.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/appengine.admin', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets the specified domain mapping. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource requested. Example: + * `apps/myapp/domainMappings/example.com`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DomainMapping]{@link google.appengine.v1.DomainMapping}. + * 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/domain_mappings.get_domain_mapping.js + * region_tag:appengine_v1_generated_DomainMappings_GetDomainMapping_async + */ + getDomainMapping( + request?: protos.google.appengine.v1.IGetDomainMappingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IGetDomainMappingRequest | undefined, + {} | undefined + ] + >; + getDomainMapping( + request: protos.google.appengine.v1.IGetDomainMappingRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IGetDomainMappingRequest | null | undefined, + {} | null | undefined + > + ): void; + getDomainMapping( + request: protos.google.appengine.v1.IGetDomainMappingRequest, + callback: Callback< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IGetDomainMappingRequest | null | undefined, + {} | null | undefined + > + ): void; + getDomainMapping( + request?: protos.google.appengine.v1.IGetDomainMappingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IDomainMapping, + | protos.google.appengine.v1.IGetDomainMappingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IGetDomainMappingRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IGetDomainMappingRequest | 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.getDomainMapping(request, options, callback); + } + + /** + * Maps a domain to an application. A user must be authorized to administer a + * domain in order to map it to an application. For a list of available + * authorized domains, see [`AuthorizedDomains.ListAuthorizedDomains`](). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent Application resource. Example: `apps/myapp`. + * @param {google.appengine.v1.DomainMapping} request.domainMapping + * Domain mapping configuration. + * @param {google.appengine.v1.DomainOverrideStrategy} request.overrideStrategy + * Whether the domain creation should override any existing mappings for this + * domain. By default, overrides are rejected. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/domain_mappings.create_domain_mapping.js + * region_tag:appengine_v1_generated_DomainMappings_CreateDomainMapping_async + */ + createDomainMapping( + request?: protos.google.appengine.v1.ICreateDomainMappingRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createDomainMapping( + request: protos.google.appengine.v1.ICreateDomainMappingRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDomainMapping( + request: protos.google.appengine.v1.ICreateDomainMappingRequest, + callback: Callback< + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDomainMapping( + request?: protos.google.appengine.v1.ICreateDomainMappingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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.createDomainMapping(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createDomainMapping()`. + * @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/domain_mappings.create_domain_mapping.js + * region_tag:appengine_v1_generated_DomainMappings_CreateDomainMapping_async + */ + async checkCreateDomainMappingProgress( + name: string + ): Promise< + LROperation< + protos.google.appengine.v1.DomainMapping, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + 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.createDomainMapping, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.appengine.v1.DomainMapping, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + /** + * Updates the specified domain mapping. To map an SSL certificate to a + * domain mapping, update `certificate_id` to point to an `AuthorizedCertificate` + * resource. A user must be authorized to administer the associated domain + * in order to update a `DomainMapping` resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource to update. Example: + * `apps/myapp/domainMappings/example.com`. + * @param {google.appengine.v1.DomainMapping} request.domainMapping + * A domain mapping containing the updated resource. Only fields set + * in the field mask will be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Standard field mask for the set of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/domain_mappings.update_domain_mapping.js + * region_tag:appengine_v1_generated_DomainMappings_UpdateDomainMapping_async + */ + updateDomainMapping( + request?: protos.google.appengine.v1.IUpdateDomainMappingRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateDomainMapping( + request: protos.google.appengine.v1.IUpdateDomainMappingRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDomainMapping( + request: protos.google.appengine.v1.IUpdateDomainMappingRequest, + callback: Callback< + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDomainMapping( + request?: protos.google.appengine.v1.IUpdateDomainMappingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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.updateDomainMapping(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateDomainMapping()`. + * @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/domain_mappings.update_domain_mapping.js + * region_tag:appengine_v1_generated_DomainMappings_UpdateDomainMapping_async + */ + async checkUpdateDomainMappingProgress( + name: string + ): Promise< + LROperation< + protos.google.appengine.v1.DomainMapping, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + 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.updateDomainMapping, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.appengine.v1.DomainMapping, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + /** + * Deletes the specified domain mapping. A user must be authorized to + * administer the associated domain in order to delete a `DomainMapping` + * resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource to delete. Example: + * `apps/myapp/domainMappings/example.com`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/domain_mappings.delete_domain_mapping.js + * region_tag:appengine_v1_generated_DomainMappings_DeleteDomainMapping_async + */ + deleteDomainMapping( + request?: protos.google.appengine.v1.IDeleteDomainMappingRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteDomainMapping( + request: protos.google.appengine.v1.IDeleteDomainMappingRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDomainMapping( + request: protos.google.appengine.v1.IDeleteDomainMappingRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDomainMapping( + request?: protos.google.appengine.v1.IDeleteDomainMappingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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.deleteDomainMapping(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteDomainMapping()`. + * @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/domain_mappings.delete_domain_mapping.js + * region_tag:appengine_v1_generated_DomainMappings_DeleteDomainMapping_async + */ + async checkDeleteDomainMappingProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + 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.deleteDomainMapping, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + /** + * Lists the domain mappings on an application. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent Application resource. Example: `apps/myapp`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DomainMapping]{@link google.appengine.v1.DomainMapping}. + * 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 `listDomainMappingsAsync()` + * 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. + */ + listDomainMappings( + request?: protos.google.appengine.v1.IListDomainMappingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IDomainMapping[], + protos.google.appengine.v1.IListDomainMappingsRequest | null, + protos.google.appengine.v1.IListDomainMappingsResponse + ] + >; + listDomainMappings( + request: protos.google.appengine.v1.IListDomainMappingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.appengine.v1.IListDomainMappingsRequest, + protos.google.appengine.v1.IListDomainMappingsResponse | null | undefined, + protos.google.appengine.v1.IDomainMapping + > + ): void; + listDomainMappings( + request: protos.google.appengine.v1.IListDomainMappingsRequest, + callback: PaginationCallback< + protos.google.appengine.v1.IListDomainMappingsRequest, + protos.google.appengine.v1.IListDomainMappingsResponse | null | undefined, + protos.google.appengine.v1.IDomainMapping + > + ): void; + listDomainMappings( + request?: protos.google.appengine.v1.IListDomainMappingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.appengine.v1.IListDomainMappingsRequest, + | protos.google.appengine.v1.IListDomainMappingsResponse + | null + | undefined, + protos.google.appengine.v1.IDomainMapping + >, + callback?: PaginationCallback< + protos.google.appengine.v1.IListDomainMappingsRequest, + protos.google.appengine.v1.IListDomainMappingsResponse | null | undefined, + protos.google.appengine.v1.IDomainMapping + > + ): Promise< + [ + protos.google.appengine.v1.IDomainMapping[], + protos.google.appengine.v1.IListDomainMappingsRequest | null, + protos.google.appengine.v1.IListDomainMappingsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listDomainMappings(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 + * Name of the parent Application resource. Example: `apps/myapp`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DomainMapping]{@link google.appengine.v1.DomainMapping} 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 `listDomainMappingsAsync()` + * 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. + */ + listDomainMappingsStream( + request?: protos.google.appengine.v1.IListDomainMappingsRequest, + 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['listDomainMappings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDomainMappings.createStream( + this.innerApiCalls.listDomainMappings as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDomainMappings`, 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 + * Name of the parent Application resource. Example: `apps/myapp`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [DomainMapping]{@link google.appengine.v1.DomainMapping}. 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/domain_mappings.list_domain_mappings.js + * region_tag:appengine_v1_generated_DomainMappings_ListDomainMappings_async + */ + listDomainMappingsAsync( + request?: protos.google.appengine.v1.IListDomainMappingsRequest, + 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['listDomainMappings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDomainMappings.asyncIterate( + this.innerApiCalls['listDomainMappings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} app + * @param {string} service + * @param {string} version + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + app: string, + service: string, + version: string, + instance: string + ) { + return this.pathTemplates.instancePathTemplate.render({ + app: app, + service: service, + version: version, + instance: instance, + }); + } + + /** + * Parse the app from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the app. + */ + matchAppFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).app; + } + + /** + * Parse the service from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the service. + */ + matchServiceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).service; + } + + /** + * Parse the version from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the version. + */ + matchVersionFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).version; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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.domainMappingsStub && !this._terminated) { + return this.domainMappingsStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-appengine/src/v1/domain_mappings_client_config.json b/packages/google-appengine/src/v1/domain_mappings_client_config.json new file mode 100644 index 00000000000..9ccf48daec9 --- /dev/null +++ b/packages/google-appengine/src/v1/domain_mappings_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.appengine.v1.DomainMappings": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListDomainMappings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDomainMapping": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateDomainMapping": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDomainMapping": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDomainMapping": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-appengine/src/v1/domain_mappings_proto_list.json b/packages/google-appengine/src/v1/domain_mappings_proto_list.json new file mode 100644 index 00000000000..1720df9ca9e --- /dev/null +++ b/packages/google-appengine/src/v1/domain_mappings_proto_list.json @@ -0,0 +1,18 @@ +[ + "../../protos/google/appengine/v1/app_yaml.proto", + "../../protos/google/appengine/v1/appengine.proto", + "../../protos/google/appengine/v1/application.proto", + "../../protos/google/appengine/v1/audit_data.proto", + "../../protos/google/appengine/v1/certificate.proto", + "../../protos/google/appengine/v1/deploy.proto", + "../../protos/google/appengine/v1/deployed_files.proto", + "../../protos/google/appengine/v1/domain.proto", + "../../protos/google/appengine/v1/domain_mapping.proto", + "../../protos/google/appengine/v1/firewall.proto", + "../../protos/google/appengine/v1/instance.proto", + "../../protos/google/appengine/v1/location.proto", + "../../protos/google/appengine/v1/network_settings.proto", + "../../protos/google/appengine/v1/operation.proto", + "../../protos/google/appengine/v1/service.proto", + "../../protos/google/appengine/v1/version.proto" +] diff --git a/packages/google-appengine/src/v1/firewall_client.ts b/packages/google-appengine/src/v1/firewall_client.ts new file mode 100644 index 00000000000..1f8af8f48a5 --- /dev/null +++ b/packages/google-appengine/src/v1/firewall_client.ts @@ -0,0 +1,1090 @@ +// 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, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/firewall_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './firewall_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Firewall resources are used to define a collection of access control rules + * for an Application. Each rule is defined with a position which specifies + * the rule's order in the sequence of rules, an IP range to be matched against + * requests, and an action to take upon matching requests. + * + * Every request is evaluated against the Firewall rules in priority order. + * Processesing stops at the first rule which matches the request's IP address. + * A final rule always specifies an action that applies to all remaining + * IP addresses. The default final rule for a newly-created application will be + * set to "allow" if not otherwise specified by the user. + * @class + * @memberof v1 + */ +export class FirewallClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + firewallStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FirewallClient. + * + * @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 FirewallClient({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 FirewallClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'apps/{app}/services/{service}/versions/{version}/instances/{instance}' + ), + }; + + // 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 = { + listIngressRules: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'ingressRules' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.appengine.v1.Firewall', + 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.firewallStub) { + return this.firewallStub; + } + + // Put together the "service stub" for + // google.appengine.v1.Firewall. + this.firewallStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.appengine.v1.Firewall' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.appengine.v1.Firewall, + 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 firewallStubMethods = [ + 'listIngressRules', + 'batchUpdateIngressRules', + 'createIngressRule', + 'getIngressRule', + 'updateIngressRule', + 'deleteIngressRule', + ]; + for (const methodName of firewallStubMethods) { + const callPromise = this.firewallStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.firewallStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'appengine.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 'appengine.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/appengine.admin', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + 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 -- + // ------------------- + /** + * Replaces the entire firewall ruleset in one bulk operation. This overrides + * and replaces the rules of an existing firewall with the new rules. + * + * If the final rule does not match traffic with the '*' wildcard IP range, + * then an "allow all" rule is explicitly added to the end of the list. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Firewall collection to set. + * Example: `apps/myapp/firewall/ingressRules`. + * @param {number[]} request.ingressRules + * A list of FirewallRules to replace the existing set. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchUpdateIngressRulesResponse]{@link google.appengine.v1.BatchUpdateIngressRulesResponse}. + * 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/firewall.batch_update_ingress_rules.js + * region_tag:appengine_v1_generated_Firewall_BatchUpdateIngressRules_async + */ + batchUpdateIngressRules( + request?: protos.google.appengine.v1.IBatchUpdateIngressRulesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IBatchUpdateIngressRulesResponse, + protos.google.appengine.v1.IBatchUpdateIngressRulesRequest | undefined, + {} | undefined + ] + >; + batchUpdateIngressRules( + request: protos.google.appengine.v1.IBatchUpdateIngressRulesRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IBatchUpdateIngressRulesResponse, + | protos.google.appengine.v1.IBatchUpdateIngressRulesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchUpdateIngressRules( + request: protos.google.appengine.v1.IBatchUpdateIngressRulesRequest, + callback: Callback< + protos.google.appengine.v1.IBatchUpdateIngressRulesResponse, + | protos.google.appengine.v1.IBatchUpdateIngressRulesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchUpdateIngressRules( + request?: protos.google.appengine.v1.IBatchUpdateIngressRulesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IBatchUpdateIngressRulesResponse, + | protos.google.appengine.v1.IBatchUpdateIngressRulesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IBatchUpdateIngressRulesResponse, + | protos.google.appengine.v1.IBatchUpdateIngressRulesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IBatchUpdateIngressRulesResponse, + protos.google.appengine.v1.IBatchUpdateIngressRulesRequest | 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.batchUpdateIngressRules( + request, + options, + callback + ); + } + /** + * Creates a firewall rule for the application. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent Firewall collection in which to create a new rule. + * Example: `apps/myapp/firewall/ingressRules`. + * @param {google.appengine.v1.FirewallRule} request.rule + * A FirewallRule containing the new resource. + * + * The user may optionally provide a position at which the new rule will be + * placed. The positions define a sequential list starting at 1. If a rule + * already exists at the given position, rules greater than the provided + * position will be moved forward by one. + * + * If no position is provided, the server will place the rule as the second to + * last rule in the sequence before the required default allow-all or deny-all + * rule. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FirewallRule]{@link google.appengine.v1.FirewallRule}. + * 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/firewall.create_ingress_rule.js + * region_tag:appengine_v1_generated_Firewall_CreateIngressRule_async + */ + createIngressRule( + request?: protos.google.appengine.v1.ICreateIngressRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.ICreateIngressRuleRequest | undefined, + {} | undefined + ] + >; + createIngressRule( + request: protos.google.appengine.v1.ICreateIngressRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.ICreateIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): void; + createIngressRule( + request: protos.google.appengine.v1.ICreateIngressRuleRequest, + callback: Callback< + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.ICreateIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): void; + createIngressRule( + request?: protos.google.appengine.v1.ICreateIngressRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IFirewallRule, + | protos.google.appengine.v1.ICreateIngressRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.ICreateIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.ICreateIngressRuleRequest | 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.createIngressRule(request, options, callback); + } + /** + * Gets the specified firewall rule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Firewall resource to retrieve. + * Example: `apps/myapp/firewall/ingressRules/100`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FirewallRule]{@link google.appengine.v1.FirewallRule}. + * 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/firewall.get_ingress_rule.js + * region_tag:appengine_v1_generated_Firewall_GetIngressRule_async + */ + getIngressRule( + request?: protos.google.appengine.v1.IGetIngressRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IGetIngressRuleRequest | undefined, + {} | undefined + ] + >; + getIngressRule( + request: protos.google.appengine.v1.IGetIngressRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IGetIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): void; + getIngressRule( + request: protos.google.appengine.v1.IGetIngressRuleRequest, + callback: Callback< + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IGetIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): void; + getIngressRule( + request?: protos.google.appengine.v1.IGetIngressRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IGetIngressRuleRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IGetIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IGetIngressRuleRequest | 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.getIngressRule(request, options, callback); + } + /** + * Updates the specified firewall rule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Firewall resource to update. + * Example: `apps/myapp/firewall/ingressRules/100`. + * @param {google.appengine.v1.FirewallRule} request.rule + * A FirewallRule containing the updated resource + * @param {google.protobuf.FieldMask} request.updateMask + * Standard field mask for the set of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FirewallRule]{@link google.appengine.v1.FirewallRule}. + * 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/firewall.update_ingress_rule.js + * region_tag:appengine_v1_generated_Firewall_UpdateIngressRule_async + */ + updateIngressRule( + request?: protos.google.appengine.v1.IUpdateIngressRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IUpdateIngressRuleRequest | undefined, + {} | undefined + ] + >; + updateIngressRule( + request: protos.google.appengine.v1.IUpdateIngressRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IUpdateIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): void; + updateIngressRule( + request: protos.google.appengine.v1.IUpdateIngressRuleRequest, + callback: Callback< + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IUpdateIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): void; + updateIngressRule( + request?: protos.google.appengine.v1.IUpdateIngressRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IFirewallRule, + | protos.google.appengine.v1.IUpdateIngressRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IUpdateIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IUpdateIngressRuleRequest | 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.updateIngressRule(request, options, callback); + } + /** + * Deletes the specified firewall rule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Firewall resource to delete. + * Example: `apps/myapp/firewall/ingressRules/100`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * 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/firewall.delete_ingress_rule.js + * region_tag:appengine_v1_generated_Firewall_DeleteIngressRule_async + */ + deleteIngressRule( + request?: protos.google.appengine.v1.IDeleteIngressRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IDeleteIngressRuleRequest | undefined, + {} | undefined + ] + >; + deleteIngressRule( + request: protos.google.appengine.v1.IDeleteIngressRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IDeleteIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteIngressRule( + request: protos.google.appengine.v1.IDeleteIngressRuleRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IDeleteIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteIngressRule( + request?: protos.google.appengine.v1.IDeleteIngressRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.appengine.v1.IDeleteIngressRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IDeleteIngressRuleRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IDeleteIngressRuleRequest | 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.deleteIngressRule(request, options, callback); + } + + /** + * Lists the firewall rules of an application. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the Firewall collection to retrieve. + * Example: `apps/myapp/firewall/ingressRules`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {string} request.matchingAddress + * A valid IP Address. If set, only rules matching this address will be + * returned. The first returned rule will be the rule that fires on requests + * from this IP. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [FirewallRule]{@link google.appengine.v1.FirewallRule}. + * 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 `listIngressRulesAsync()` + * 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. + */ + listIngressRules( + request?: protos.google.appengine.v1.IListIngressRulesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IFirewallRule[], + protos.google.appengine.v1.IListIngressRulesRequest | null, + protos.google.appengine.v1.IListIngressRulesResponse + ] + >; + listIngressRules( + request: protos.google.appengine.v1.IListIngressRulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.appengine.v1.IListIngressRulesRequest, + protos.google.appengine.v1.IListIngressRulesResponse | null | undefined, + protos.google.appengine.v1.IFirewallRule + > + ): void; + listIngressRules( + request: protos.google.appengine.v1.IListIngressRulesRequest, + callback: PaginationCallback< + protos.google.appengine.v1.IListIngressRulesRequest, + protos.google.appengine.v1.IListIngressRulesResponse | null | undefined, + protos.google.appengine.v1.IFirewallRule + > + ): void; + listIngressRules( + request?: protos.google.appengine.v1.IListIngressRulesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.appengine.v1.IListIngressRulesRequest, + | protos.google.appengine.v1.IListIngressRulesResponse + | null + | undefined, + protos.google.appengine.v1.IFirewallRule + >, + callback?: PaginationCallback< + protos.google.appengine.v1.IListIngressRulesRequest, + protos.google.appengine.v1.IListIngressRulesResponse | null | undefined, + protos.google.appengine.v1.IFirewallRule + > + ): Promise< + [ + protos.google.appengine.v1.IFirewallRule[], + protos.google.appengine.v1.IListIngressRulesRequest | null, + protos.google.appengine.v1.IListIngressRulesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listIngressRules(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 + * Name of the Firewall collection to retrieve. + * Example: `apps/myapp/firewall/ingressRules`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {string} request.matchingAddress + * A valid IP Address. If set, only rules matching this address will be + * returned. The first returned rule will be the rule that fires on requests + * from this IP. + * @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 [FirewallRule]{@link google.appengine.v1.FirewallRule} 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 `listIngressRulesAsync()` + * 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. + */ + listIngressRulesStream( + request?: protos.google.appengine.v1.IListIngressRulesRequest, + 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['listIngressRules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listIngressRules.createStream( + this.innerApiCalls.listIngressRules as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listIngressRules`, 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 + * Name of the Firewall collection to retrieve. + * Example: `apps/myapp/firewall/ingressRules`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {string} request.matchingAddress + * A valid IP Address. If set, only rules matching this address will be + * returned. The first returned rule will be the rule that fires on requests + * from this IP. + * @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 + * [FirewallRule]{@link google.appengine.v1.FirewallRule}. 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/firewall.list_ingress_rules.js + * region_tag:appengine_v1_generated_Firewall_ListIngressRules_async + */ + listIngressRulesAsync( + request?: protos.google.appengine.v1.IListIngressRulesRequest, + 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['listIngressRules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listIngressRules.asyncIterate( + this.innerApiCalls['listIngressRules'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} app + * @param {string} service + * @param {string} version + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + app: string, + service: string, + version: string, + instance: string + ) { + return this.pathTemplates.instancePathTemplate.render({ + app: app, + service: service, + version: version, + instance: instance, + }); + } + + /** + * Parse the app from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the app. + */ + matchAppFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).app; + } + + /** + * Parse the service from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the service. + */ + matchServiceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).service; + } + + /** + * Parse the version from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the version. + */ + matchVersionFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).version; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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.firewallStub && !this._terminated) { + return this.firewallStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-appengine/src/v1/firewall_client_config.json b/packages/google-appengine/src/v1/firewall_client_config.json new file mode 100644 index 00000000000..6b32cff302c --- /dev/null +++ b/packages/google-appengine/src/v1/firewall_client_config.json @@ -0,0 +1,56 @@ +{ + "interfaces": { + "google.appengine.v1.Firewall": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListIngressRules": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchUpdateIngressRules": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateIngressRule": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIngressRule": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateIngressRule": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteIngressRule": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-appengine/src/v1/firewall_proto_list.json b/packages/google-appengine/src/v1/firewall_proto_list.json new file mode 100644 index 00000000000..1720df9ca9e --- /dev/null +++ b/packages/google-appengine/src/v1/firewall_proto_list.json @@ -0,0 +1,18 @@ +[ + "../../protos/google/appengine/v1/app_yaml.proto", + "../../protos/google/appengine/v1/appengine.proto", + "../../protos/google/appengine/v1/application.proto", + "../../protos/google/appengine/v1/audit_data.proto", + "../../protos/google/appengine/v1/certificate.proto", + "../../protos/google/appengine/v1/deploy.proto", + "../../protos/google/appengine/v1/deployed_files.proto", + "../../protos/google/appengine/v1/domain.proto", + "../../protos/google/appengine/v1/domain_mapping.proto", + "../../protos/google/appengine/v1/firewall.proto", + "../../protos/google/appengine/v1/instance.proto", + "../../protos/google/appengine/v1/location.proto", + "../../protos/google/appengine/v1/network_settings.proto", + "../../protos/google/appengine/v1/operation.proto", + "../../protos/google/appengine/v1/service.proto", + "../../protos/google/appengine/v1/version.proto" +] diff --git a/packages/google-appengine/src/v1/gapic_metadata.json b/packages/google-appengine/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..ab6f3d88733 --- /dev/null +++ b/packages/google-appengine/src/v1/gapic_metadata.json @@ -0,0 +1,489 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.appengine.v1", + "libraryPackage": "@google-cloud/appengine-admin", + "services": { + "Applications": { + "clients": { + "grpc": { + "libraryClient": "ApplicationsClient", + "rpcs": { + "GetApplication": { + "methods": [ + "getApplication" + ] + }, + "CreateApplication": { + "methods": [ + "createApplication" + ] + }, + "UpdateApplication": { + "methods": [ + "updateApplication" + ] + }, + "RepairApplication": { + "methods": [ + "repairApplication" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ApplicationsClient", + "rpcs": { + "GetApplication": { + "methods": [ + "getApplication" + ] + }, + "CreateApplication": { + "methods": [ + "createApplication" + ] + }, + "UpdateApplication": { + "methods": [ + "updateApplication" + ] + }, + "RepairApplication": { + "methods": [ + "repairApplication" + ] + } + } + } + } + }, + "AuthorizedCertificates": { + "clients": { + "grpc": { + "libraryClient": "AuthorizedCertificatesClient", + "rpcs": { + "GetAuthorizedCertificate": { + "methods": [ + "getAuthorizedCertificate" + ] + }, + "CreateAuthorizedCertificate": { + "methods": [ + "createAuthorizedCertificate" + ] + }, + "UpdateAuthorizedCertificate": { + "methods": [ + "updateAuthorizedCertificate" + ] + }, + "DeleteAuthorizedCertificate": { + "methods": [ + "deleteAuthorizedCertificate" + ] + }, + "ListAuthorizedCertificates": { + "methods": [ + "listAuthorizedCertificates", + "listAuthorizedCertificatesStream", + "listAuthorizedCertificatesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AuthorizedCertificatesClient", + "rpcs": { + "GetAuthorizedCertificate": { + "methods": [ + "getAuthorizedCertificate" + ] + }, + "CreateAuthorizedCertificate": { + "methods": [ + "createAuthorizedCertificate" + ] + }, + "UpdateAuthorizedCertificate": { + "methods": [ + "updateAuthorizedCertificate" + ] + }, + "DeleteAuthorizedCertificate": { + "methods": [ + "deleteAuthorizedCertificate" + ] + }, + "ListAuthorizedCertificates": { + "methods": [ + "listAuthorizedCertificates", + "listAuthorizedCertificatesStream", + "listAuthorizedCertificatesAsync" + ] + } + } + } + } + }, + "AuthorizedDomains": { + "clients": { + "grpc": { + "libraryClient": "AuthorizedDomainsClient", + "rpcs": { + "ListAuthorizedDomains": { + "methods": [ + "listAuthorizedDomains", + "listAuthorizedDomainsStream", + "listAuthorizedDomainsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AuthorizedDomainsClient", + "rpcs": { + "ListAuthorizedDomains": { + "methods": [ + "listAuthorizedDomains", + "listAuthorizedDomainsStream", + "listAuthorizedDomainsAsync" + ] + } + } + } + } + }, + "DomainMappings": { + "clients": { + "grpc": { + "libraryClient": "DomainMappingsClient", + "rpcs": { + "GetDomainMapping": { + "methods": [ + "getDomainMapping" + ] + }, + "CreateDomainMapping": { + "methods": [ + "createDomainMapping" + ] + }, + "UpdateDomainMapping": { + "methods": [ + "updateDomainMapping" + ] + }, + "DeleteDomainMapping": { + "methods": [ + "deleteDomainMapping" + ] + }, + "ListDomainMappings": { + "methods": [ + "listDomainMappings", + "listDomainMappingsStream", + "listDomainMappingsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DomainMappingsClient", + "rpcs": { + "GetDomainMapping": { + "methods": [ + "getDomainMapping" + ] + }, + "CreateDomainMapping": { + "methods": [ + "createDomainMapping" + ] + }, + "UpdateDomainMapping": { + "methods": [ + "updateDomainMapping" + ] + }, + "DeleteDomainMapping": { + "methods": [ + "deleteDomainMapping" + ] + }, + "ListDomainMappings": { + "methods": [ + "listDomainMappings", + "listDomainMappingsStream", + "listDomainMappingsAsync" + ] + } + } + } + } + }, + "Firewall": { + "clients": { + "grpc": { + "libraryClient": "FirewallClient", + "rpcs": { + "BatchUpdateIngressRules": { + "methods": [ + "batchUpdateIngressRules" + ] + }, + "CreateIngressRule": { + "methods": [ + "createIngressRule" + ] + }, + "GetIngressRule": { + "methods": [ + "getIngressRule" + ] + }, + "UpdateIngressRule": { + "methods": [ + "updateIngressRule" + ] + }, + "DeleteIngressRule": { + "methods": [ + "deleteIngressRule" + ] + }, + "ListIngressRules": { + "methods": [ + "listIngressRules", + "listIngressRulesStream", + "listIngressRulesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FirewallClient", + "rpcs": { + "BatchUpdateIngressRules": { + "methods": [ + "batchUpdateIngressRules" + ] + }, + "CreateIngressRule": { + "methods": [ + "createIngressRule" + ] + }, + "GetIngressRule": { + "methods": [ + "getIngressRule" + ] + }, + "UpdateIngressRule": { + "methods": [ + "updateIngressRule" + ] + }, + "DeleteIngressRule": { + "methods": [ + "deleteIngressRule" + ] + }, + "ListIngressRules": { + "methods": [ + "listIngressRules", + "listIngressRulesStream", + "listIngressRulesAsync" + ] + } + } + } + } + }, + "Instances": { + "clients": { + "grpc": { + "libraryClient": "InstancesClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "DebugInstance": { + "methods": [ + "debugInstance" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InstancesClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "DebugInstance": { + "methods": [ + "debugInstance" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + }, + "Services": { + "clients": { + "grpc": { + "libraryClient": "ServicesClient", + "rpcs": { + "GetService": { + "methods": [ + "getService" + ] + }, + "UpdateService": { + "methods": [ + "updateService" + ] + }, + "DeleteService": { + "methods": [ + "deleteService" + ] + }, + "ListServices": { + "methods": [ + "listServices", + "listServicesStream", + "listServicesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ServicesClient", + "rpcs": { + "GetService": { + "methods": [ + "getService" + ] + }, + "UpdateService": { + "methods": [ + "updateService" + ] + }, + "DeleteService": { + "methods": [ + "deleteService" + ] + }, + "ListServices": { + "methods": [ + "listServices", + "listServicesStream", + "listServicesAsync" + ] + } + } + } + } + }, + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsClient", + "rpcs": { + "GetVersion": { + "methods": [ + "getVersion" + ] + }, + "CreateVersion": { + "methods": [ + "createVersion" + ] + }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, + "DeleteVersion": { + "methods": [ + "deleteVersion" + ] + }, + "ListVersions": { + "methods": [ + "listVersions", + "listVersionsStream", + "listVersionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VersionsClient", + "rpcs": { + "GetVersion": { + "methods": [ + "getVersion" + ] + }, + "CreateVersion": { + "methods": [ + "createVersion" + ] + }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, + "DeleteVersion": { + "methods": [ + "deleteVersion" + ] + }, + "ListVersions": { + "methods": [ + "listVersions", + "listVersionsStream", + "listVersionsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-appengine/src/v1/index.ts b/packages/google-appengine/src/v1/index.ts new file mode 100644 index 00000000000..c7f481e3460 --- /dev/null +++ b/packages/google-appengine/src/v1/index.ts @@ -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. ** + +export {ApplicationsClient} from './applications_client'; +export {AuthorizedCertificatesClient} from './authorized_certificates_client'; +export {AuthorizedDomainsClient} from './authorized_domains_client'; +export {DomainMappingsClient} from './domain_mappings_client'; +export {FirewallClient} from './firewall_client'; +export {InstancesClient} from './instances_client'; +export {ServicesClient} from './services_client'; +export {VersionsClient} from './versions_client'; diff --git a/packages/google-appengine/src/v1/instances_client.ts b/packages/google-appengine/src/v1/instances_client.ts new file mode 100644 index 00000000000..e68b79edf23 --- /dev/null +++ b/packages/google-appengine/src/v1/instances_client.ts @@ -0,0 +1,1062 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/instances_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './instances_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages instances of a version. + * @class + * @memberof v1 + */ +export class InstancesClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + instancesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of InstancesClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://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 InstancesClient({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 InstancesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'apps/{app}/services/{service}/versions/{version}/instances/{instance}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'instances' + ), + }; + + const protoFilesRoot = this._gaxModule.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=apps/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=apps/*}/locations', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=apps/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=apps/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + const debugInstanceResponse = protoFilesRoot.lookup( + '.google.appengine.v1.Instance' + ) as gax.protobuf.Type; + const debugInstanceMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), + debugInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + debugInstanceResponse.decode.bind(debugInstanceResponse), + debugInstanceMetadata.decode.bind(debugInstanceMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.appengine.v1.Instances', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.instancesStub) { + return this.instancesStub; + } + + // Put together the "service stub" for + // google.appengine.v1.Instances. + this.instancesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.appengine.v1.Instances' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.appengine.v1.Instances, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const instancesStubMethods = [ + 'listInstances', + 'getInstance', + 'deleteInstance', + 'debugInstance', + ]; + for (const methodName of instancesStubMethods) { + const callPromise = this.instancesStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.instancesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'appengine.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 'appengine.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/appengine.admin', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + 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 instance information. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource requested. Example: + * `apps/myapp/services/default/versions/v1/instances/instance-1`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Instance]{@link google.appengine.v1.Instance}. + * 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/instances.get_instance.js + * region_tag:appengine_v1_generated_Instances_GetInstance_async + */ + getInstance( + request?: protos.google.appengine.v1.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IGetInstanceRequest | undefined, + {} | undefined + ] + >; + getInstance( + request: protos.google.appengine.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + getInstance( + request: protos.google.appengine.v1.IGetInstanceRequest, + callback: Callback< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + getInstance( + request?: protos.google.appengine.v1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IGetInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getInstance(request, options, callback); + } + + /** + * Stops a running instance. + * + * The instance might be automatically recreated based on the scaling settings + * of the version. For more information, see "How Instances are Managed" + * ([standard environment](https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed) | + * [flexible environment](https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed)). + * + * To ensure that instances are not re-created and avoid getting billed, you + * can stop all instances within the target version by changing the serving + * status of the version to `STOPPED` with the + * [`apps.services.versions.patch`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch) + * method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource requested. Example: + * `apps/myapp/services/default/versions/v1/instances/instance-1`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/instances.delete_instance.js + * region_tag:appengine_v1_generated_Instances_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.appengine.v1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteInstance( + request: protos.google.appengine.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.appengine.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request?: protos.google.appengine.v1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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.deleteInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [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/instances.delete_instance.js + * region_tag:appengine_v1_generated_Instances_DeleteInstance_async + */ + async checkDeleteInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + /** + * Enables debugging on a VM instance. This allows you to use the SSH + * command to connect to the virtual machine where the instance lives. + * While in "debug mode", the instance continues to serve live traffic. + * You should delete the instance when you are done debugging and then + * allow the system to take over and determine if another instance + * should be started. + * + * Only applicable for instances in App Engine flexible environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource requested. Example: + * `apps/myapp/services/default/versions/v1/instances/instance-1`. + * @param {string} request.sshKey + * Public SSH key to add to the instance. Examples: + * + * * `[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]` + * * `[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}` + * + * For more information, see + * [Adding and Removing SSH Keys](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/instances.debug_instance.js + * region_tag:appengine_v1_generated_Instances_DebugInstance_async + */ + debugInstance( + request?: protos.google.appengine.v1.IDebugInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + debugInstance( + request: protos.google.appengine.v1.IDebugInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + debugInstance( + request: protos.google.appengine.v1.IDebugInstanceRequest, + callback: Callback< + LROperation< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + debugInstance( + request?: protos.google.appengine.v1.IDebugInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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.debugInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `debugInstance()`. + * @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/instances.debug_instance.js + * region_tag:appengine_v1_generated_Instances_DebugInstance_async + */ + async checkDebugInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.appengine.v1.Instance, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + 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.debugInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.appengine.v1.Instance, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + /** + * Lists the instances of a version. + * + * Tip: To aggregate details about instances over time, see the + * [Stackdriver Monitoring API](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent Version resource. Example: + * `apps/myapp/services/default/versions/v1`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Instance]{@link google.appengine.v1.Instance}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInstances( + request?: protos.google.appengine.v1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IInstance[], + protos.google.appengine.v1.IListInstancesRequest | null, + protos.google.appengine.v1.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.appengine.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.appengine.v1.IListInstancesRequest, + protos.google.appengine.v1.IListInstancesResponse | null | undefined, + protos.google.appengine.v1.IInstance + > + ): void; + listInstances( + request: protos.google.appengine.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.appengine.v1.IListInstancesRequest, + protos.google.appengine.v1.IListInstancesResponse | null | undefined, + protos.google.appengine.v1.IInstance + > + ): void; + listInstances( + request?: protos.google.appengine.v1.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.appengine.v1.IListInstancesRequest, + protos.google.appengine.v1.IListInstancesResponse | null | undefined, + protos.google.appengine.v1.IInstance + >, + callback?: PaginationCallback< + protos.google.appengine.v1.IListInstancesRequest, + protos.google.appengine.v1.IListInstancesResponse | null | undefined, + protos.google.appengine.v1.IInstance + > + ): Promise< + [ + protos.google.appengine.v1.IInstance[], + protos.google.appengine.v1.IListInstancesRequest | null, + protos.google.appengine.v1.IListInstancesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listInstances(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 + * Name of the parent Version resource. Example: + * `apps/myapp/services/default/versions/v1`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Instance]{@link google.appengine.v1.Instance} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInstancesStream( + request?: protos.google.appengine.v1.IListInstancesRequest, + 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['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listInstances`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent Version resource. Example: + * `apps/myapp/services/default/versions/v1`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [Instance]{@link google.appengine.v1.Instance}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/instances.list_instances.js + * region_tag:appengine_v1_generated_Instances_ListInstances_async + */ + listInstancesAsync( + request?: protos.google.appengine.v1.IListInstancesRequest, + 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['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} app + * @param {string} service + * @param {string} version + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + app: string, + service: string, + version: string, + instance: string + ) { + return this.pathTemplates.instancePathTemplate.render({ + app: app, + service: service, + version: version, + instance: instance, + }); + } + + /** + * Parse the app from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the app. + */ + matchAppFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).app; + } + + /** + * Parse the service from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the service. + */ + matchServiceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).service; + } + + /** + * Parse the version from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the version. + */ + matchVersionFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).version; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.instancesStub && !this._terminated) { + return this.instancesStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-appengine/src/v1/instances_client_config.json b/packages/google-appengine/src/v1/instances_client_config.json new file mode 100644 index 00000000000..bad578c4ca8 --- /dev/null +++ b/packages/google-appengine/src/v1/instances_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.appengine.v1.Instances": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DebugInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-appengine/src/v1/instances_proto_list.json b/packages/google-appengine/src/v1/instances_proto_list.json new file mode 100644 index 00000000000..1720df9ca9e --- /dev/null +++ b/packages/google-appengine/src/v1/instances_proto_list.json @@ -0,0 +1,18 @@ +[ + "../../protos/google/appengine/v1/app_yaml.proto", + "../../protos/google/appengine/v1/appengine.proto", + "../../protos/google/appengine/v1/application.proto", + "../../protos/google/appengine/v1/audit_data.proto", + "../../protos/google/appengine/v1/certificate.proto", + "../../protos/google/appengine/v1/deploy.proto", + "../../protos/google/appengine/v1/deployed_files.proto", + "../../protos/google/appengine/v1/domain.proto", + "../../protos/google/appengine/v1/domain_mapping.proto", + "../../protos/google/appengine/v1/firewall.proto", + "../../protos/google/appengine/v1/instance.proto", + "../../protos/google/appengine/v1/location.proto", + "../../protos/google/appengine/v1/network_settings.proto", + "../../protos/google/appengine/v1/operation.proto", + "../../protos/google/appengine/v1/service.proto", + "../../protos/google/appengine/v1/version.proto" +] diff --git a/packages/google-appengine/src/v1/services_client.ts b/packages/google-appengine/src/v1/services_client.ts new file mode 100644 index 00000000000..2dddedc64be --- /dev/null +++ b/packages/google-appengine/src/v1/services_client.ts @@ -0,0 +1,1045 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/services_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './services_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages services of an application. + * @class + * @memberof v1 + */ +export class ServicesClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + servicesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ServicesClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://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 ServicesClient({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 ServicesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'apps/{app}/services/{service}/versions/{version}/instances/{instance}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listServices: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'services' + ), + }; + + const protoFilesRoot = this._gaxModule.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=apps/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=apps/*}/locations', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=apps/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=apps/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const updateServiceResponse = protoFilesRoot.lookup( + '.google.appengine.v1.Service' + ) as gax.protobuf.Type; + const updateServiceMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + const deleteServiceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteServiceMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + updateService: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateServiceResponse.decode.bind(updateServiceResponse), + updateServiceMetadata.decode.bind(updateServiceMetadata) + ), + deleteService: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteServiceResponse.decode.bind(deleteServiceResponse), + deleteServiceMetadata.decode.bind(deleteServiceMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.appengine.v1.Services', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.servicesStub) { + return this.servicesStub; + } + + // Put together the "service stub" for + // google.appengine.v1.Services. + this.servicesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.appengine.v1.Services' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.appengine.v1.Services, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const servicesStubMethods = [ + 'listServices', + 'getService', + 'updateService', + 'deleteService', + ]; + for (const methodName of servicesStubMethods) { + const callPromise = this.servicesStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.servicesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'appengine.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 'appengine.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/appengine.admin', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets the current configuration of the specified service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource requested. Example: `apps/myapp/services/default`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Service]{@link google.appengine.v1.Service}. + * 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/services.get_service.js + * region_tag:appengine_v1_generated_Services_GetService_async + */ + getService( + request?: protos.google.appengine.v1.IGetServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IGetServiceRequest | undefined, + {} | undefined + ] + >; + getService( + request: protos.google.appengine.v1.IGetServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IGetServiceRequest | null | undefined, + {} | null | undefined + > + ): void; + getService( + request: protos.google.appengine.v1.IGetServiceRequest, + callback: Callback< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IGetServiceRequest | null | undefined, + {} | null | undefined + > + ): void; + getService( + request?: protos.google.appengine.v1.IGetServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IGetServiceRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IGetServiceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IGetServiceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getService(request, options, callback); + } + + /** + * Updates the configuration of the specified service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource to update. Example: `apps/myapp/services/default`. + * @param {google.appengine.v1.Service} request.service + * A Service resource containing the updated service. Only fields set in the + * field mask will be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Standard field mask for the set of fields to be updated. + * @param {boolean} request.migrateTraffic + * Set to `true` to gradually shift traffic to one or more versions that you + * specify. By default, traffic is shifted immediately. + * For gradual traffic migration, the target versions + * must be located within instances that are configured for both + * [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType) + * and + * [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling). + * You must specify the + * [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy) + * field in the Service resource. Gradual traffic migration is not + * supported in the App Engine flexible environment. For examples, see + * [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/services.update_service.js + * region_tag:appengine_v1_generated_Services_UpdateService_async + */ + updateService( + request?: protos.google.appengine.v1.IUpdateServiceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateService( + request: protos.google.appengine.v1.IUpdateServiceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateService( + request: protos.google.appengine.v1.IUpdateServiceRequest, + callback: Callback< + LROperation< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateService( + request?: protos.google.appengine.v1.IUpdateServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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.updateService(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateService()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [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/services.update_service.js + * region_tag:appengine_v1_generated_Services_UpdateService_async + */ + async checkUpdateServiceProgress( + name: string + ): Promise< + LROperation< + protos.google.appengine.v1.Service, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateService, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.appengine.v1.Service, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + /** + * Deletes the specified service and all enclosed versions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource requested. Example: `apps/myapp/services/default`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/services.delete_service.js + * region_tag:appengine_v1_generated_Services_DeleteService_async + */ + deleteService( + request?: protos.google.appengine.v1.IDeleteServiceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteService( + request: protos.google.appengine.v1.IDeleteServiceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteService( + request: protos.google.appengine.v1.IDeleteServiceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteService( + request?: protos.google.appengine.v1.IDeleteServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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.deleteService(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteService()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [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/services.delete_service.js + * region_tag:appengine_v1_generated_Services_DeleteService_async + */ + async checkDeleteServiceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteService, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + /** + * Lists all the services in the application. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent Application resource. Example: `apps/myapp`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Service]{@link google.appengine.v1.Service}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listServicesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listServices( + request?: protos.google.appengine.v1.IListServicesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IService[], + protos.google.appengine.v1.IListServicesRequest | null, + protos.google.appengine.v1.IListServicesResponse + ] + >; + listServices( + request: protos.google.appengine.v1.IListServicesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.appengine.v1.IListServicesRequest, + protos.google.appengine.v1.IListServicesResponse | null | undefined, + protos.google.appengine.v1.IService + > + ): void; + listServices( + request: protos.google.appengine.v1.IListServicesRequest, + callback: PaginationCallback< + protos.google.appengine.v1.IListServicesRequest, + protos.google.appengine.v1.IListServicesResponse | null | undefined, + protos.google.appengine.v1.IService + > + ): void; + listServices( + request?: protos.google.appengine.v1.IListServicesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.appengine.v1.IListServicesRequest, + protos.google.appengine.v1.IListServicesResponse | null | undefined, + protos.google.appengine.v1.IService + >, + callback?: PaginationCallback< + protos.google.appengine.v1.IListServicesRequest, + protos.google.appengine.v1.IListServicesResponse | null | undefined, + protos.google.appengine.v1.IService + > + ): Promise< + [ + protos.google.appengine.v1.IService[], + protos.google.appengine.v1.IListServicesRequest | null, + protos.google.appengine.v1.IListServicesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listServices(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 + * Name of the parent Application resource. Example: `apps/myapp`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Service]{@link google.appengine.v1.Service} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listServicesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listServicesStream( + request?: protos.google.appengine.v1.IListServicesRequest, + 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['listServices']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listServices.createStream( + this.innerApiCalls.listServices as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listServices`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent Application resource. Example: `apps/myapp`. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [Service]{@link google.appengine.v1.Service}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/services.list_services.js + * region_tag:appengine_v1_generated_Services_ListServices_async + */ + listServicesAsync( + request?: protos.google.appengine.v1.IListServicesRequest, + 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['listServices']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listServices.asyncIterate( + this.innerApiCalls['listServices'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} app + * @param {string} service + * @param {string} version + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + app: string, + service: string, + version: string, + instance: string + ) { + return this.pathTemplates.instancePathTemplate.render({ + app: app, + service: service, + version: version, + instance: instance, + }); + } + + /** + * Parse the app from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the app. + */ + matchAppFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).app; + } + + /** + * Parse the service from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the service. + */ + matchServiceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).service; + } + + /** + * Parse the version from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the version. + */ + matchVersionFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).version; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.servicesStub && !this._terminated) { + return this.servicesStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-appengine/src/v1/services_client_config.json b/packages/google-appengine/src/v1/services_client_config.json new file mode 100644 index 00000000000..19d19c292b9 --- /dev/null +++ b/packages/google-appengine/src/v1/services_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.appengine.v1.Services": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListServices": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetService": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateService": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteService": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-appengine/src/v1/services_proto_list.json b/packages/google-appengine/src/v1/services_proto_list.json new file mode 100644 index 00000000000..1720df9ca9e --- /dev/null +++ b/packages/google-appengine/src/v1/services_proto_list.json @@ -0,0 +1,18 @@ +[ + "../../protos/google/appengine/v1/app_yaml.proto", + "../../protos/google/appengine/v1/appengine.proto", + "../../protos/google/appengine/v1/application.proto", + "../../protos/google/appengine/v1/audit_data.proto", + "../../protos/google/appengine/v1/certificate.proto", + "../../protos/google/appengine/v1/deploy.proto", + "../../protos/google/appengine/v1/deployed_files.proto", + "../../protos/google/appengine/v1/domain.proto", + "../../protos/google/appengine/v1/domain_mapping.proto", + "../../protos/google/appengine/v1/firewall.proto", + "../../protos/google/appengine/v1/instance.proto", + "../../protos/google/appengine/v1/location.proto", + "../../protos/google/appengine/v1/network_settings.proto", + "../../protos/google/appengine/v1/operation.proto", + "../../protos/google/appengine/v1/service.proto", + "../../protos/google/appengine/v1/version.proto" +] diff --git a/packages/google-appengine/src/v1/versions_client.ts b/packages/google-appengine/src/v1/versions_client.ts new file mode 100644 index 00000000000..ef117f27a1e --- /dev/null +++ b/packages/google-appengine/src/v1/versions_client.ts @@ -0,0 +1,1236 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/versions_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './versions_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages versions of a service. + * @class + * @memberof v1 + */ +export class VersionsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + versionsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VersionsClient. + * + * @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 VersionsClient({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 VersionsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'apps/{app}/services/{service}/versions/{version}/instances/{instance}' + ), + }; + + // 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 = { + listVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'versions' + ), + }; + + 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=apps/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=apps/*}/locations', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=apps/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=apps/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createVersionResponse = protoFilesRoot.lookup( + '.google.appengine.v1.Version' + ) as gax.protobuf.Type; + const createVersionMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.CreateVersionMetadataV1' + ) as gax.protobuf.Type; + const updateVersionResponse = protoFilesRoot.lookup( + '.google.appengine.v1.Version' + ) as gax.protobuf.Type; + const updateVersionMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + const deleteVersionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteVersionMetadata = protoFilesRoot.lookup( + '.google.appengine.v1.OperationMetadataV1' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createVersionResponse.decode.bind(createVersionResponse), + createVersionMetadata.decode.bind(createVersionMetadata) + ), + updateVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateVersionResponse.decode.bind(updateVersionResponse), + updateVersionMetadata.decode.bind(updateVersionMetadata) + ), + deleteVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteVersionResponse.decode.bind(deleteVersionResponse), + deleteVersionMetadata.decode.bind(deleteVersionMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.appengine.v1.Versions', + 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.versionsStub) { + return this.versionsStub; + } + + // Put together the "service stub" for + // google.appengine.v1.Versions. + this.versionsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.appengine.v1.Versions' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.appengine.v1.Versions, + 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 versionsStubMethods = [ + 'listVersions', + 'getVersion', + 'createVersion', + 'updateVersion', + 'deleteVersion', + ]; + for (const methodName of versionsStubMethods) { + const callPromise = this.versionsStub.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.versionsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'appengine.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 'appengine.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/appengine.admin', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets the specified Version resource. + * By default, only a `BASIC_VIEW` will be returned. + * Specify the `FULL_VIEW` parameter to get the full resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource requested. Example: + * `apps/myapp/services/default/versions/v1`. + * @param {google.appengine.v1.VersionView} request.view + * Controls the set of fields returned in the `Get` response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Version]{@link google.appengine.v1.Version}. + * 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/versions.get_version.js + * region_tag:appengine_v1_generated_Versions_GetVersion_async + */ + getVersion( + request?: protos.google.appengine.v1.IGetVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IGetVersionRequest | undefined, + {} | undefined + ] + >; + getVersion( + request: protos.google.appengine.v1.IGetVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IGetVersionRequest | null | undefined, + {} | null | undefined + > + ): void; + getVersion( + request: protos.google.appengine.v1.IGetVersionRequest, + callback: Callback< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IGetVersionRequest | null | undefined, + {} | null | undefined + > + ): void; + getVersion( + request?: protos.google.appengine.v1.IGetVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IGetVersionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IGetVersionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IGetVersionRequest | 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.getVersion(request, options, callback); + } + + /** + * Deploys code and resource files to a new version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent resource to create this version under. Example: + * `apps/myapp/services/default`. + * @param {google.appengine.v1.Version} request.version + * Application deployment 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 + * 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/versions.create_version.js + * region_tag:appengine_v1_generated_Versions_CreateVersion_async + */ + createVersion( + request?: protos.google.appengine.v1.ICreateVersionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.ICreateVersionMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createVersion( + request: protos.google.appengine.v1.ICreateVersionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.ICreateVersionMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createVersion( + request: protos.google.appengine.v1.ICreateVersionRequest, + callback: Callback< + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.ICreateVersionMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createVersion( + request?: protos.google.appengine.v1.ICreateVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.ICreateVersionMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.ICreateVersionMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.ICreateVersionMetadataV1 + >, + 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.createVersion(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createVersion()`. + * @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/versions.create_version.js + * region_tag:appengine_v1_generated_Versions_CreateVersion_async + */ + async checkCreateVersionProgress( + name: string + ): Promise< + LROperation< + protos.google.appengine.v1.Version, + protos.google.appengine.v1.CreateVersionMetadataV1 + > + > { + 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.createVersion, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.appengine.v1.Version, + protos.google.appengine.v1.CreateVersionMetadataV1 + >; + } + /** + * Updates the specified Version resource. + * You can specify the following fields depending on the App Engine + * environment and type of scaling that the version resource uses: + * + * **Standard environment** + * + * * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class) + * + * *automatic scaling* in the standard environment: + * + * * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + * * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + * * [`automaticScaling.standard_scheduler_settings.max_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) + * * [`automaticScaling.standard_scheduler_settings.min_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) + * * [`automaticScaling.standard_scheduler_settings.target_cpu_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) + * * [`automaticScaling.standard_scheduler_settings.target_throughput_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) + * + * *basic scaling* or *manual scaling* in the standard environment: + * + * * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status) + * * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling) + * + * **Flexible environment** + * + * * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status) + * + * *automatic scaling* in the flexible environment: + * + * * [`automatic_scaling.min_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + * * [`automatic_scaling.max_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + * * [`automatic_scaling.cool_down_period_sec`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + * * [`automatic_scaling.cpu_utilization.target_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + * + * *manual scaling* in the flexible environment: + * + * * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling) + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource to update. Example: + * `apps/myapp/services/default/versions/1`. + * @param {google.appengine.v1.Version} request.version + * A Version containing the updated resource. Only fields set in the field + * mask will be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Standard field mask for the set of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/versions.update_version.js + * region_tag:appengine_v1_generated_Versions_UpdateVersion_async + */ + updateVersion( + request?: protos.google.appengine.v1.IUpdateVersionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateVersion( + request: protos.google.appengine.v1.IUpdateVersionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateVersion( + request: protos.google.appengine.v1.IUpdateVersionRequest, + callback: Callback< + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateVersion( + request?: protos.google.appengine.v1.IUpdateVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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.updateVersion(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateVersion()`. + * @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/versions.update_version.js + * region_tag:appengine_v1_generated_Versions_UpdateVersion_async + */ + async checkUpdateVersionProgress( + name: string + ): Promise< + LROperation< + protos.google.appengine.v1.Version, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + 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.updateVersion, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.appengine.v1.Version, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + /** + * Deletes an existing Version resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource requested. Example: + * `apps/myapp/services/default/versions/v1`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/versions.delete_version.js + * region_tag:appengine_v1_generated_Versions_DeleteVersion_async + */ + deleteVersion( + request?: protos.google.appengine.v1.IDeleteVersionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteVersion( + request: protos.google.appengine.v1.IDeleteVersionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteVersion( + request: protos.google.appengine.v1.IDeleteVersionRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteVersion( + request?: protos.google.appengine.v1.IDeleteVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + 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.deleteVersion(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteVersion()`. + * @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/versions.delete_version.js + * region_tag:appengine_v1_generated_Versions_DeleteVersion_async + */ + async checkDeleteVersionProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.appengine.v1.OperationMetadataV1 + > + > { + 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.deleteVersion, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.appengine.v1.OperationMetadataV1 + >; + } + /** + * Lists the versions of a service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the parent Service resource. Example: + * `apps/myapp/services/default`. + * @param {google.appengine.v1.VersionView} request.view + * Controls the set of fields returned in the `List` response. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Version]{@link google.appengine.v1.Version}. + * 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 `listVersionsAsync()` + * 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. + */ + listVersions( + request?: protos.google.appengine.v1.IListVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.appengine.v1.IVersion[], + protos.google.appengine.v1.IListVersionsRequest | null, + protos.google.appengine.v1.IListVersionsResponse + ] + >; + listVersions( + request: protos.google.appengine.v1.IListVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.appengine.v1.IListVersionsRequest, + protos.google.appengine.v1.IListVersionsResponse | null | undefined, + protos.google.appengine.v1.IVersion + > + ): void; + listVersions( + request: protos.google.appengine.v1.IListVersionsRequest, + callback: PaginationCallback< + protos.google.appengine.v1.IListVersionsRequest, + protos.google.appengine.v1.IListVersionsResponse | null | undefined, + protos.google.appengine.v1.IVersion + > + ): void; + listVersions( + request?: protos.google.appengine.v1.IListVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.appengine.v1.IListVersionsRequest, + protos.google.appengine.v1.IListVersionsResponse | null | undefined, + protos.google.appengine.v1.IVersion + >, + callback?: PaginationCallback< + protos.google.appengine.v1.IListVersionsRequest, + protos.google.appengine.v1.IListVersionsResponse | null | undefined, + protos.google.appengine.v1.IVersion + > + ): Promise< + [ + protos.google.appengine.v1.IVersion[], + protos.google.appengine.v1.IListVersionsRequest | null, + protos.google.appengine.v1.IListVersionsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listVersions(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 + * Name of the parent Service resource. Example: + * `apps/myapp/services/default`. + * @param {google.appengine.v1.VersionView} request.view + * Controls the set of fields returned in the `List` response. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Version]{@link google.appengine.v1.Version} 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 `listVersionsAsync()` + * 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. + */ + listVersionsStream( + request?: protos.google.appengine.v1.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVersions.createStream( + this.innerApiCalls.listVersions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listVersions`, 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 + * Name of the parent Service resource. Example: + * `apps/myapp/services/default`. + * @param {google.appengine.v1.VersionView} request.view + * Controls the set of fields returned in the `List` response. + * @param {number} request.pageSize + * Maximum results to return per page. + * @param {string} request.pageToken + * Continuation token for fetching the next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [Version]{@link google.appengine.v1.Version}. 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/versions.list_versions.js + * region_tag:appengine_v1_generated_Versions_ListVersions_async + */ + listVersionsAsync( + request?: protos.google.appengine.v1.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVersions.asyncIterate( + this.innerApiCalls['listVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} app + * @param {string} service + * @param {string} version + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + app: string, + service: string, + version: string, + instance: string + ) { + return this.pathTemplates.instancePathTemplate.render({ + app: app, + service: service, + version: version, + instance: instance, + }); + } + + /** + * Parse the app from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the app. + */ + matchAppFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).app; + } + + /** + * Parse the service from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the service. + */ + matchServiceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).service; + } + + /** + * Parse the version from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the version. + */ + matchVersionFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).version; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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.versionsStub && !this._terminated) { + return this.versionsStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-appengine/src/v1/versions_client_config.json b/packages/google-appengine/src/v1/versions_client_config.json new file mode 100644 index 00000000000..1da0d7f1e88 --- /dev/null +++ b/packages/google-appengine/src/v1/versions_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.appengine.v1.Versions": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListVersions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-appengine/src/v1/versions_proto_list.json b/packages/google-appengine/src/v1/versions_proto_list.json new file mode 100644 index 00000000000..1720df9ca9e --- /dev/null +++ b/packages/google-appengine/src/v1/versions_proto_list.json @@ -0,0 +1,18 @@ +[ + "../../protos/google/appengine/v1/app_yaml.proto", + "../../protos/google/appengine/v1/appengine.proto", + "../../protos/google/appengine/v1/application.proto", + "../../protos/google/appengine/v1/audit_data.proto", + "../../protos/google/appengine/v1/certificate.proto", + "../../protos/google/appengine/v1/deploy.proto", + "../../protos/google/appengine/v1/deployed_files.proto", + "../../protos/google/appengine/v1/domain.proto", + "../../protos/google/appengine/v1/domain_mapping.proto", + "../../protos/google/appengine/v1/firewall.proto", + "../../protos/google/appengine/v1/instance.proto", + "../../protos/google/appengine/v1/location.proto", + "../../protos/google/appengine/v1/network_settings.proto", + "../../protos/google/appengine/v1/operation.proto", + "../../protos/google/appengine/v1/service.proto", + "../../protos/google/appengine/v1/version.proto" +] diff --git a/packages/google-appengine/system-test/fixtures/sample/src/index.js b/packages/google-appengine/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..c1413512007 --- /dev/null +++ b/packages/google-appengine/system-test/fixtures/sample/src/index.js @@ -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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 appengine = require('@google-cloud/appengine-admin'); + +function main() { + const applicationsClient = new appengine.ApplicationsClient(); + const authorizedCertificatesClient = + new appengine.AuthorizedCertificatesClient(); + const authorizedDomainsClient = new appengine.AuthorizedDomainsClient(); + const domainMappingsClient = new appengine.DomainMappingsClient(); + const firewallClient = new appengine.FirewallClient(); + const instancesClient = new appengine.InstancesClient(); + const servicesClient = new appengine.ServicesClient(); + const versionsClient = new appengine.VersionsClient(); +} + +main(); diff --git a/packages/google-appengine/system-test/fixtures/sample/src/index.ts b/packages/google-appengine/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..91d68d1f4f7 --- /dev/null +++ b/packages/google-appengine/system-test/fixtures/sample/src/index.ts @@ -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. ** + +import { + ApplicationsClient, + AuthorizedCertificatesClient, + AuthorizedDomainsClient, + DomainMappingsClient, + FirewallClient, + InstancesClient, + ServicesClient, + VersionsClient, +} from '@google-cloud/appengine-admin'; + +// check that the client class type name can be used +function doStuffWithApplicationsClient(client: ApplicationsClient) { + client.close(); +} +function doStuffWithAuthorizedCertificatesClient( + client: AuthorizedCertificatesClient +) { + client.close(); +} +function doStuffWithAuthorizedDomainsClient(client: AuthorizedDomainsClient) { + client.close(); +} +function doStuffWithDomainMappingsClient(client: DomainMappingsClient) { + client.close(); +} +function doStuffWithFirewallClient(client: FirewallClient) { + client.close(); +} +function doStuffWithInstancesClient(client: InstancesClient) { + client.close(); +} +function doStuffWithServicesClient(client: ServicesClient) { + client.close(); +} +function doStuffWithVersionsClient(client: VersionsClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const applicationsClient = new ApplicationsClient(); + doStuffWithApplicationsClient(applicationsClient); + // check that the client instance can be created + const authorizedCertificatesClient = new AuthorizedCertificatesClient(); + doStuffWithAuthorizedCertificatesClient(authorizedCertificatesClient); + // check that the client instance can be created + const authorizedDomainsClient = new AuthorizedDomainsClient(); + doStuffWithAuthorizedDomainsClient(authorizedDomainsClient); + // check that the client instance can be created + const domainMappingsClient = new DomainMappingsClient(); + doStuffWithDomainMappingsClient(domainMappingsClient); + // check that the client instance can be created + const firewallClient = new FirewallClient(); + doStuffWithFirewallClient(firewallClient); + // check that the client instance can be created + const instancesClient = new InstancesClient(); + doStuffWithInstancesClient(instancesClient); + // check that the client instance can be created + const servicesClient = new ServicesClient(); + doStuffWithServicesClient(servicesClient); + // check that the client instance can be created + const versionsClient = new VersionsClient(); + doStuffWithVersionsClient(versionsClient); +} + +main(); diff --git a/packages/google-appengine/system-test/install.ts b/packages/google-appengine/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-appengine/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-appengine/test/gapic_applications_v1.ts b/packages/google-appengine/test/gapic_applications_v1.ts new file mode 100644 index 00000000000..ff8ba243cf1 --- /dev/null +++ b/packages/google-appengine/test/gapic_applications_v1.ts @@ -0,0 +1,930 @@ +// 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 applicationsModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +describe('v1.ApplicationsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = applicationsModule.v1.ApplicationsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = applicationsModule.v1.ApplicationsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = applicationsModule.v1.ApplicationsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new applicationsModule.v1.ApplicationsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new applicationsModule.v1.ApplicationsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.applicationsStub, undefined); + await client.initialize(); + assert(client.applicationsStub); + }); + + it('has close method for the initialized client', done => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.applicationsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.applicationsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new applicationsModule.v1.ApplicationsClient({ + 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 applicationsModule.v1.ApplicationsClient({ + 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('getApplication', () => { + it('invokes getApplication without error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.Application() + ); + client.innerApiCalls.getApplication = stubSimpleCall(expectedResponse); + const [response] = await client.getApplication(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApplication without error using callback', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.Application() + ); + client.innerApiCalls.getApplication = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApplication( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IApplication | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApplication with error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApplication = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getApplication(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApplication with closed client', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApplication(request), expectedError); + }); + }); + + describe('createApplication', () => { + it('invokes createApplication without error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateApplicationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApplication = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createApplication(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createApplication without error using callback', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateApplicationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApplication = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApplication( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createApplication with call error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateApplicationRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createApplication = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createApplication(request), expectedError); + }); + + it('invokes createApplication with LRO error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateApplicationRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createApplication = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createApplication(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkCreateApplicationProgress without error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + 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.checkCreateApplicationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateApplicationProgress with error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + 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.checkCreateApplicationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateApplication', () => { + it('invokes updateApplication without error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateApplication = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateApplication(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplication without error using callback', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateApplication = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApplication( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplication with call error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApplication = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateApplication(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplication with LRO error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApplication = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateApplication(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateApplicationProgress without error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + 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.checkUpdateApplicationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateApplicationProgress with error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + 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.checkUpdateApplicationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('repairApplication', () => { + it('invokes repairApplication without error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.RepairApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.RepairApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.repairApplication = + stubLongRunningCall(expectedResponse); + const [operation] = await client.repairApplication(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.repairApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.repairApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes repairApplication without error using callback', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.RepairApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.RepairApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.repairApplication = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.repairApplication( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.repairApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.repairApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes repairApplication with call error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.RepairApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.RepairApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.repairApplication = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.repairApplication(request), expectedError); + const actualRequest = ( + client.innerApiCalls.repairApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.repairApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes repairApplication with LRO error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.RepairApplicationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.RepairApplicationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.repairApplication = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.repairApplication(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.repairApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.repairApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRepairApplicationProgress without error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + 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.checkRepairApplicationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRepairApplicationProgress with error', async () => { + const client = new applicationsModule.v1.ApplicationsClient({ + 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.checkRepairApplicationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + app: 'appValue', + service: 'serviceValue', + version: 'versionValue', + instance: 'instanceValue', + }; + const client = new applicationsModule.v1.ApplicationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'appValue', + 'serviceValue', + 'versionValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAppFromInstanceName', () => { + const result = client.matchAppFromInstanceName(fakePath); + assert.strictEqual(result, 'appValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromInstanceName', () => { + const result = client.matchServiceFromInstanceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromInstanceName', () => { + const result = client.matchVersionFromInstanceName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-appengine/test/gapic_authorized_certificates_v1.ts b/packages/google-appengine/test/gapic_authorized_certificates_v1.ts new file mode 100644 index 00000000000..2796f2d3668 --- /dev/null +++ b/packages/google-appengine/test/gapic_authorized_certificates_v1.ts @@ -0,0 +1,1241 @@ +// 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 authorizedcertificatesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.AuthorizedCertificatesClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + authorizedcertificatesModule.v1.AuthorizedCertificatesClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + authorizedcertificatesModule.v1.AuthorizedCertificatesClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + authorizedcertificatesModule.v1.AuthorizedCertificatesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.authorizedCertificatesStub, undefined); + await client.initialize(); + assert(client.authorizedCertificatesStub); + }); + + it('has close method for the initialized client', done => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.authorizedCertificatesStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.authorizedCertificatesStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + 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 authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + 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('getAuthorizedCertificate', () => { + it('invokes getAuthorizedCertificate without error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ); + client.innerApiCalls.getAuthorizedCertificate = + stubSimpleCall(expectedResponse); + const [response] = await client.getAuthorizedCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAuthorizedCertificate without error using callback', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ); + client.innerApiCalls.getAuthorizedCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAuthorizedCertificate( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IAuthorizedCertificate | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAuthorizedCertificate with error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAuthorizedCertificate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getAuthorizedCertificate(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAuthorizedCertificate with closed client', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getAuthorizedCertificate(request), + expectedError + ); + }); + }); + + describe('createAuthorizedCertificate', () => { + it('invokes createAuthorizedCertificate without error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateAuthorizedCertificateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ); + client.innerApiCalls.createAuthorizedCertificate = + stubSimpleCall(expectedResponse); + const [response] = await client.createAuthorizedCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAuthorizedCertificate without error using callback', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateAuthorizedCertificateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ); + client.innerApiCalls.createAuthorizedCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAuthorizedCertificate( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IAuthorizedCertificate | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAuthorizedCertificate with error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateAuthorizedCertificateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAuthorizedCertificate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createAuthorizedCertificate(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAuthorizedCertificate with closed client', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateAuthorizedCertificateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createAuthorizedCertificate(request), + expectedError + ); + }); + }); + + describe('updateAuthorizedCertificate', () => { + it('invokes updateAuthorizedCertificate without error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ); + client.innerApiCalls.updateAuthorizedCertificate = + stubSimpleCall(expectedResponse); + const [response] = await client.updateAuthorizedCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAuthorizedCertificate without error using callback', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ); + client.innerApiCalls.updateAuthorizedCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAuthorizedCertificate( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IAuthorizedCertificate | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAuthorizedCertificate with error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAuthorizedCertificate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateAuthorizedCertificate(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAuthorizedCertificate with closed client', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateAuthorizedCertificate(request), + expectedError + ); + }); + }); + + describe('deleteAuthorizedCertificate', () => { + it('invokes deleteAuthorizedCertificate without error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAuthorizedCertificate = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteAuthorizedCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAuthorizedCertificate without error using callback', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAuthorizedCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAuthorizedCertificate( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAuthorizedCertificate with error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAuthorizedCertificate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteAuthorizedCertificate(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteAuthorizedCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAuthorizedCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAuthorizedCertificate with closed client', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteAuthorizedCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteAuthorizedCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteAuthorizedCertificate(request), + expectedError + ); + }); + }); + + describe('listAuthorizedCertificates', () => { + it('invokes listAuthorizedCertificates without error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + ]; + client.innerApiCalls.listAuthorizedCertificates = + stubSimpleCall(expectedResponse); + const [response] = await client.listAuthorizedCertificates(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAuthorizedCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAuthorizedCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizedCertificates without error using callback', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + ]; + client.innerApiCalls.listAuthorizedCertificates = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAuthorizedCertificates( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IAuthorizedCertificate[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAuthorizedCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAuthorizedCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizedCertificates with error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAuthorizedCertificates = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listAuthorizedCertificates(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listAuthorizedCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAuthorizedCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizedCertificatesStream without error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + ]; + client.descriptors.page.listAuthorizedCertificates.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAuthorizedCertificatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.AuthorizedCertificate[] = + []; + stream.on( + 'data', + (response: protos.google.appengine.v1.AuthorizedCertificate) => { + 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.listAuthorizedCertificates + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAuthorizedCertificates, request) + ); + assert( + ( + client.descriptors.page.listAuthorizedCertificates + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAuthorizedCertificatesStream with error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAuthorizedCertificates.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAuthorizedCertificatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.AuthorizedCertificate[] = + []; + stream.on( + 'data', + (response: protos.google.appengine.v1.AuthorizedCertificate) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listAuthorizedCertificates + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAuthorizedCertificates, request) + ); + assert( + ( + client.descriptors.page.listAuthorizedCertificates + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAuthorizedCertificates without error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedCertificate() + ), + ]; + client.descriptors.page.listAuthorizedCertificates.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.appengine.v1.IAuthorizedCertificate[] = []; + const iterable = client.listAuthorizedCertificatesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAuthorizedCertificates + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listAuthorizedCertificates + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAuthorizedCertificates with error', async () => { + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAuthorizedCertificates.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAuthorizedCertificatesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.appengine.v1.IAuthorizedCertificate[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAuthorizedCertificates + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listAuthorizedCertificates + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + app: 'appValue', + service: 'serviceValue', + version: 'versionValue', + instance: 'instanceValue', + }; + const client = + new authorizedcertificatesModule.v1.AuthorizedCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'appValue', + 'serviceValue', + 'versionValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAppFromInstanceName', () => { + const result = client.matchAppFromInstanceName(fakePath); + assert.strictEqual(result, 'appValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromInstanceName', () => { + const result = client.matchServiceFromInstanceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromInstanceName', () => { + const result = client.matchVersionFromInstanceName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-appengine/test/gapic_authorized_domains_v1.ts b/packages/google-appengine/test/gapic_authorized_domains_v1.ts new file mode 100644 index 00000000000..f3d21f2e501 --- /dev/null +++ b/packages/google-appengine/test/gapic_authorized_domains_v1.ts @@ -0,0 +1,656 @@ +// 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 authorizeddomainsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.AuthorizedDomainsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + authorizeddomainsModule.v1.AuthorizedDomainsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + authorizeddomainsModule.v1.AuthorizedDomainsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = authorizeddomainsModule.v1.AuthorizedDomainsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.authorizedDomainsStub, undefined); + await client.initialize(); + assert(client.authorizedDomainsStub); + }); + + it('has close method for the initialized client', done => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.authorizedDomainsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.authorizedDomainsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + 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 authorizeddomainsModule.v1.AuthorizedDomainsClient({ + 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('listAuthorizedDomains', () => { + it('invokes listAuthorizedDomains without error', async () => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedDomainsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedDomainsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + ]; + client.innerApiCalls.listAuthorizedDomains = + stubSimpleCall(expectedResponse); + const [response] = await client.listAuthorizedDomains(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAuthorizedDomains as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAuthorizedDomains as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizedDomains without error using callback', async () => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedDomainsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedDomainsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + ]; + client.innerApiCalls.listAuthorizedDomains = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAuthorizedDomains( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IAuthorizedDomain[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAuthorizedDomains as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAuthorizedDomains as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizedDomains with error', async () => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedDomainsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedDomainsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAuthorizedDomains = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listAuthorizedDomains(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listAuthorizedDomains as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAuthorizedDomains as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizedDomainsStream without error', async () => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedDomainsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedDomainsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + ]; + client.descriptors.page.listAuthorizedDomains.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAuthorizedDomainsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.AuthorizedDomain[] = []; + stream.on( + 'data', + (response: protos.google.appengine.v1.AuthorizedDomain) => { + 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.listAuthorizedDomains + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAuthorizedDomains, request) + ); + assert( + ( + client.descriptors.page.listAuthorizedDomains + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAuthorizedDomainsStream with error', async () => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedDomainsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedDomainsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAuthorizedDomains.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAuthorizedDomainsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.AuthorizedDomain[] = []; + stream.on( + 'data', + (response: protos.google.appengine.v1.AuthorizedDomain) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listAuthorizedDomains + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAuthorizedDomains, request) + ); + assert( + ( + client.descriptors.page.listAuthorizedDomains + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAuthorizedDomains without error', async () => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedDomainsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedDomainsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + generateSampleMessage( + new protos.google.appengine.v1.AuthorizedDomain() + ), + ]; + client.descriptors.page.listAuthorizedDomains.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.appengine.v1.IAuthorizedDomain[] = []; + const iterable = client.listAuthorizedDomainsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAuthorizedDomains + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listAuthorizedDomains + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAuthorizedDomains with error', async () => { + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListAuthorizedDomainsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListAuthorizedDomainsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAuthorizedDomains.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAuthorizedDomainsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.appengine.v1.IAuthorizedDomain[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAuthorizedDomains + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listAuthorizedDomains + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + app: 'appValue', + service: 'serviceValue', + version: 'versionValue', + instance: 'instanceValue', + }; + const client = new authorizeddomainsModule.v1.AuthorizedDomainsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'appValue', + 'serviceValue', + 'versionValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAppFromInstanceName', () => { + const result = client.matchAppFromInstanceName(fakePath); + assert.strictEqual(result, 'appValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromInstanceName', () => { + const result = client.matchServiceFromInstanceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromInstanceName', () => { + const result = client.matchVersionFromInstanceName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-appengine/test/gapic_domain_mappings_v1.ts b/packages/google-appengine/test/gapic_domain_mappings_v1.ts new file mode 100644 index 00000000000..5e866eb9538 --- /dev/null +++ b/packages/google-appengine/test/gapic_domain_mappings_v1.ts @@ -0,0 +1,1353 @@ +// 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 domainmappingsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.DomainMappingsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + domainmappingsModule.v1.DomainMappingsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + domainmappingsModule.v1.DomainMappingsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = domainmappingsModule.v1.DomainMappingsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new domainmappingsModule.v1.DomainMappingsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.domainMappingsStub, undefined); + await client.initialize(); + assert(client.domainMappingsStub); + }); + + it('has close method for the initialized client', done => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.domainMappingsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.domainMappingsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new domainmappingsModule.v1.DomainMappingsClient({ + 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 domainmappingsModule.v1.DomainMappingsClient({ + 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('getDomainMapping', () => { + it('invokes getDomainMapping without error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.DomainMapping() + ); + client.innerApiCalls.getDomainMapping = stubSimpleCall(expectedResponse); + const [response] = await client.getDomainMapping(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDomainMapping without error using callback', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.DomainMapping() + ); + client.innerApiCalls.getDomainMapping = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDomainMapping( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IDomainMapping | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDomainMapping with error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDomainMapping = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDomainMapping(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDomainMapping with closed client', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDomainMapping(request), expectedError); + }); + }); + + describe('createDomainMapping', () => { + it('invokes createDomainMapping without error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateDomainMappingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDomainMapping = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createDomainMapping(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDomainMapping without error using callback', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateDomainMappingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDomainMapping = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDomainMapping( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDomainMapping with call error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateDomainMappingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDomainMapping = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createDomainMapping(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDomainMapping with LRO error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateDomainMappingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDomainMapping = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createDomainMapping(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateDomainMappingProgress without error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + 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.checkCreateDomainMappingProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDomainMappingProgress with error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + 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.checkCreateDomainMappingProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateDomainMapping', () => { + it('invokes updateDomainMapping without error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDomainMapping = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDomainMapping(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDomainMapping without error using callback', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDomainMapping = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDomainMapping( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDomainMapping with call error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDomainMapping = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDomainMapping(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDomainMapping with LRO error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDomainMapping = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateDomainMapping(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDomainMappingProgress without error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + 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.checkUpdateDomainMappingProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDomainMappingProgress with error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + 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.checkUpdateDomainMappingProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteDomainMapping', () => { + it('invokes deleteDomainMapping without error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDomainMapping = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDomainMapping(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDomainMapping without error using callback', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDomainMapping = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDomainMapping( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDomainMapping with call error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDomainMapping = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDomainMapping(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDomainMapping with LRO error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteDomainMappingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteDomainMappingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDomainMapping = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteDomainMapping(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDomainMapping as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDomainMapping as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteDomainMappingProgress without error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + 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.checkDeleteDomainMappingProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDomainMappingProgress with error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + 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.checkDeleteDomainMappingProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDomainMappings', () => { + it('invokes listDomainMappings without error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListDomainMappingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListDomainMappingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + ]; + client.innerApiCalls.listDomainMappings = + stubSimpleCall(expectedResponse); + const [response] = await client.listDomainMappings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDomainMappings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDomainMappings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDomainMappings without error using callback', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListDomainMappingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListDomainMappingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + ]; + client.innerApiCalls.listDomainMappings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDomainMappings( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IDomainMapping[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDomainMappings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDomainMappings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDomainMappings with error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListDomainMappingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListDomainMappingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDomainMappings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDomainMappings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDomainMappings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDomainMappings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDomainMappingsStream without error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListDomainMappingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListDomainMappingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + ]; + client.descriptors.page.listDomainMappings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDomainMappingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.DomainMapping[] = []; + stream.on( + 'data', + (response: protos.google.appengine.v1.DomainMapping) => { + 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.listDomainMappings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDomainMappings, request) + ); + assert( + (client.descriptors.page.listDomainMappings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDomainMappingsStream with error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListDomainMappingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListDomainMappingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDomainMappings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDomainMappingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.DomainMapping[] = []; + stream.on( + 'data', + (response: protos.google.appengine.v1.DomainMapping) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDomainMappings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDomainMappings, request) + ); + assert( + (client.descriptors.page.listDomainMappings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDomainMappings without error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListDomainMappingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListDomainMappingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), + ]; + client.descriptors.page.listDomainMappings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.appengine.v1.IDomainMapping[] = []; + const iterable = client.listDomainMappingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDomainMappings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDomainMappings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDomainMappings with error', async () => { + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListDomainMappingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListDomainMappingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDomainMappings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDomainMappingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.appengine.v1.IDomainMapping[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDomainMappings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDomainMappings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + app: 'appValue', + service: 'serviceValue', + version: 'versionValue', + instance: 'instanceValue', + }; + const client = new domainmappingsModule.v1.DomainMappingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'appValue', + 'serviceValue', + 'versionValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAppFromInstanceName', () => { + const result = client.matchAppFromInstanceName(fakePath); + assert.strictEqual(result, 'appValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromInstanceName', () => { + const result = client.matchServiceFromInstanceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromInstanceName', () => { + const result = client.matchVersionFromInstanceName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-appengine/test/gapic_firewall_v1.ts b/packages/google-appengine/test/gapic_firewall_v1.ts new file mode 100644 index 00000000000..357bba3c40e --- /dev/null +++ b/packages/google-appengine/test/gapic_firewall_v1.ts @@ -0,0 +1,1263 @@ +// 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 firewallModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.FirewallClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = firewallModule.v1.FirewallClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = firewallModule.v1.FirewallClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = firewallModule.v1.FirewallClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new firewallModule.v1.FirewallClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new firewallModule.v1.FirewallClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.firewallStub, undefined); + await client.initialize(); + assert(client.firewallStub); + }); + + it('has close method for the initialized client', done => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.firewallStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.firewallStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new firewallModule.v1.FirewallClient({ + 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 firewallModule.v1.FirewallClient({ + 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('batchUpdateIngressRules', () => { + it('invokes batchUpdateIngressRules without error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.BatchUpdateIngressRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.BatchUpdateIngressRulesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.BatchUpdateIngressRulesResponse() + ); + client.innerApiCalls.batchUpdateIngressRules = + stubSimpleCall(expectedResponse); + const [response] = await client.batchUpdateIngressRules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchUpdateIngressRules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateIngressRules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateIngressRules without error using callback', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.BatchUpdateIngressRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.BatchUpdateIngressRulesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.BatchUpdateIngressRulesResponse() + ); + client.innerApiCalls.batchUpdateIngressRules = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchUpdateIngressRules( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IBatchUpdateIngressRulesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchUpdateIngressRules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateIngressRules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateIngressRules with error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.BatchUpdateIngressRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.BatchUpdateIngressRulesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchUpdateIngressRules = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.batchUpdateIngressRules(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.batchUpdateIngressRules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateIngressRules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateIngressRules with closed client', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.BatchUpdateIngressRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.BatchUpdateIngressRulesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.batchUpdateIngressRules(request), + expectedError + ); + }); + }); + + describe('createIngressRule', () => { + it('invokes createIngressRule without error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateIngressRuleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.FirewallRule() + ); + client.innerApiCalls.createIngressRule = stubSimpleCall(expectedResponse); + const [response] = await client.createIngressRule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIngressRule without error using callback', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateIngressRuleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.FirewallRule() + ); + client.innerApiCalls.createIngressRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createIngressRule( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IFirewallRule | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIngressRule with error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateIngressRuleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIngressRule = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createIngressRule(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIngressRule with closed client', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateIngressRuleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createIngressRule(request), expectedError); + }); + }); + + describe('getIngressRule', () => { + it('invokes getIngressRule without error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.FirewallRule() + ); + client.innerApiCalls.getIngressRule = stubSimpleCall(expectedResponse); + const [response] = await client.getIngressRule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIngressRule without error using callback', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.FirewallRule() + ); + client.innerApiCalls.getIngressRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIngressRule( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IFirewallRule | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIngressRule with error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIngressRule = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIngressRule(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIngressRule with closed client', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIngressRule(request), expectedError); + }); + }); + + describe('updateIngressRule', () => { + it('invokes updateIngressRule without error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.FirewallRule() + ); + client.innerApiCalls.updateIngressRule = stubSimpleCall(expectedResponse); + const [response] = await client.updateIngressRule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIngressRule without error using callback', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.FirewallRule() + ); + client.innerApiCalls.updateIngressRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateIngressRule( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IFirewallRule | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIngressRule with error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIngressRule = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateIngressRule(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIngressRule with closed client', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateIngressRule(request), expectedError); + }); + }); + + describe('deleteIngressRule', () => { + it('invokes deleteIngressRule without error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteIngressRule = stubSimpleCall(expectedResponse); + const [response] = await client.deleteIngressRule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIngressRule without error using callback', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteIngressRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteIngressRule( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIngressRule with error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIngressRule = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteIngressRule(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteIngressRule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIngressRule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIngressRule with closed client', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteIngressRuleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteIngressRuleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteIngressRule(request), expectedError); + }); + }); + + describe('listIngressRules', () => { + it('invokes listIngressRules without error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListIngressRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListIngressRulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + ]; + client.innerApiCalls.listIngressRules = stubSimpleCall(expectedResponse); + const [response] = await client.listIngressRules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listIngressRules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIngressRules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIngressRules without error using callback', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListIngressRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListIngressRulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + ]; + client.innerApiCalls.listIngressRules = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listIngressRules( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IFirewallRule[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listIngressRules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIngressRules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIngressRules with error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListIngressRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListIngressRulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listIngressRules = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listIngressRules(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listIngressRules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIngressRules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIngressRulesStream without error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListIngressRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListIngressRulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + ]; + client.descriptors.page.listIngressRules.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listIngressRulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.FirewallRule[] = []; + stream.on( + 'data', + (response: protos.google.appengine.v1.FirewallRule) => { + 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.listIngressRules.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listIngressRules, request) + ); + assert( + (client.descriptors.page.listIngressRules.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listIngressRulesStream with error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListIngressRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListIngressRulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listIngressRules.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listIngressRulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.FirewallRule[] = []; + stream.on( + 'data', + (response: protos.google.appengine.v1.FirewallRule) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listIngressRules.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listIngressRules, request) + ); + assert( + (client.descriptors.page.listIngressRules.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listIngressRules without error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListIngressRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListIngressRulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), + ]; + client.descriptors.page.listIngressRules.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.appengine.v1.IFirewallRule[] = []; + const iterable = client.listIngressRulesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listIngressRules.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listIngressRules.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listIngressRules with error', async () => { + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListIngressRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListIngressRulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listIngressRules.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listIngressRulesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.appengine.v1.IFirewallRule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listIngressRules.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listIngressRules.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + app: 'appValue', + service: 'serviceValue', + version: 'versionValue', + instance: 'instanceValue', + }; + const client = new firewallModule.v1.FirewallClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'appValue', + 'serviceValue', + 'versionValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAppFromInstanceName', () => { + const result = client.matchAppFromInstanceName(fakePath); + assert.strictEqual(result, 'appValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromInstanceName', () => { + const result = client.matchServiceFromInstanceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromInstanceName', () => { + const result = client.matchVersionFromInstanceName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-appengine/test/gapic_instances_v1.ts b/packages/google-appengine/test/gapic_instances_v1.ts new file mode 100644 index 00000000000..aabf2e5c227 --- /dev/null +++ b/packages/google-appengine/test/gapic_instances_v1.ts @@ -0,0 +1,1150 @@ +// 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 instancesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.InstancesClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = instancesModule.v1.InstancesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = instancesModule.v1.InstancesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = instancesModule.v1.InstancesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new instancesModule.v1.InstancesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new instancesModule.v1.InstancesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.instancesStub, undefined); + await client.initialize(); + assert(client.instancesStub); + }); + + it('has close method for the initialized client', done => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.instancesStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.instancesStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.Instance() + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IInstance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + 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.checkDeleteInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + 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.checkDeleteInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('debugInstance', () => { + it('invokes debugInstance without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DebugInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DebugInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.debugInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.debugInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.debugInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.debugInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes debugInstance without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DebugInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DebugInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.debugInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.debugInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.debugInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.debugInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes debugInstance with call error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DebugInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DebugInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.debugInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.debugInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.debugInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.debugInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes debugInstance with LRO error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DebugInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DebugInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.debugInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.debugInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.debugInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.debugInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDebugInstanceProgress without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + 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.checkDebugInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDebugInstanceProgress with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + 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.checkDebugInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Instance()), + generateSampleMessage(new protos.google.appengine.v1.Instance()), + generateSampleMessage(new protos.google.appengine.v1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Instance()), + generateSampleMessage(new protos.google.appengine.v1.Instance()), + generateSampleMessage(new protos.google.appengine.v1.Instance()), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IInstance[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInstances(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Instance()), + generateSampleMessage(new protos.google.appengine.v1.Instance()), + generateSampleMessage(new protos.google.appengine.v1.Instance()), + ]; + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.Instance[] = []; + stream.on('data', (response: protos.google.appengine.v1.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.Instance[] = []; + stream.on('data', (response: protos.google.appengine.v1.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Instance()), + generateSampleMessage(new protos.google.appengine.v1.Instance()), + generateSampleMessage(new protos.google.appengine.v1.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.appengine.v1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.appengine.v1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + app: 'appValue', + service: 'serviceValue', + version: 'versionValue', + instance: 'instanceValue', + }; + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'appValue', + 'serviceValue', + 'versionValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAppFromInstanceName', () => { + const result = client.matchAppFromInstanceName(fakePath); + assert.strictEqual(result, 'appValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromInstanceName', () => { + const result = client.matchServiceFromInstanceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromInstanceName', () => { + const result = client.matchVersionFromInstanceName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-appengine/test/gapic_services_v1.ts b/packages/google-appengine/test/gapic_services_v1.ts new file mode 100644 index 00000000000..e1d5bd3e171 --- /dev/null +++ b/packages/google-appengine/test/gapic_services_v1.ts @@ -0,0 +1,1152 @@ +// 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 servicesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.ServicesClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = servicesModule.v1.ServicesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = servicesModule.v1.ServicesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = servicesModule.v1.ServicesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new servicesModule.v1.ServicesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new servicesModule.v1.ServicesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.servicesStub, undefined); + await client.initialize(); + assert(client.servicesStub); + }); + + it('has close method for the initialized client', done => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.servicesStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.servicesStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getService', () => { + it('invokes getService without error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.Service() + ); + client.innerApiCalls.getService = stubSimpleCall(expectedResponse); + const [response] = await client.getService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getService without error using callback', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.Service() + ); + client.innerApiCalls.getService = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getService( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IService | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getService with error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getService = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getService(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getService with closed client', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getService(request), expectedError); + }); + }); + + describe('updateService', () => { + it('invokes updateService without error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateService = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateService(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateService without error using callback', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateService = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateService( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateService with call error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateService = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateService(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateService with LRO error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateService = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateService(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateServiceProgress without error', async () => { + const client = new servicesModule.v1.ServicesClient({ + 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.checkUpdateServiceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateServiceProgress with error', async () => { + const client = new servicesModule.v1.ServicesClient({ + 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.checkUpdateServiceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteService', () => { + it('invokes deleteService without error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteService = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteService(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteService without error using callback', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteService = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteService( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteService with call error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteService = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteService(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteService with LRO error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteService = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteService(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteServiceProgress without error', async () => { + const client = new servicesModule.v1.ServicesClient({ + 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.checkDeleteServiceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteServiceProgress with error', async () => { + const client = new servicesModule.v1.ServicesClient({ + 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.checkDeleteServiceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listServices', () => { + it('invokes listServices without error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListServicesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListServicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Service()), + generateSampleMessage(new protos.google.appengine.v1.Service()), + generateSampleMessage(new protos.google.appengine.v1.Service()), + ]; + client.innerApiCalls.listServices = stubSimpleCall(expectedResponse); + const [response] = await client.listServices(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listServices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServices without error using callback', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListServicesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListServicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Service()), + generateSampleMessage(new protos.google.appengine.v1.Service()), + generateSampleMessage(new protos.google.appengine.v1.Service()), + ]; + client.innerApiCalls.listServices = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listServices( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IService[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listServices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServices with error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListServicesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListServicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listServices = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listServices(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listServices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServicesStream without error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListServicesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListServicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Service()), + generateSampleMessage(new protos.google.appengine.v1.Service()), + generateSampleMessage(new protos.google.appengine.v1.Service()), + ]; + client.descriptors.page.listServices.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listServicesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.Service[] = []; + stream.on('data', (response: protos.google.appengine.v1.Service) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listServices.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listServices, request) + ); + assert( + (client.descriptors.page.listServices.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listServicesStream with error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListServicesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListServicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listServices.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listServicesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.Service[] = []; + stream.on('data', (response: protos.google.appengine.v1.Service) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listServices.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listServices, request) + ); + assert( + (client.descriptors.page.listServices.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServices without error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListServicesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListServicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Service()), + generateSampleMessage(new protos.google.appengine.v1.Service()), + generateSampleMessage(new protos.google.appengine.v1.Service()), + ]; + client.descriptors.page.listServices.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.appengine.v1.IService[] = []; + const iterable = client.listServicesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listServices.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listServices.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServices with error', async () => { + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListServicesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListServicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listServices.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listServicesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.appengine.v1.IService[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listServices.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listServices.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + app: 'appValue', + service: 'serviceValue', + version: 'versionValue', + instance: 'instanceValue', + }; + const client = new servicesModule.v1.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'appValue', + 'serviceValue', + 'versionValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAppFromInstanceName', () => { + const result = client.matchAppFromInstanceName(fakePath); + assert.strictEqual(result, 'appValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromInstanceName', () => { + const result = client.matchServiceFromInstanceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromInstanceName', () => { + const result = client.matchVersionFromInstanceName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-appengine/test/gapic_versions_v1.ts b/packages/google-appengine/test/gapic_versions_v1.ts new file mode 100644 index 00000000000..f59941c4057 --- /dev/null +++ b/packages/google-appengine/test/gapic_versions_v1.ts @@ -0,0 +1,1346 @@ +// 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 versionsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.VersionsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = versionsModule.v1.VersionsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = versionsModule.v1.VersionsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = versionsModule.v1.VersionsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new versionsModule.v1.VersionsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new versionsModule.v1.VersionsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.versionsStub, undefined); + await client.initialize(); + assert(client.versionsStub); + }); + + it('has close method for the initialized client', done => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.versionsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.versionsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new versionsModule.v1.VersionsClient({ + 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 versionsModule.v1.VersionsClient({ + 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('getVersion', () => { + it('invokes getVersion without error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.Version() + ); + client.innerApiCalls.getVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion without error using callback', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.appengine.v1.Version() + ); + client.innerApiCalls.getVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVersion( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with closed client', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.GetVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.GetVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getVersion(request), expectedError); + }); + }); + + describe('createVersion', () => { + it('invokes createVersion without error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createVersion = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion without error using callback', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createVersion = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createVersion( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.ICreateVersionMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.ICreateVersionMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with call error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVersion = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with LRO error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.CreateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.CreateVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVersion = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateVersionProgress without error', async () => { + const client = new versionsModule.v1.VersionsClient({ + 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.checkCreateVersionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateVersionProgress with error', async () => { + const client = new versionsModule.v1.VersionsClient({ + 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.checkCreateVersionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateVersion', () => { + it('invokes updateVersion without error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateVersion = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion without error using callback', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateVersion = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateVersion( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with call error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateVersion = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with LRO error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.UpdateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.UpdateVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateVersion = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateVersionProgress without error', async () => { + const client = new versionsModule.v1.VersionsClient({ + 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.checkUpdateVersionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateVersionProgress with error', async () => { + const client = new versionsModule.v1.VersionsClient({ + 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.checkUpdateVersionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteVersion', () => { + it('invokes deleteVersion without error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteVersion = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion without error using callback', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteVersion = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteVersion( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with call error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteVersion = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with LRO error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.DeleteVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.DeleteVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteVersion = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteVersionProgress without error', async () => { + const client = new versionsModule.v1.VersionsClient({ + 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.checkDeleteVersionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteVersionProgress with error', async () => { + const client = new versionsModule.v1.VersionsClient({ + 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.checkDeleteVersionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listVersions', () => { + it('invokes listVersions without error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Version()), + generateSampleMessage(new protos.google.appengine.v1.Version()), + generateSampleMessage(new protos.google.appengine.v1.Version()), + ]; + client.innerApiCalls.listVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions without error using callback', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Version()), + generateSampleMessage(new protos.google.appengine.v1.Version()), + generateSampleMessage(new protos.google.appengine.v1.Version()), + ]; + client.innerApiCalls.listVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVersions( + request, + ( + err?: Error | null, + result?: protos.google.appengine.v1.IVersion[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions with error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVersions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersionsStream without error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Version()), + generateSampleMessage(new protos.google.appengine.v1.Version()), + generateSampleMessage(new protos.google.appengine.v1.Version()), + ]; + client.descriptors.page.listVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.Version[] = []; + stream.on('data', (response: protos.google.appengine.v1.Version) => { + 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.listVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVersions, request) + ); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listVersionsStream with error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.appengine.v1.Version[] = []; + stream.on('data', (response: protos.google.appengine.v1.Version) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVersions, request) + ); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVersions without error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.appengine.v1.Version()), + generateSampleMessage(new protos.google.appengine.v1.Version()), + generateSampleMessage(new protos.google.appengine.v1.Version()), + ]; + client.descriptors.page.listVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.appengine.v1.IVersion[] = []; + const iterable = client.listVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVersions with error', async () => { + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.appengine.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.appengine.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.appengine.v1.IVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + app: 'appValue', + service: 'serviceValue', + version: 'versionValue', + instance: 'instanceValue', + }; + const client = new versionsModule.v1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'appValue', + 'serviceValue', + 'versionValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAppFromInstanceName', () => { + const result = client.matchAppFromInstanceName(fakePath); + assert.strictEqual(result, 'appValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromInstanceName', () => { + const result = client.matchServiceFromInstanceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromInstanceName', () => { + const result = client.matchVersionFromInstanceName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-appengine/tsconfig.json b/packages/google-appengine/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-appengine/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-appengine/webpack.config.js b/packages/google-appengine/webpack.config.js new file mode 100644 index 00000000000..f9afe383f73 --- /dev/null +++ b/packages/google-appengine/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: 'Applications', + filename: './applications.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 dded3ee086d..cd69b08d747 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -2,6 +2,7 @@ "initial-version": "0.1.0", "packages": { "packages/google-api-apikeys": {}, + "packages/google-appengine": {}, "packages/google-cloud-accessapproval": {}, "packages/google-cloud-apigeeconnect": {}, "packages/google-cloud-asset": {},