diff --git a/packages/google-api-servicemanagement/.eslintignore b/packages/google-api-servicemanagement/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-api-servicemanagement/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-api-servicemanagement/.eslintrc.json b/packages/google-api-servicemanagement/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-api-servicemanagement/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-api-servicemanagement/.gitattributes b/packages/google-api-servicemanagement/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-api-servicemanagement/.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-api-servicemanagement/.github/.OwlBot.yaml b/packages/google-api-servicemanagement/.github/.OwlBot.yaml new file mode 100644 index 00000000000..b5a6d445b4f --- /dev/null +++ b/packages/google-api-servicemanagement/.github/.OwlBot.yaml @@ -0,0 +1,26 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest + + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/api/servicemanagement/(v.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: ea0f18027eafb4801813fa253f16ffeef904b4c6 + diff --git a/packages/google-api-servicemanagement/.gitignore b/packages/google-api-servicemanagement/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-api-servicemanagement/.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-api-servicemanagement/.jsdoc.js b/packages/google-api-servicemanagement/.jsdoc.js new file mode 100644 index 00000000000..888e97fc97b --- /dev/null +++ b/packages/google-api-servicemanagement/.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/service-management', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-api-servicemanagement/.mocharc.js b/packages/google-api-servicemanagement/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-api-servicemanagement/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-api-servicemanagement/.nycrc b/packages/google-api-servicemanagement/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-api-servicemanagement/.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-api-servicemanagement/.prettierignore b/packages/google-api-servicemanagement/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-api-servicemanagement/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-api-servicemanagement/.prettierrc.js b/packages/google-api-servicemanagement/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-api-servicemanagement/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-api-servicemanagement/.repo-metadata.json b/packages/google-api-servicemanagement/.repo-metadata.json new file mode 100644 index 00000000000..3d7bc77f36e --- /dev/null +++ b/packages/google-api-servicemanagement/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "issue_tracker": "https://github.com/googleapis/nodejs-service-management/issues", + "distribution_name": "@google-cloud/service-management", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/service-management/latest", + "product_documentation": "https://cloud.google.com/service-infrastructure/docs/overview/", + "name_pretty": "Service Management API", + "release_level": "stable", + "default_version": "v1", + "name": "service-management", + "api_id": "servicemanagement.googleapis.com", + "requires_billing": true, + "language": "nodejs", + "repo": "googleapis/nodejs-service-management", + "api_shortname": "servicemanagement", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-api-servicemanagement/CHANGELOG.md b/packages/google-api-servicemanagement/CHANGELOG.md new file mode 100644 index 00000000000..050fb3c7123 --- /dev/null +++ b/packages/google-api-servicemanagement/CHANGELOG.md @@ -0,0 +1,157 @@ +# Changelog + +## [1.1.3](https://github.com/googleapis/nodejs-service-management/compare/v1.1.2...v1.1.3) (2022-11-10) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#169](https://github.com/googleapis/nodejs-service-management/issues/169)) ([ef47431](https://github.com/googleapis/nodejs-service-management/commit/ef4743106afc35191647a626c8f3a8a08634ebd1)) +* Regenerated protos JS and TS definitions ([#178](https://github.com/googleapis/nodejs-service-management/issues/178)) ([9c00293](https://github.com/googleapis/nodejs-service-management/commit/9c00293b6213b8ba0e2d56fd2208d90b60c38d0d)) + +## [1.1.2](https://github.com/googleapis/nodejs-service-management/compare/v1.1.1...v1.1.2) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#166](https://github.com/googleapis/nodejs-service-management/issues/166)) ([deda310](https://github.com/googleapis/nodejs-service-management/commit/deda3102c60ed95a03de5f4ae123c858d9af1cf4)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-service-management/issues/1553)) ([#165](https://github.com/googleapis/nodejs-service-management/issues/165)) ([aa21cf2](https://github.com/googleapis/nodejs-service-management/commit/aa21cf2c463c6410be8f9dc8906493dc78f131c1)) + +## [1.1.1](https://github.com/googleapis/nodejs-service-management/compare/v1.1.0...v1.1.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#161](https://github.com/googleapis/nodejs-service-management/issues/161)) ([a84e12c](https://github.com/googleapis/nodejs-service-management/commit/a84e12c4dd4edc5b8486f7b1d47ce109b1927099)) +* change import long to require ([#162](https://github.com/googleapis/nodejs-service-management/issues/162)) ([309942f](https://github.com/googleapis/nodejs-service-management/commit/309942f977356bcaaf77a1ee439e5d4389f011ec)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-service-management/issues/1546)) ([#164](https://github.com/googleapis/nodejs-service-management/issues/164)) ([41397e6](https://github.com/googleapis/nodejs-service-management/commit/41397e628dcbc33e54d1f052343df51d8ae8a771)) + +## [1.1.0](https://github.com/googleapis/nodejs-service-management/compare/v1.0.0...v1.1.0) (2022-06-30) + + +### Features + +* support regapic LRO ([#154](https://github.com/googleapis/nodejs-service-management/issues/154)) ([9871067](https://github.com/googleapis/nodejs-service-management/commit/9871067a828e4ec332906f2013956f9b2ade2b00)) + +## [1.0.0](https://github.com/googleapis/nodejs-service-management/compare/v0.4.0...v1.0.0) (2022-05-31) + + +### ⚠ BREAKING CHANGES + +* promote to stable (#140) +* update library to use Node 12 (#138) + +### Features + +* promote to stable ([#140](https://github.com/googleapis/nodejs-service-management/issues/140)) ([f40509e](https://github.com/googleapis/nodejs-service-management/commit/f40509ee35dbafff16e4300d2173be5c41abacf4)) + + +### Bug Fixes + +* fixes for dynamic routing and streaming descriptors ([#142](https://github.com/googleapis/nodejs-service-management/issues/142)) ([6d02ca8](https://github.com/googleapis/nodejs-service-management/commit/6d02ca800a29eb3b6383127efe43ad8e603992c3)) + + +### Build System + +* update library to use Node 12 ([#138](https://github.com/googleapis/nodejs-service-management/issues/138)) ([a9eed29](https://github.com/googleapis/nodejs-service-management/commit/a9eed29598c8b56d4c80161d0046be0db4430c66)) + +## [0.4.0](https://github.com/googleapis/nodejs-service-management/compare/v0.3.1...v0.4.0) (2022-03-08) + + +### ⚠ BREAKING CHANGES + +* Remove EnableService and DisableService RPC methods and related protos from service management API + +### Features + +* Remove EnableService and DisableService RPC methods and related protos from service management API ([d3919ab](https://github.com/googleapis/nodejs-service-management/commit/d3919abbf7ba458cc71e8038604f56d598571fe4)) + +### [0.3.1](https://www.github.com/googleapis/nodejs-service-management/compare/v0.3.0...v0.3.1) (2021-09-10) + + +### Bug Fixes + +* **build:** set default branch to main ([#85](https://www.github.com/googleapis/nodejs-service-management/issues/85)) ([b343eac](https://www.github.com/googleapis/nodejs-service-management/commit/b343eaca04b4f651c737d8a84baa5a75a361c4b0)) + +## [0.3.0](https://www.github.com/googleapis/nodejs-service-management/compare/v0.2.6...v0.3.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#81](https://www.github.com/googleapis/nodejs-service-management/issues/81)) ([237698f](https://www.github.com/googleapis/nodejs-service-management/commit/237698f72dfdd14e95d956a2e45f6db423e45e23)) + +### [0.2.6](https://www.github.com/googleapis/nodejs-service-management/compare/v0.2.5...v0.2.6) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#79](https://www.github.com/googleapis/nodejs-service-management/issues/79)) ([b679b6c](https://www.github.com/googleapis/nodejs-service-management/commit/b679b6c3dff457764698044b8b325a52922fbb46)) + +### [0.2.5](https://www.github.com/googleapis/nodejs-service-management/compare/v0.2.4...v0.2.5) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#70](https://www.github.com/googleapis/nodejs-service-management/issues/70)) ([fc4f996](https://www.github.com/googleapis/nodejs-service-management/commit/fc4f99666252f8f06f399438aedebb6e5502f2e9)) + +### [0.2.4](https://www.github.com/googleapis/nodejs-service-management/compare/v0.2.3...v0.2.4) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#67](https://www.github.com/googleapis/nodejs-service-management/issues/67)) ([39328cd](https://www.github.com/googleapis/nodejs-service-management/commit/39328cdd1389ab2bddb1744bb8a77774e5a924c2)) + +### [0.2.3](https://www.github.com/googleapis/nodejs-service-management/compare/v0.2.2...v0.2.3) (2021-06-25) + + +### Bug Fixes + +* make request optional in all cases ([#61](https://www.github.com/googleapis/nodejs-service-management/issues/61)) ([8ba608c](https://www.github.com/googleapis/nodejs-service-management/commit/8ba608caad06f54c0f4fb650b18948a1143440f4)) + +### [0.2.2](https://www.github.com/googleapis/nodejs-service-management/compare/v0.2.1...v0.2.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#54](https://www.github.com/googleapis/nodejs-service-management/issues/54)) ([9376a6c](https://www.github.com/googleapis/nodejs-service-management/commit/9376a6c9836b9460d512a8fbd32094cc4f5ccb85)) + +### [0.2.1](https://www.github.com/googleapis/nodejs-service-management/compare/v0.2.0...v0.2.1) (2021-05-24) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#48](https://www.github.com/googleapis/nodejs-service-management/issues/48)) ([e679ea9](https://www.github.com/googleapis/nodejs-service-management/commit/e679ea9d735b9edd25913b990e3a0d037025c984)) +* use require() to load JSON protos ([#50](https://www.github.com/googleapis/nodejs-service-management/issues/50)) ([786af32](https://www.github.com/googleapis/nodejs-service-management/commit/786af32612aed97ef4ec55b2d0b02932e351be38)) + +## 0.2.0 (2021-03-30) + + +### ⚠ BREAKING CHANGES + +* initial stub of library + +### Features + +* add initial samples ([#2](https://www.github.com/googleapis/nodejs-service-management/issues/2)) ([e12039f](https://www.github.com/googleapis/nodejs-service-management/commit/e12039fff76d1d76692c7f87852c2e878c0f847f)) +* initial stub of library ([728ac20](https://www.github.com/googleapis/nodejs-service-management/commit/728ac209c44ba39714fb8c8acb38a7c0163acd6c)) + + +### Bug Fixes + +* **build:** release first version of library as v0.2.0 ([#14](https://www.github.com/googleapis/nodejs-service-management/issues/14)) ([3707e68](https://www.github.com/googleapis/nodejs-service-management/commit/3707e680f7cd038ea4b6c7589a5846b8ce5fcc96)) + +## 0.2.0 (2021-03-30) + + +### ⚠ BREAKING CHANGES + +* initial stub of library + +### Features + +* add initial samples ([#2](https://www.github.com/googleapis/nodejs-service-management/issues/2)) ([e12039f](https://www.github.com/googleapis/nodejs-service-management/commit/e12039fff76d1d76692c7f87852c2e878c0f847f)) +* initial stub of library ([728ac20](https://www.github.com/googleapis/nodejs-service-management/commit/728ac209c44ba39714fb8c8acb38a7c0163acd6c)) + + +### Bug Fixes + +* **build:** release first version of library as v0.2.0 ([#14](https://www.github.com/googleapis/nodejs-service-management/issues/14)) ([3707e68](https://www.github.com/googleapis/nodejs-service-management/commit/3707e680f7cd038ea4b6c7589a5846b8ce5fcc96)) diff --git a/packages/google-api-servicemanagement/CODE_OF_CONDUCT.md b/packages/google-api-servicemanagement/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-api-servicemanagement/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-api-servicemanagement/CONTRIBUTING.md b/packages/google-api-servicemanagement/CONTRIBUTING.md new file mode 100644 index 00000000000..99a0d03ee1c --- /dev/null +++ b/packages/google-api-servicemanagement/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 Service Management 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=servicemanagement.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-api-servicemanagement/LICENSE b/packages/google-api-servicemanagement/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-api-servicemanagement/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-api-servicemanagement/README.md b/packages/google-api-servicemanagement/README.md new file mode 100644 index 00000000000..30f8741a145 --- /dev/null +++ b/packages/google-api-servicemanagement/README.md @@ -0,0 +1,158 @@ +[//]: # "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 + +# [Service Management API: Node.js Client](https://github.com/googleapis/nodejs-service-management) + +[![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/service-management.svg)](https://www.npmjs.org/package/@google-cloud/service-management) + + + + +Service management client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-service-management/blob/main/CHANGELOG.md). + +* [Service Management API Node.js Client API Reference][client-docs] +* [Service Management API Documentation][product-docs] +* [github.com/googleapis/nodejs-service-management](https://github.com/googleapis/nodejs-service-management) + +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 Service Management 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/service-management +``` + + +### Using the client library + +```javascript + +// Imports the Google Cloud client library +const {ServiceManagerClient} = require('@google-cloud/service-management'); + +// TODO(developer): replace with your prefered project ID. +// const projectId = 'my-project' + +// Creates a client +const client = new ServiceManagerClient(); + +async function listServices() { + const [services] = await client.listServices({ + producerProjectId: projectId, + }); + console.info(services); +} +listServices(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-service-management/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-service-management/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-service-management&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +The [Service Management 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/service-management@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-service-management/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-service-management/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/service-management/latest +[product-docs]: https://cloud.google.com/service-infrastructure/docs/overview/ +[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=servicemanagement.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-api-servicemanagement/linkinator.config.json b/packages/google-api-servicemanagement/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-api-servicemanagement/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-api-servicemanagement/package.json b/packages/google-api-servicemanagement/package.json new file mode 100644 index 00000000000..1a1dbb2e967 --- /dev/null +++ b/packages/google-api-servicemanagement/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/service-management", + "version": "1.1.3", + "description": "Service management client for Node.js", + "repository": "googleapis/nodejs-service-management", + "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 servicemanagement", + "servicemanagement", + "service manager" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "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" + } +} diff --git a/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/resources.proto b/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/resources.proto new file mode 100644 index 00000000000..57ffd770b94 --- /dev/null +++ b/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/resources.proto @@ -0,0 +1,295 @@ +// 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.api.servicemanagement.v1; + +import "google/api/config_change.proto"; +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ServiceManagement.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/servicemanagement/v1;servicemanagement"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.api.servicemanagement.v1"; +option objc_class_prefix = "GASM"; +option php_namespace = "Google\\Cloud\\ServiceManagement\\V1"; +option ruby_package = "Google::Cloud::ServiceManagement::V1"; + +// The full representation of a Service that is managed by +// Google Service Management. +message ManagedService { + // The name of the service. See the + // [overview](https://cloud.google.com/service-infrastructure/docs/overview) + // for naming requirements. + string service_name = 2; + + // ID of the project that produces and owns this service. + string producer_project_id = 3; +} + +// The metadata associated with a long running operation resource. +message OperationMetadata { + // Represents the status of one operation step. + message Step { + // The short description of the step. + string description = 2; + + // The status code. + Status status = 4; + } + + // Code describes the status of the operation (or one of its steps). + enum Status { + // Unspecifed code. + STATUS_UNSPECIFIED = 0; + + // The operation or step has completed without errors. + DONE = 1; + + // The operation or step has not started yet. + NOT_STARTED = 2; + + // The operation or step is in progress. + IN_PROGRESS = 3; + + // The operation or step has completed with errors. If the operation is + // rollbackable, the rollback completed with errors too. + FAILED = 4; + + // The operation or step has completed with cancellation. + CANCELLED = 5; + } + + // The full name of the resources that this operation is directly + // associated with. + repeated string resource_names = 1; + + // Detailed status information for each step. The order is undetermined. + repeated Step steps = 2; + + // Percentage of completion of this operation, ranging from 0 to 100. + int32 progress_percentage = 3; + + // The start time of the operation. + google.protobuf.Timestamp start_time = 4; +} + +// Represents a diagnostic message (error or warning) +message Diagnostic { + // The kind of diagnostic information possible. + enum Kind { + // Warnings and errors + WARNING = 0; + + // Only errors + ERROR = 1; + } + + // File name and line number of the error or warning. + string location = 1; + + // The kind of diagnostic information provided. + Kind kind = 2; + + // Message describing the error or warning. + string message = 3; +} + +// Represents a source file which is used to generate the service configuration +// defined by `google.api.Service`. +message ConfigSource { + // A unique ID for a specific instance of this message, typically assigned + // by the client for tracking purpose. If empty, the server may choose to + // generate one instead. + string id = 5; + + // Set of source configuration files that are used to generate a service + // configuration (`google.api.Service`). + repeated ConfigFile files = 2; +} + +// Generic specification of a source configuration file +message ConfigFile { + enum FileType { + // Unknown file type. + FILE_TYPE_UNSPECIFIED = 0; + + // YAML-specification of service. + SERVICE_CONFIG_YAML = 1; + + // OpenAPI specification, serialized in JSON. + OPEN_API_JSON = 2; + + // OpenAPI specification, serialized in YAML. + OPEN_API_YAML = 3; + + // FileDescriptorSet, generated by protoc. + // + // To generate, use protoc with imports and source info included. + // For an example test.proto file, the following command would put the value + // in a new file named out.pb. + // + // $protoc --include_imports --include_source_info test.proto -o out.pb + FILE_DESCRIPTOR_SET_PROTO = 4; + + // Uncompiled Proto file. Used for storage and display purposes only, + // currently server-side compilation is not supported. Should match the + // inputs to 'protoc' command used to generated FILE_DESCRIPTOR_SET_PROTO. A + // file of this type can only be included if at least one file of type + // FILE_DESCRIPTOR_SET_PROTO is included. + PROTO_FILE = 6; + } + + // The file name of the configuration file (full or relative path). + string file_path = 1; + + // The bytes that constitute the file. + bytes file_contents = 3; + + // The type of configuration file this represents. + FileType file_type = 4; +} + +// Represents a service configuration with its name and id. +message ConfigRef { + // Resource name of a service config. It must have the following + // format: "services/{service name}/configs/{config id}". + string name = 1; +} + +// Change report associated with a particular service configuration. +// +// It contains a list of ConfigChanges based on the comparison between +// two service configurations. +message ChangeReport { + // List of changes between two service configurations. + // The changes will be alphabetically sorted based on the identifier + // of each change. + // A ConfigChange identifier is a dot separated path to the configuration. + // Example: visibility.rules[selector='LibraryService.CreateBook'].restriction + repeated google.api.ConfigChange config_changes = 1; +} + +// A rollout resource that defines how service configuration versions are pushed +// to control plane systems. Typically, you create a new version of the +// service config, and then create a Rollout to push the service config. +message Rollout { + // Strategy that specifies how clients of Google Service Controller want to + // send traffic to use different config versions. This is generally + // used by API proxy to split traffic based on your configured percentage for + // each config version. + // + // One example of how to gradually rollout a new service configuration using + // this + // strategy: + // Day 1 + // + // Rollout { + // id: "example.googleapis.com/rollout_20160206" + // traffic_percent_strategy { + // percentages: { + // "example.googleapis.com/20160201": 70.00 + // "example.googleapis.com/20160206": 30.00 + // } + // } + // } + // + // Day 2 + // + // Rollout { + // id: "example.googleapis.com/rollout_20160207" + // traffic_percent_strategy: { + // percentages: { + // "example.googleapis.com/20160206": 100.00 + // } + // } + // } + message TrafficPercentStrategy { + // Maps service configuration IDs to their corresponding traffic percentage. + // Key is the service configuration ID, Value is the traffic percentage + // which must be greater than 0.0 and the sum must equal to 100.0. + map percentages = 1; + } + + // Strategy used to delete a service. This strategy is a placeholder only + // used by the system generated rollout to delete a service. + message DeleteServiceStrategy {} + + // Status of a Rollout. + enum RolloutStatus { + // No status specified. + ROLLOUT_STATUS_UNSPECIFIED = 0; + + // The Rollout is in progress. + IN_PROGRESS = 1; + + // The Rollout has completed successfully. + SUCCESS = 2; + + // The Rollout has been cancelled. This can happen if you have overlapping + // Rollout pushes, and the previous ones will be cancelled. + CANCELLED = 3; + + // The Rollout has failed and the rollback attempt has failed too. + FAILED = 4; + + // The Rollout has not started yet and is pending for execution. + PENDING = 5; + + // The Rollout has failed and rolled back to the previous successful + // Rollout. + FAILED_ROLLED_BACK = 6; + } + + // Optional. Unique identifier of this Rollout. Must be no longer than 63 + // characters and only lower case letters, digits, '.', '_' and '-' are + // allowed. + // + // If not specified by client, the server will generate one. The generated id + // will have the form of , where "date" is the create + // date in ISO 8601 format. "revision number" is a monotonically increasing + // positive number that is reset every day for each service. + // An example of the generated rollout_id is '2016-02-16r1' + string rollout_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Creation time of the rollout. Readonly. + google.protobuf.Timestamp create_time = 2; + + // The user who created the Rollout. Readonly. + string created_by = 3; + + // The status of this rollout. Readonly. In case of a failed rollout, + // the system will automatically rollback to the current Rollout + // version. Readonly. + RolloutStatus status = 4; + + // Strategy that defines which versions of service configurations should be + // pushed + // and how they should be used at runtime. + oneof strategy { + // Google Service Control selects service configurations based on + // traffic percentage. + TrafficPercentStrategy traffic_percent_strategy = 5; + + // The strategy associated with a rollout to delete a `ManagedService`. + // Readonly. + DeleteServiceStrategy delete_service_strategy = 200; + } + + // The name of the service associated with this Rollout. + string service_name = 8; +} diff --git a/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/servicemanager.proto b/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/servicemanager.proto new file mode 100644 index 00000000000..c863cd41924 --- /dev/null +++ b/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/servicemanager.proto @@ -0,0 +1,501 @@ +// 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.api.servicemanagement.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/service.proto"; +import "google/api/servicemanagement/v1/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; + +option csharp_namespace = "Google.Cloud.ServiceManagement.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/servicemanagement/v1;servicemanagement"; +option java_multiple_files = true; +option java_outer_classname = "ServiceManagerProto"; +option java_package = "com.google.api.servicemanagement.v1"; +option objc_class_prefix = "GASM"; +option php_namespace = "Google\\Cloud\\ServiceManagement\\V1"; +option ruby_package = "Google::Cloud::ServiceManagement::V1"; + +// [Google Service Management +// API](https://cloud.google.com/service-infrastructure/docs/overview) +service ServiceManager { + option (google.api.default_host) = "servicemanagement.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/service.management," + "https://www.googleapis.com/auth/service.management.readonly"; + + // Lists managed services. + // + // Returns all public services. For authenticated users, also returns all + // services the calling user has "servicemanagement.services.get" permission + // for. + rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { + option (google.api.http) = { + get: "/v1/services" + }; + option (google.api.method_signature) = "producer_project_id,consumer_id"; + } + + // Gets a managed service. Authentication is required unless the service is + // public. + rpc GetService(GetServiceRequest) returns (ManagedService) { + option (google.api.http) = { + get: "/v1/services/{service_name}" + }; + option (google.api.method_signature) = "service_name"; + } + + // Creates a new managed service. + // + // A managed service is immutable, and is subject to mandatory 30-day + // data retention. You cannot move a service or recreate it within 30 days + // after deletion. + // + // One producer project can own no more than 500 services. For security and + // reliability purposes, a production service should be hosted in a + // dedicated producer project. + // + // Operation + rpc CreateService(CreateServiceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/services" + body: "service" + }; + option (google.api.method_signature) = "service"; + option (google.longrunning.operation_info) = { + response_type: "google.api.servicemanagement.v1.ManagedService" + metadata_type: "google.api.servicemanagement.v1.OperationMetadata" + }; + } + + // Deletes a managed service. This method will change the service to the + // `Soft-Delete` state for 30 days. Within this period, service producers may + // call + // [UndeleteService][google.api.servicemanagement.v1.ServiceManager.UndeleteService] + // to restore the service. After 30 days, the service will be permanently + // deleted. + // + // Operation + rpc DeleteService(DeleteServiceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/services/{service_name}" + }; + option (google.api.method_signature) = "service_name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.api.servicemanagement.v1.OperationMetadata" + }; + } + + // Revives a previously deleted managed service. The method restores the + // service using the configuration at the time the service was deleted. + // The target service must exist and must have been deleted within the + // last 30 days. + // + // Operation + rpc UndeleteService(UndeleteServiceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/services/{service_name}:undelete" + }; + option (google.api.method_signature) = "service_name"; + option (google.longrunning.operation_info) = { + response_type: "google.api.servicemanagement.v1.UndeleteServiceResponse" + metadata_type: "google.api.servicemanagement.v1.OperationMetadata" + }; + } + + // Lists the history of the service configuration for a managed service, + // from the newest to the oldest. + rpc ListServiceConfigs(ListServiceConfigsRequest) + returns (ListServiceConfigsResponse) { + option (google.api.http) = { + get: "/v1/services/{service_name}/configs" + }; + option (google.api.method_signature) = "service_name"; + } + + // Gets a service configuration (version) for a managed service. + rpc GetServiceConfig(GetServiceConfigRequest) returns (google.api.Service) { + option (google.api.http) = { + get: "/v1/services/{service_name}/configs/{config_id}" + additional_bindings { get: "/v1/services/{service_name}/config" } + }; + option (google.api.method_signature) = "service_name,config_id,view"; + } + + // Creates a new service configuration (version) for a managed service. + // This method only stores the service configuration. To roll out the service + // configuration to backend systems please call + // [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. + // + // Only the 100 most recent service configurations and ones referenced by + // existing rollouts are kept for each service. The rest will be deleted + // eventually. + rpc CreateServiceConfig(CreateServiceConfigRequest) + returns (google.api.Service) { + option (google.api.http) = { + post: "/v1/services/{service_name}/configs" + body: "service_config" + }; + option (google.api.method_signature) = "service_name,service_config"; + } + + // Creates a new service configuration (version) for a managed service based + // on + // user-supplied configuration source files (for example: OpenAPI + // Specification). This method stores the source configurations as well as the + // generated service configuration. To rollout the service configuration to + // other services, + // please call + // [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. + // + // Only the 100 most recent configuration sources and ones referenced by + // existing service configurtions are kept for each service. The rest will be + // deleted eventually. + // + // Operation + rpc SubmitConfigSource(SubmitConfigSourceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/services/{service_name}/configs:submit" + body: "*" + }; + option (google.api.method_signature) = + "service_name,config_source,validate_only"; + option (google.longrunning.operation_info) = { + response_type: "google.api.servicemanagement.v1.SubmitConfigSourceResponse" + metadata_type: "google.api.servicemanagement.v1.OperationMetadata" + }; + } + + // Lists the history of the service configuration rollouts for a managed + // service, from the newest to the oldest. + rpc ListServiceRollouts(ListServiceRolloutsRequest) + returns (ListServiceRolloutsResponse) { + option (google.api.http) = { + get: "/v1/services/{service_name}/rollouts" + }; + option (google.api.method_signature) = "service_name,filter"; + } + + // Gets a service configuration + // [rollout][google.api.servicemanagement.v1.Rollout]. + rpc GetServiceRollout(GetServiceRolloutRequest) returns (Rollout) { + option (google.api.http) = { + get: "/v1/services/{service_name}/rollouts/{rollout_id}" + }; + option (google.api.method_signature) = "service_name,rollout_id"; + } + + // Creates a new service configuration rollout. Based on rollout, the + // Google Service Management will roll out the service configurations to + // different backend services. For example, the logging configuration will be + // pushed to Google Cloud Logging. + // + // Please note that any previous pending and running Rollouts and associated + // Operations will be automatically cancelled so that the latest Rollout will + // not be blocked by previous Rollouts. + // + // Only the 100 most recent (in any state) and the last 10 successful (if not + // already part of the set of 100 most recent) rollouts are kept for each + // service. The rest will be deleted eventually. + // + // Operation + rpc CreateServiceRollout(CreateServiceRolloutRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/services/{service_name}/rollouts" + body: "rollout" + }; + option (google.api.method_signature) = "service_name,rollout"; + option (google.longrunning.operation_info) = { + response_type: "google.api.servicemanagement.v1.Rollout" + metadata_type: "google.api.servicemanagement.v1.OperationMetadata" + }; + } + + // Generates and returns a report (errors, warnings and changes from + // existing configurations) associated with + // GenerateConfigReportRequest.new_value + // + // If GenerateConfigReportRequest.old_value is specified, + // GenerateConfigReportRequest will contain a single ChangeReport based on the + // comparison between GenerateConfigReportRequest.new_value and + // GenerateConfigReportRequest.old_value. + // If GenerateConfigReportRequest.old_value is not specified, this method + // will compare GenerateConfigReportRequest.new_value with the last pushed + // service configuration. + rpc GenerateConfigReport(GenerateConfigReportRequest) + returns (GenerateConfigReportResponse) { + option (google.api.http) = { + post: "/v1/services:generateConfigReport" + body: "*" + }; + option (google.api.method_signature) = "new_config,old_config"; + } +} + +// Request message for `ListServices` method. +message ListServicesRequest { + // Include services produced by the specified project. + string producer_project_id = 1; + + // The max number of items to include in the response list. Page size is 50 + // if not specified. Maximum value is 100. + int32 page_size = 5; + + // Token identifying which result to start with; returned by a previous list + // call. + string page_token = 6; + + // Include services consumed by the specified consumer. + // + // The Google Service Management implementation accepts the following + // forms: + // - project: + string consumer_id = 7 [deprecated = true]; +} + +// Response message for `ListServices` method. +message ListServicesResponse { + // The returned services will only have the name field set. + repeated ManagedService services = 1; + + // Token that can be passed to `ListServices` to resume a paginated query. + string next_page_token = 2; +} + +// Request message for `GetService` method. +message GetServiceRequest { + // Required. The name of the service. See the `ServiceManager` overview for + // naming requirements. For example: `example.googleapis.com`. + string service_name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for CreateService method. +message CreateServiceRequest { + // Required. Initial values for the service resource. + ManagedService service = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteService method. +message DeleteServiceRequest { + // Required. The name of the service. See the + // [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + // example: `example.googleapis.com`. + string service_name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UndeleteService method. +message UndeleteServiceRequest { + // Required. The name of the service. See the + // [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + // example: `example.googleapis.com`. + string service_name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for UndeleteService method. +message UndeleteServiceResponse { + // Revived service resource. + ManagedService service = 1; +} + +// Request message for GetServiceConfig method. +message GetServiceConfigRequest { + enum ConfigView { + // Server response includes all fields except SourceInfo. + BASIC = 0; + + // Server response includes all fields including SourceInfo. + // SourceFiles are of type 'google.api.servicemanagement.v1.ConfigFile' + // and are only available for configs created using the + // SubmitConfigSource method. + FULL = 1; + } + + // Required. The name of the service. See the + // [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + // example: `example.googleapis.com`. + string service_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The id of the service configuration resource. + // + // This field must be specified for the server to return all fields, including + // `SourceInfo`. + string config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Specifies which parts of the Service Config should be returned in the + // response. + ConfigView view = 3; +} + +// Request message for ListServiceConfigs method. +message ListServiceConfigsRequest { + // Required. The name of the service. See the + // [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + // example: `example.googleapis.com`. + string service_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The token of the page to retrieve. + string page_token = 2; + + // The max number of items to include in the response list. Page size is 50 + // if not specified. Maximum value is 100. + int32 page_size = 3; +} + +// Response message for ListServiceConfigs method. +message ListServiceConfigsResponse { + // The list of service configuration resources. + repeated google.api.Service service_configs = 1; + + // The token of the next page of results. + string next_page_token = 2; +} + +// Request message for CreateServiceConfig method. +message CreateServiceConfigRequest { + // Required. The name of the service. See the + // [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + // example: `example.googleapis.com`. + string service_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The service configuration resource. + google.api.Service service_config = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for SubmitConfigSource method. +message SubmitConfigSourceRequest { + // Required. The name of the service. See the + // [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + // example: `example.googleapis.com`. + string service_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The source configuration for the service. + ConfigSource config_source = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, this will result in the generation of a + // `google.api.Service` configuration based on the `ConfigSource` provided, + // but the generated config and the sources will NOT be persisted. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for SubmitConfigSource method. +message SubmitConfigSourceResponse { + // The generated service configuration. + google.api.Service service_config = 1; +} + +// Request message for 'CreateServiceRollout' +message CreateServiceRolloutRequest { + // Required. The name of the service. See the + // [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + // example: `example.googleapis.com`. + string service_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The rollout resource. The `service_name` field is output only. + Rollout rollout = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for 'ListServiceRollouts' +message ListServiceRolloutsRequest { + // Required. The name of the service. See the + // [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + // example: `example.googleapis.com`. + string service_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The token of the page to retrieve. + string page_token = 2; + + // The max number of items to include in the response list. Page size is 50 + // if not specified. Maximum value is 100. + int32 page_size = 3; + + // Required. Use `filter` to return subset of rollouts. + // The following filters are supported: + // -- To limit the results to only those in + // status (google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', + // use filter='status=SUCCESS' + // -- To limit the results to those in + // status (google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' + // or 'FAILED', use filter='status=CANCELLED OR status=FAILED' + string filter = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for ListServiceRollouts method. +message ListServiceRolloutsResponse { + // The list of rollout resources. + repeated Rollout rollouts = 1; + + // The token of the next page of results. + string next_page_token = 2; +} + +// Request message for GetServiceRollout method. +message GetServiceRolloutRequest { + // Required. The name of the service. See the + // [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + // example: `example.googleapis.com`. + string service_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The id of the rollout resource. + string rollout_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GenerateConfigReport method. +message GenerateConfigReportRequest { + // Required. Service configuration for which we want to generate the report. + // For this version of API, the supported types are + // [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef], + // [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource], + // and [google.api.Service][google.api.Service] + google.protobuf.Any new_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Service configuration against which the comparison will be done. + // For this version of API, the supported types are + // [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef], + // [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource], + // and [google.api.Service][google.api.Service] + google.protobuf.Any old_config = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for GenerateConfigReport method. +message GenerateConfigReportResponse { + // Name of the service this report belongs to. + string service_name = 1; + + // ID of the service configuration this report belongs to. + string id = 2; + + // list of ChangeReport, each corresponding to comparison between two + // service configurations. + repeated ChangeReport change_reports = 3; + + // Errors / Linter warnings associated with the service definition this + // report + // belongs to. + repeated Diagnostic diagnostics = 4; +} diff --git a/packages/google-api-servicemanagement/protos/protos.d.ts b/packages/google-api-servicemanagement/protos/protos.d.ts new file mode 100644 index 00000000000..4eb92441444 --- /dev/null +++ b/packages/google-api-servicemanagement/protos/protos.d.ts @@ -0,0 +1,15764 @@ +// 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 api. */ + namespace api { + + /** Namespace servicemanagement. */ + namespace servicemanagement { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a ManagedService. */ + interface IManagedService { + + /** ManagedService serviceName */ + serviceName?: (string|null); + + /** ManagedService producerProjectId */ + producerProjectId?: (string|null); + } + + /** Represents a ManagedService. */ + class ManagedService implements IManagedService { + + /** + * Constructs a new ManagedService. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IManagedService); + + /** ManagedService serviceName. */ + public serviceName: string; + + /** ManagedService producerProjectId. */ + public producerProjectId: string; + + /** + * Creates a new ManagedService instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagedService instance + */ + public static create(properties?: google.api.servicemanagement.v1.IManagedService): google.api.servicemanagement.v1.ManagedService; + + /** + * Encodes the specified ManagedService message. Does not implicitly {@link google.api.servicemanagement.v1.ManagedService.verify|verify} messages. + * @param message ManagedService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IManagedService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagedService message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ManagedService.verify|verify} messages. + * @param message ManagedService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IManagedService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagedService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagedService + * @throws {Error} If the payload is not 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.servicemanagement.v1.ManagedService; + + /** + * Decodes a ManagedService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagedService + * @throws {Error} If the payload 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.servicemanagement.v1.ManagedService; + + /** + * Verifies a ManagedService message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagedService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagedService + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.ManagedService; + + /** + * Creates a plain object from a ManagedService message. Also converts values to other types if specified. + * @param message ManagedService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.ManagedService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagedService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagedService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata resourceNames */ + resourceNames?: (string[]|null); + + /** OperationMetadata steps */ + steps?: (google.api.servicemanagement.v1.OperationMetadata.IStep[]|null); + + /** OperationMetadata progressPercentage */ + progressPercentage?: (number|null); + + /** OperationMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IOperationMetadata); + + /** OperationMetadata resourceNames. */ + public resourceNames: string[]; + + /** OperationMetadata steps. */ + public steps: google.api.servicemanagement.v1.OperationMetadata.IStep[]; + + /** OperationMetadata progressPercentage. */ + public progressPercentage: number; + + /** OperationMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.api.servicemanagement.v1.IOperationMetadata): google.api.servicemanagement.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.api.servicemanagement.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.servicemanagement.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.servicemanagement.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OperationMetadata { + + /** Properties of a Step. */ + interface IStep { + + /** Step description */ + description?: (string|null); + + /** Step status */ + status?: (google.api.servicemanagement.v1.OperationMetadata.Status|keyof typeof google.api.servicemanagement.v1.OperationMetadata.Status|null); + } + + /** Represents a Step. */ + class Step implements IStep { + + /** + * Constructs a new Step. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.OperationMetadata.IStep); + + /** Step description. */ + public description: string; + + /** Step status. */ + public status: (google.api.servicemanagement.v1.OperationMetadata.Status|keyof typeof google.api.servicemanagement.v1.OperationMetadata.Status); + + /** + * Creates a new Step instance using the specified properties. + * @param [properties] Properties to set + * @returns Step instance + */ + public static create(properties?: google.api.servicemanagement.v1.OperationMetadata.IStep): google.api.servicemanagement.v1.OperationMetadata.Step; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.api.servicemanagement.v1.OperationMetadata.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.OperationMetadata.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.OperationMetadata.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.OperationMetadata.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Step message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Step + * @throws {Error} If the payload is not 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.servicemanagement.v1.OperationMetadata.Step; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Step + * @throws {Error} If the payload 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.servicemanagement.v1.OperationMetadata.Step; + + /** + * Verifies a Step message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Step message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Step + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.OperationMetadata.Step; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @param message Step + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.OperationMetadata.Step, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Step to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Step + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Status enum. */ + enum Status { + STATUS_UNSPECIFIED = 0, + DONE = 1, + NOT_STARTED = 2, + IN_PROGRESS = 3, + FAILED = 4, + CANCELLED = 5 + } + } + + /** Properties of a Diagnostic. */ + interface IDiagnostic { + + /** Diagnostic location */ + location?: (string|null); + + /** Diagnostic kind */ + kind?: (google.api.servicemanagement.v1.Diagnostic.Kind|keyof typeof google.api.servicemanagement.v1.Diagnostic.Kind|null); + + /** Diagnostic message */ + message?: (string|null); + } + + /** Represents a Diagnostic. */ + class Diagnostic implements IDiagnostic { + + /** + * Constructs a new Diagnostic. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IDiagnostic); + + /** Diagnostic location. */ + public location: string; + + /** Diagnostic kind. */ + public kind: (google.api.servicemanagement.v1.Diagnostic.Kind|keyof typeof google.api.servicemanagement.v1.Diagnostic.Kind); + + /** Diagnostic message. */ + public message: string; + + /** + * Creates a new Diagnostic instance using the specified properties. + * @param [properties] Properties to set + * @returns Diagnostic instance + */ + public static create(properties?: google.api.servicemanagement.v1.IDiagnostic): google.api.servicemanagement.v1.Diagnostic; + + /** + * Encodes the specified Diagnostic message. Does not implicitly {@link google.api.servicemanagement.v1.Diagnostic.verify|verify} messages. + * @param message Diagnostic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IDiagnostic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Diagnostic message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.Diagnostic.verify|verify} messages. + * @param message Diagnostic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IDiagnostic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Diagnostic message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Diagnostic + * @throws {Error} If the payload is not 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.servicemanagement.v1.Diagnostic; + + /** + * Decodes a Diagnostic message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Diagnostic + * @throws {Error} If the payload 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.servicemanagement.v1.Diagnostic; + + /** + * Verifies a Diagnostic message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Diagnostic message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Diagnostic + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.Diagnostic; + + /** + * Creates a plain object from a Diagnostic message. Also converts values to other types if specified. + * @param message Diagnostic + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.Diagnostic, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Diagnostic to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Diagnostic + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Diagnostic { + + /** Kind enum. */ + enum Kind { + WARNING = 0, + ERROR = 1 + } + } + + /** Properties of a ConfigSource. */ + interface IConfigSource { + + /** ConfigSource id */ + id?: (string|null); + + /** ConfigSource files */ + files?: (google.api.servicemanagement.v1.IConfigFile[]|null); + } + + /** Represents a ConfigSource. */ + class ConfigSource implements IConfigSource { + + /** + * Constructs a new ConfigSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IConfigSource); + + /** ConfigSource id. */ + public id: string; + + /** ConfigSource files. */ + public files: google.api.servicemanagement.v1.IConfigFile[]; + + /** + * Creates a new ConfigSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfigSource instance + */ + public static create(properties?: google.api.servicemanagement.v1.IConfigSource): google.api.servicemanagement.v1.ConfigSource; + + /** + * Encodes the specified ConfigSource message. Does not implicitly {@link google.api.servicemanagement.v1.ConfigSource.verify|verify} messages. + * @param message ConfigSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IConfigSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfigSource message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ConfigSource.verify|verify} messages. + * @param message ConfigSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IConfigSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfigSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfigSource + * @throws {Error} If the payload is not 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.servicemanagement.v1.ConfigSource; + + /** + * Decodes a ConfigSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfigSource + * @throws {Error} If the payload 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.servicemanagement.v1.ConfigSource; + + /** + * Verifies a ConfigSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfigSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfigSource + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.ConfigSource; + + /** + * Creates a plain object from a ConfigSource message. Also converts values to other types if specified. + * @param message ConfigSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.ConfigSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfigSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfigSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfigFile. */ + interface IConfigFile { + + /** ConfigFile filePath */ + filePath?: (string|null); + + /** ConfigFile fileContents */ + fileContents?: (Uint8Array|string|null); + + /** ConfigFile fileType */ + fileType?: (google.api.servicemanagement.v1.ConfigFile.FileType|keyof typeof google.api.servicemanagement.v1.ConfigFile.FileType|null); + } + + /** Represents a ConfigFile. */ + class ConfigFile implements IConfigFile { + + /** + * Constructs a new ConfigFile. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IConfigFile); + + /** ConfigFile filePath. */ + public filePath: string; + + /** ConfigFile fileContents. */ + public fileContents: (Uint8Array|string); + + /** ConfigFile fileType. */ + public fileType: (google.api.servicemanagement.v1.ConfigFile.FileType|keyof typeof google.api.servicemanagement.v1.ConfigFile.FileType); + + /** + * Creates a new ConfigFile instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfigFile instance + */ + public static create(properties?: google.api.servicemanagement.v1.IConfigFile): google.api.servicemanagement.v1.ConfigFile; + + /** + * Encodes the specified ConfigFile message. Does not implicitly {@link google.api.servicemanagement.v1.ConfigFile.verify|verify} messages. + * @param message ConfigFile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IConfigFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfigFile message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ConfigFile.verify|verify} messages. + * @param message ConfigFile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IConfigFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfigFile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfigFile + * @throws {Error} If the payload is not 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.servicemanagement.v1.ConfigFile; + + /** + * Decodes a ConfigFile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfigFile + * @throws {Error} If the payload 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.servicemanagement.v1.ConfigFile; + + /** + * Verifies a ConfigFile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfigFile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfigFile + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.ConfigFile; + + /** + * Creates a plain object from a ConfigFile message. Also converts values to other types if specified. + * @param message ConfigFile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.ConfigFile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfigFile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfigFile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConfigFile { + + /** FileType enum. */ + enum FileType { + FILE_TYPE_UNSPECIFIED = 0, + SERVICE_CONFIG_YAML = 1, + OPEN_API_JSON = 2, + OPEN_API_YAML = 3, + FILE_DESCRIPTOR_SET_PROTO = 4, + PROTO_FILE = 6 + } + } + + /** Properties of a ConfigRef. */ + interface IConfigRef { + + /** ConfigRef name */ + name?: (string|null); + } + + /** Represents a ConfigRef. */ + class ConfigRef implements IConfigRef { + + /** + * Constructs a new ConfigRef. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IConfigRef); + + /** ConfigRef name. */ + public name: string; + + /** + * Creates a new ConfigRef instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfigRef instance + */ + public static create(properties?: google.api.servicemanagement.v1.IConfigRef): google.api.servicemanagement.v1.ConfigRef; + + /** + * Encodes the specified ConfigRef message. Does not implicitly {@link google.api.servicemanagement.v1.ConfigRef.verify|verify} messages. + * @param message ConfigRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IConfigRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfigRef message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ConfigRef.verify|verify} messages. + * @param message ConfigRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IConfigRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfigRef message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfigRef + * @throws {Error} If the payload is not 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.servicemanagement.v1.ConfigRef; + + /** + * Decodes a ConfigRef message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfigRef + * @throws {Error} If the payload 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.servicemanagement.v1.ConfigRef; + + /** + * Verifies a ConfigRef message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfigRef message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfigRef + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.ConfigRef; + + /** + * Creates a plain object from a ConfigRef message. Also converts values to other types if specified. + * @param message ConfigRef + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.ConfigRef, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfigRef to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfigRef + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChangeReport. */ + interface IChangeReport { + + /** ChangeReport configChanges */ + configChanges?: (google.api.IConfigChange[]|null); + } + + /** Represents a ChangeReport. */ + class ChangeReport implements IChangeReport { + + /** + * Constructs a new ChangeReport. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IChangeReport); + + /** ChangeReport configChanges. */ + public configChanges: google.api.IConfigChange[]; + + /** + * Creates a new ChangeReport instance using the specified properties. + * @param [properties] Properties to set + * @returns ChangeReport instance + */ + public static create(properties?: google.api.servicemanagement.v1.IChangeReport): google.api.servicemanagement.v1.ChangeReport; + + /** + * Encodes the specified ChangeReport message. Does not implicitly {@link google.api.servicemanagement.v1.ChangeReport.verify|verify} messages. + * @param message ChangeReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IChangeReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChangeReport message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ChangeReport.verify|verify} messages. + * @param message ChangeReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IChangeReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChangeReport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChangeReport + * @throws {Error} If the payload is not 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.servicemanagement.v1.ChangeReport; + + /** + * Decodes a ChangeReport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChangeReport + * @throws {Error} If the payload 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.servicemanagement.v1.ChangeReport; + + /** + * Verifies a ChangeReport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChangeReport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChangeReport + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.ChangeReport; + + /** + * Creates a plain object from a ChangeReport message. Also converts values to other types if specified. + * @param message ChangeReport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.ChangeReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChangeReport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChangeReport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Rollout. */ + interface IRollout { + + /** Rollout rolloutId */ + rolloutId?: (string|null); + + /** Rollout createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Rollout createdBy */ + createdBy?: (string|null); + + /** Rollout status */ + status?: (google.api.servicemanagement.v1.Rollout.RolloutStatus|keyof typeof google.api.servicemanagement.v1.Rollout.RolloutStatus|null); + + /** Rollout trafficPercentStrategy */ + trafficPercentStrategy?: (google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy|null); + + /** Rollout deleteServiceStrategy */ + deleteServiceStrategy?: (google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy|null); + + /** Rollout serviceName */ + serviceName?: (string|null); + } + + /** Represents a Rollout. */ + class Rollout implements IRollout { + + /** + * Constructs a new Rollout. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IRollout); + + /** Rollout rolloutId. */ + public rolloutId: string; + + /** Rollout createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Rollout createdBy. */ + public createdBy: string; + + /** Rollout status. */ + public status: (google.api.servicemanagement.v1.Rollout.RolloutStatus|keyof typeof google.api.servicemanagement.v1.Rollout.RolloutStatus); + + /** Rollout trafficPercentStrategy. */ + public trafficPercentStrategy?: (google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy|null); + + /** Rollout deleteServiceStrategy. */ + public deleteServiceStrategy?: (google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy|null); + + /** Rollout serviceName. */ + public serviceName: string; + + /** Rollout strategy. */ + public strategy?: ("trafficPercentStrategy"|"deleteServiceStrategy"); + + /** + * Creates a new Rollout instance using the specified properties. + * @param [properties] Properties to set + * @returns Rollout instance + */ + public static create(properties?: google.api.servicemanagement.v1.IRollout): google.api.servicemanagement.v1.Rollout; + + /** + * Encodes the specified Rollout message. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.verify|verify} messages. + * @param message Rollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rollout message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.verify|verify} messages. + * @param message Rollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rollout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.servicemanagement.v1.Rollout; + + /** + * Decodes a Rollout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.servicemanagement.v1.Rollout; + + /** + * Verifies a Rollout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Rollout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rollout + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.Rollout; + + /** + * Creates a plain object from a Rollout message. Also converts values to other types if specified. + * @param message Rollout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.Rollout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rollout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Rollout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Rollout { + + /** Properties of a TrafficPercentStrategy. */ + interface ITrafficPercentStrategy { + + /** TrafficPercentStrategy percentages */ + percentages?: ({ [k: string]: number }|null); + } + + /** Represents a TrafficPercentStrategy. */ + class TrafficPercentStrategy implements ITrafficPercentStrategy { + + /** + * Constructs a new TrafficPercentStrategy. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy); + + /** TrafficPercentStrategy percentages. */ + public percentages: { [k: string]: number }; + + /** + * Creates a new TrafficPercentStrategy instance using the specified properties. + * @param [properties] Properties to set + * @returns TrafficPercentStrategy instance + */ + public static create(properties?: google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy): google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy; + + /** + * Encodes the specified TrafficPercentStrategy message. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.verify|verify} messages. + * @param message TrafficPercentStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrafficPercentStrategy message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.verify|verify} messages. + * @param message TrafficPercentStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrafficPercentStrategy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrafficPercentStrategy + * @throws {Error} If the payload is not 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.servicemanagement.v1.Rollout.TrafficPercentStrategy; + + /** + * Decodes a TrafficPercentStrategy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrafficPercentStrategy + * @throws {Error} If the payload 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.servicemanagement.v1.Rollout.TrafficPercentStrategy; + + /** + * Verifies a TrafficPercentStrategy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrafficPercentStrategy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrafficPercentStrategy + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy; + + /** + * Creates a plain object from a TrafficPercentStrategy message. Also converts values to other types if specified. + * @param message TrafficPercentStrategy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrafficPercentStrategy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrafficPercentStrategy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteServiceStrategy. */ + interface IDeleteServiceStrategy { + } + + /** Represents a DeleteServiceStrategy. */ + class DeleteServiceStrategy implements IDeleteServiceStrategy { + + /** + * Constructs a new DeleteServiceStrategy. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy); + + /** + * Creates a new DeleteServiceStrategy instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteServiceStrategy instance + */ + public static create(properties?: google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy): google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy; + + /** + * Encodes the specified DeleteServiceStrategy message. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy.verify|verify} messages. + * @param message DeleteServiceStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteServiceStrategy message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy.verify|verify} messages. + * @param message DeleteServiceStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteServiceStrategy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteServiceStrategy + * @throws {Error} If the payload is not 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.servicemanagement.v1.Rollout.DeleteServiceStrategy; + + /** + * Decodes a DeleteServiceStrategy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteServiceStrategy + * @throws {Error} If the payload 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.servicemanagement.v1.Rollout.DeleteServiceStrategy; + + /** + * Verifies a DeleteServiceStrategy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteServiceStrategy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteServiceStrategy + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy; + + /** + * Creates a plain object from a DeleteServiceStrategy message. Also converts values to other types if specified. + * @param message DeleteServiceStrategy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteServiceStrategy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteServiceStrategy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RolloutStatus enum. */ + enum RolloutStatus { + ROLLOUT_STATUS_UNSPECIFIED = 0, + IN_PROGRESS = 1, + SUCCESS = 2, + CANCELLED = 3, + FAILED = 4, + PENDING = 5, + FAILED_ROLLED_BACK = 6 + } + } + + /** Represents a ServiceManager */ + class ServiceManager extends $protobuf.rpc.Service { + + /** + * Constructs a new ServiceManager 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 ServiceManager 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): ServiceManager; + + /** + * 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.api.servicemanagement.v1.IListServicesRequest, callback: google.api.servicemanagement.v1.ServiceManager.ListServicesCallback): void; + + /** + * Calls ListServices. + * @param request ListServicesRequest message or plain object + * @returns Promise + */ + public listServices(request: google.api.servicemanagement.v1.IListServicesRequest): Promise; + + /** + * Calls GetService. + * @param request GetServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ManagedService + */ + public getService(request: google.api.servicemanagement.v1.IGetServiceRequest, callback: google.api.servicemanagement.v1.ServiceManager.GetServiceCallback): void; + + /** + * Calls GetService. + * @param request GetServiceRequest message or plain object + * @returns Promise + */ + public getService(request: google.api.servicemanagement.v1.IGetServiceRequest): Promise; + + /** + * Calls CreateService. + * @param request CreateServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createService(request: google.api.servicemanagement.v1.ICreateServiceRequest, callback: google.api.servicemanagement.v1.ServiceManager.CreateServiceCallback): void; + + /** + * Calls CreateService. + * @param request CreateServiceRequest message or plain object + * @returns Promise + */ + public createService(request: google.api.servicemanagement.v1.ICreateServiceRequest): 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.api.servicemanagement.v1.IDeleteServiceRequest, callback: google.api.servicemanagement.v1.ServiceManager.DeleteServiceCallback): void; + + /** + * Calls DeleteService. + * @param request DeleteServiceRequest message or plain object + * @returns Promise + */ + public deleteService(request: google.api.servicemanagement.v1.IDeleteServiceRequest): Promise; + + /** + * Calls UndeleteService. + * @param request UndeleteServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeleteService(request: google.api.servicemanagement.v1.IUndeleteServiceRequest, callback: google.api.servicemanagement.v1.ServiceManager.UndeleteServiceCallback): void; + + /** + * Calls UndeleteService. + * @param request UndeleteServiceRequest message or plain object + * @returns Promise + */ + public undeleteService(request: google.api.servicemanagement.v1.IUndeleteServiceRequest): Promise; + + /** + * Calls ListServiceConfigs. + * @param request ListServiceConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListServiceConfigsResponse + */ + public listServiceConfigs(request: google.api.servicemanagement.v1.IListServiceConfigsRequest, callback: google.api.servicemanagement.v1.ServiceManager.ListServiceConfigsCallback): void; + + /** + * Calls ListServiceConfigs. + * @param request ListServiceConfigsRequest message or plain object + * @returns Promise + */ + public listServiceConfigs(request: google.api.servicemanagement.v1.IListServiceConfigsRequest): Promise; + + /** + * Calls GetServiceConfig. + * @param request GetServiceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Service + */ + public getServiceConfig(request: google.api.servicemanagement.v1.IGetServiceConfigRequest, callback: google.api.servicemanagement.v1.ServiceManager.GetServiceConfigCallback): void; + + /** + * Calls GetServiceConfig. + * @param request GetServiceConfigRequest message or plain object + * @returns Promise + */ + public getServiceConfig(request: google.api.servicemanagement.v1.IGetServiceConfigRequest): Promise; + + /** + * Calls CreateServiceConfig. + * @param request CreateServiceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Service + */ + public createServiceConfig(request: google.api.servicemanagement.v1.ICreateServiceConfigRequest, callback: google.api.servicemanagement.v1.ServiceManager.CreateServiceConfigCallback): void; + + /** + * Calls CreateServiceConfig. + * @param request CreateServiceConfigRequest message or plain object + * @returns Promise + */ + public createServiceConfig(request: google.api.servicemanagement.v1.ICreateServiceConfigRequest): Promise; + + /** + * Calls SubmitConfigSource. + * @param request SubmitConfigSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public submitConfigSource(request: google.api.servicemanagement.v1.ISubmitConfigSourceRequest, callback: google.api.servicemanagement.v1.ServiceManager.SubmitConfigSourceCallback): void; + + /** + * Calls SubmitConfigSource. + * @param request SubmitConfigSourceRequest message or plain object + * @returns Promise + */ + public submitConfigSource(request: google.api.servicemanagement.v1.ISubmitConfigSourceRequest): Promise; + + /** + * Calls ListServiceRollouts. + * @param request ListServiceRolloutsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListServiceRolloutsResponse + */ + public listServiceRollouts(request: google.api.servicemanagement.v1.IListServiceRolloutsRequest, callback: google.api.servicemanagement.v1.ServiceManager.ListServiceRolloutsCallback): void; + + /** + * Calls ListServiceRollouts. + * @param request ListServiceRolloutsRequest message or plain object + * @returns Promise + */ + public listServiceRollouts(request: google.api.servicemanagement.v1.IListServiceRolloutsRequest): Promise; + + /** + * Calls GetServiceRollout. + * @param request GetServiceRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Rollout + */ + public getServiceRollout(request: google.api.servicemanagement.v1.IGetServiceRolloutRequest, callback: google.api.servicemanagement.v1.ServiceManager.GetServiceRolloutCallback): void; + + /** + * Calls GetServiceRollout. + * @param request GetServiceRolloutRequest message or plain object + * @returns Promise + */ + public getServiceRollout(request: google.api.servicemanagement.v1.IGetServiceRolloutRequest): Promise; + + /** + * Calls CreateServiceRollout. + * @param request CreateServiceRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createServiceRollout(request: google.api.servicemanagement.v1.ICreateServiceRolloutRequest, callback: google.api.servicemanagement.v1.ServiceManager.CreateServiceRolloutCallback): void; + + /** + * Calls CreateServiceRollout. + * @param request CreateServiceRolloutRequest message or plain object + * @returns Promise + */ + public createServiceRollout(request: google.api.servicemanagement.v1.ICreateServiceRolloutRequest): Promise; + + /** + * Calls GenerateConfigReport. + * @param request GenerateConfigReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateConfigReportResponse + */ + public generateConfigReport(request: google.api.servicemanagement.v1.IGenerateConfigReportRequest, callback: google.api.servicemanagement.v1.ServiceManager.GenerateConfigReportCallback): void; + + /** + * Calls GenerateConfigReport. + * @param request GenerateConfigReportRequest message or plain object + * @returns Promise + */ + public generateConfigReport(request: google.api.servicemanagement.v1.IGenerateConfigReportRequest): Promise; + } + + namespace ServiceManager { + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|listServices}. + * @param error Error, if any + * @param [response] ListServicesResponse + */ + type ListServicesCallback = (error: (Error|null), response?: google.api.servicemanagement.v1.ListServicesResponse) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|getService}. + * @param error Error, if any + * @param [response] ManagedService + */ + type GetServiceCallback = (error: (Error|null), response?: google.api.servicemanagement.v1.ManagedService) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|createService}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|deleteService}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|undeleteService}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeleteServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|listServiceConfigs}. + * @param error Error, if any + * @param [response] ListServiceConfigsResponse + */ + type ListServiceConfigsCallback = (error: (Error|null), response?: google.api.servicemanagement.v1.ListServiceConfigsResponse) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|getServiceConfig}. + * @param error Error, if any + * @param [response] Service + */ + type GetServiceConfigCallback = (error: (Error|null), response?: google.api.Service) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|createServiceConfig}. + * @param error Error, if any + * @param [response] Service + */ + type CreateServiceConfigCallback = (error: (Error|null), response?: google.api.Service) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|submitConfigSource}. + * @param error Error, if any + * @param [response] Operation + */ + type SubmitConfigSourceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|listServiceRollouts}. + * @param error Error, if any + * @param [response] ListServiceRolloutsResponse + */ + type ListServiceRolloutsCallback = (error: (Error|null), response?: google.api.servicemanagement.v1.ListServiceRolloutsResponse) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|getServiceRollout}. + * @param error Error, if any + * @param [response] Rollout + */ + type GetServiceRolloutCallback = (error: (Error|null), response?: google.api.servicemanagement.v1.Rollout) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|createServiceRollout}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateServiceRolloutCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|generateConfigReport}. + * @param error Error, if any + * @param [response] GenerateConfigReportResponse + */ + type GenerateConfigReportCallback = (error: (Error|null), response?: google.api.servicemanagement.v1.GenerateConfigReportResponse) => void; + } + + /** Properties of a ListServicesRequest. */ + interface IListServicesRequest { + + /** ListServicesRequest producerProjectId */ + producerProjectId?: (string|null); + + /** ListServicesRequest pageSize */ + pageSize?: (number|null); + + /** ListServicesRequest pageToken */ + pageToken?: (string|null); + + /** ListServicesRequest consumerId */ + consumerId?: (string|null); + } + + /** Represents a ListServicesRequest. */ + class ListServicesRequest implements IListServicesRequest { + + /** + * Constructs a new ListServicesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IListServicesRequest); + + /** ListServicesRequest producerProjectId. */ + public producerProjectId: string; + + /** ListServicesRequest pageSize. */ + public pageSize: number; + + /** ListServicesRequest pageToken. */ + public pageToken: string; + + /** ListServicesRequest consumerId. */ + public consumerId: string; + + /** + * Creates a new ListServicesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServicesRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.IListServicesRequest): google.api.servicemanagement.v1.ListServicesRequest; + + /** + * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.api.servicemanagement.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.api.servicemanagement.v1.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.v1.IManagedService[]|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.api.servicemanagement.v1.IListServicesResponse); + + /** ListServicesResponse services. */ + public services: google.api.servicemanagement.v1.IManagedService[]; + + /** 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.api.servicemanagement.v1.IListServicesResponse): google.api.servicemanagement.v1.ListServicesResponse; + + /** + * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.api.servicemanagement.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.api.servicemanagement.v1.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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 serviceName */ + serviceName?: (string|null); + } + + /** Represents a GetServiceRequest. */ + class GetServiceRequest implements IGetServiceRequest { + + /** + * Constructs a new GetServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IGetServiceRequest); + + /** GetServiceRequest serviceName. */ + public serviceName: string; + + /** + * Creates a new GetServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServiceRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.IGetServiceRequest): google.api.servicemanagement.v1.GetServiceRequest; + + /** + * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.api.servicemanagement.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.api.servicemanagement.v1.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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 a CreateServiceRequest. */ + interface ICreateServiceRequest { + + /** CreateServiceRequest service */ + service?: (google.api.servicemanagement.v1.IManagedService|null); + } + + /** Represents a CreateServiceRequest. */ + class CreateServiceRequest implements ICreateServiceRequest { + + /** + * Constructs a new CreateServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.ICreateServiceRequest); + + /** CreateServiceRequest service. */ + public service?: (google.api.servicemanagement.v1.IManagedService|null); + + /** + * Creates a new CreateServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateServiceRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.ICreateServiceRequest): google.api.servicemanagement.v1.CreateServiceRequest; + + /** + * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceRequest.verify|verify} messages. + * @param message CreateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceRequest.verify|verify} messages. + * @param message CreateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateServiceRequest + * @throws {Error} If the payload is not 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.servicemanagement.v1.CreateServiceRequest; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateServiceRequest + * @throws {Error} If the payload 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.servicemanagement.v1.CreateServiceRequest; + + /** + * Verifies a CreateServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.CreateServiceRequest; + + /** + * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. + * @param message CreateServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.CreateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateServiceRequest + * @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 serviceName */ + serviceName?: (string|null); + } + + /** Represents a DeleteServiceRequest. */ + class DeleteServiceRequest implements IDeleteServiceRequest { + + /** + * Constructs a new DeleteServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IDeleteServiceRequest); + + /** DeleteServiceRequest serviceName. */ + public serviceName: string; + + /** + * Creates a new DeleteServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteServiceRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.IDeleteServiceRequest): google.api.servicemanagement.v1.DeleteServiceRequest; + + /** + * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.api.servicemanagement.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.api.servicemanagement.v1.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.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; + } + + /** Properties of an UndeleteServiceRequest. */ + interface IUndeleteServiceRequest { + + /** UndeleteServiceRequest serviceName */ + serviceName?: (string|null); + } + + /** Represents an UndeleteServiceRequest. */ + class UndeleteServiceRequest implements IUndeleteServiceRequest { + + /** + * Constructs a new UndeleteServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IUndeleteServiceRequest); + + /** UndeleteServiceRequest serviceName. */ + public serviceName: string; + + /** + * Creates a new UndeleteServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteServiceRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.IUndeleteServiceRequest): google.api.servicemanagement.v1.UndeleteServiceRequest; + + /** + * Encodes the specified UndeleteServiceRequest message. Does not implicitly {@link google.api.servicemanagement.v1.UndeleteServiceRequest.verify|verify} messages. + * @param message UndeleteServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IUndeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteServiceRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.UndeleteServiceRequest.verify|verify} messages. + * @param message UndeleteServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IUndeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteServiceRequest + * @throws {Error} If the payload is not 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.servicemanagement.v1.UndeleteServiceRequest; + + /** + * Decodes an UndeleteServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteServiceRequest + * @throws {Error} If the payload 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.servicemanagement.v1.UndeleteServiceRequest; + + /** + * Verifies an UndeleteServiceRequest message. + * @param message Plain 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 UndeleteServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.UndeleteServiceRequest; + + /** + * Creates a plain object from an UndeleteServiceRequest message. Also converts values to other types if specified. + * @param message UndeleteServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.UndeleteServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteServiceResponse. */ + interface IUndeleteServiceResponse { + + /** UndeleteServiceResponse service */ + service?: (google.api.servicemanagement.v1.IManagedService|null); + } + + /** Represents an UndeleteServiceResponse. */ + class UndeleteServiceResponse implements IUndeleteServiceResponse { + + /** + * Constructs a new UndeleteServiceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IUndeleteServiceResponse); + + /** UndeleteServiceResponse service. */ + public service?: (google.api.servicemanagement.v1.IManagedService|null); + + /** + * Creates a new UndeleteServiceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteServiceResponse instance + */ + public static create(properties?: google.api.servicemanagement.v1.IUndeleteServiceResponse): google.api.servicemanagement.v1.UndeleteServiceResponse; + + /** + * Encodes the specified UndeleteServiceResponse message. Does not implicitly {@link google.api.servicemanagement.v1.UndeleteServiceResponse.verify|verify} messages. + * @param message UndeleteServiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IUndeleteServiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteServiceResponse message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.UndeleteServiceResponse.verify|verify} messages. + * @param message UndeleteServiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IUndeleteServiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteServiceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteServiceResponse + * @throws {Error} If the payload is not 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.servicemanagement.v1.UndeleteServiceResponse; + + /** + * Decodes an UndeleteServiceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteServiceResponse + * @throws {Error} If the payload 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.servicemanagement.v1.UndeleteServiceResponse; + + /** + * Verifies an UndeleteServiceResponse message. + * @param message Plain 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 UndeleteServiceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteServiceResponse + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.UndeleteServiceResponse; + + /** + * Creates a plain object from an UndeleteServiceResponse message. Also converts values to other types if specified. + * @param message UndeleteServiceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.UndeleteServiceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteServiceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteServiceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetServiceConfigRequest. */ + interface IGetServiceConfigRequest { + + /** GetServiceConfigRequest serviceName */ + serviceName?: (string|null); + + /** GetServiceConfigRequest configId */ + configId?: (string|null); + + /** GetServiceConfigRequest view */ + view?: (google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView|keyof typeof google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView|null); + } + + /** Represents a GetServiceConfigRequest. */ + class GetServiceConfigRequest implements IGetServiceConfigRequest { + + /** + * Constructs a new GetServiceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IGetServiceConfigRequest); + + /** GetServiceConfigRequest serviceName. */ + public serviceName: string; + + /** GetServiceConfigRequest configId. */ + public configId: string; + + /** GetServiceConfigRequest view. */ + public view: (google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView|keyof typeof google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView); + + /** + * Creates a new GetServiceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServiceConfigRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.IGetServiceConfigRequest): google.api.servicemanagement.v1.GetServiceConfigRequest; + + /** + * Encodes the specified GetServiceConfigRequest message. Does not implicitly {@link google.api.servicemanagement.v1.GetServiceConfigRequest.verify|verify} messages. + * @param message GetServiceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IGetServiceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetServiceConfigRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.GetServiceConfigRequest.verify|verify} messages. + * @param message GetServiceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IGetServiceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetServiceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetServiceConfigRequest + * @throws {Error} If the payload is not 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.servicemanagement.v1.GetServiceConfigRequest; + + /** + * Decodes a GetServiceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetServiceConfigRequest + * @throws {Error} If the payload 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.servicemanagement.v1.GetServiceConfigRequest; + + /** + * Verifies a GetServiceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetServiceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetServiceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.GetServiceConfigRequest; + + /** + * Creates a plain object from a GetServiceConfigRequest message. Also converts values to other types if specified. + * @param message GetServiceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.GetServiceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetServiceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetServiceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GetServiceConfigRequest { + + /** ConfigView enum. */ + enum ConfigView { + BASIC = 0, + FULL = 1 + } + } + + /** Properties of a ListServiceConfigsRequest. */ + interface IListServiceConfigsRequest { + + /** ListServiceConfigsRequest serviceName */ + serviceName?: (string|null); + + /** ListServiceConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListServiceConfigsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListServiceConfigsRequest. */ + class ListServiceConfigsRequest implements IListServiceConfigsRequest { + + /** + * Constructs a new ListServiceConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IListServiceConfigsRequest); + + /** ListServiceConfigsRequest serviceName. */ + public serviceName: string; + + /** ListServiceConfigsRequest pageToken. */ + public pageToken: string; + + /** ListServiceConfigsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListServiceConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServiceConfigsRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.IListServiceConfigsRequest): google.api.servicemanagement.v1.ListServiceConfigsRequest; + + /** + * Encodes the specified ListServiceConfigsRequest message. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceConfigsRequest.verify|verify} messages. + * @param message ListServiceConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IListServiceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServiceConfigsRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceConfigsRequest.verify|verify} messages. + * @param message ListServiceConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IListServiceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServiceConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServiceConfigsRequest + * @throws {Error} If the payload is not 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.servicemanagement.v1.ListServiceConfigsRequest; + + /** + * Decodes a ListServiceConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServiceConfigsRequest + * @throws {Error} If the payload 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.servicemanagement.v1.ListServiceConfigsRequest; + + /** + * Verifies a ListServiceConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServiceConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServiceConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.ListServiceConfigsRequest; + + /** + * Creates a plain object from a ListServiceConfigsRequest message. Also converts values to other types if specified. + * @param message ListServiceConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.ListServiceConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServiceConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServiceConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListServiceConfigsResponse. */ + interface IListServiceConfigsResponse { + + /** ListServiceConfigsResponse serviceConfigs */ + serviceConfigs?: (google.api.IService[]|null); + + /** ListServiceConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListServiceConfigsResponse. */ + class ListServiceConfigsResponse implements IListServiceConfigsResponse { + + /** + * Constructs a new ListServiceConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IListServiceConfigsResponse); + + /** ListServiceConfigsResponse serviceConfigs. */ + public serviceConfigs: google.api.IService[]; + + /** ListServiceConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListServiceConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServiceConfigsResponse instance + */ + public static create(properties?: google.api.servicemanagement.v1.IListServiceConfigsResponse): google.api.servicemanagement.v1.ListServiceConfigsResponse; + + /** + * Encodes the specified ListServiceConfigsResponse message. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceConfigsResponse.verify|verify} messages. + * @param message ListServiceConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IListServiceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServiceConfigsResponse message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceConfigsResponse.verify|verify} messages. + * @param message ListServiceConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IListServiceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServiceConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServiceConfigsResponse + * @throws {Error} If the payload is not 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.servicemanagement.v1.ListServiceConfigsResponse; + + /** + * Decodes a ListServiceConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServiceConfigsResponse + * @throws {Error} If the payload 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.servicemanagement.v1.ListServiceConfigsResponse; + + /** + * Verifies a ListServiceConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServiceConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServiceConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.ListServiceConfigsResponse; + + /** + * Creates a plain object from a ListServiceConfigsResponse message. Also converts values to other types if specified. + * @param message ListServiceConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.ListServiceConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServiceConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServiceConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateServiceConfigRequest. */ + interface ICreateServiceConfigRequest { + + /** CreateServiceConfigRequest serviceName */ + serviceName?: (string|null); + + /** CreateServiceConfigRequest serviceConfig */ + serviceConfig?: (google.api.IService|null); + } + + /** Represents a CreateServiceConfigRequest. */ + class CreateServiceConfigRequest implements ICreateServiceConfigRequest { + + /** + * Constructs a new CreateServiceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.ICreateServiceConfigRequest); + + /** CreateServiceConfigRequest serviceName. */ + public serviceName: string; + + /** CreateServiceConfigRequest serviceConfig. */ + public serviceConfig?: (google.api.IService|null); + + /** + * Creates a new CreateServiceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateServiceConfigRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.ICreateServiceConfigRequest): google.api.servicemanagement.v1.CreateServiceConfigRequest; + + /** + * Encodes the specified CreateServiceConfigRequest message. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceConfigRequest.verify|verify} messages. + * @param message CreateServiceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.ICreateServiceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateServiceConfigRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceConfigRequest.verify|verify} messages. + * @param message CreateServiceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.ICreateServiceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateServiceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateServiceConfigRequest + * @throws {Error} If the payload is not 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.servicemanagement.v1.CreateServiceConfigRequest; + + /** + * Decodes a CreateServiceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateServiceConfigRequest + * @throws {Error} If the payload 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.servicemanagement.v1.CreateServiceConfigRequest; + + /** + * Verifies a CreateServiceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateServiceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateServiceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.CreateServiceConfigRequest; + + /** + * Creates a plain object from a CreateServiceConfigRequest message. Also converts values to other types if specified. + * @param message CreateServiceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.CreateServiceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateServiceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateServiceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubmitConfigSourceRequest. */ + interface ISubmitConfigSourceRequest { + + /** SubmitConfigSourceRequest serviceName */ + serviceName?: (string|null); + + /** SubmitConfigSourceRequest configSource */ + configSource?: (google.api.servicemanagement.v1.IConfigSource|null); + + /** SubmitConfigSourceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a SubmitConfigSourceRequest. */ + class SubmitConfigSourceRequest implements ISubmitConfigSourceRequest { + + /** + * Constructs a new SubmitConfigSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.ISubmitConfigSourceRequest); + + /** SubmitConfigSourceRequest serviceName. */ + public serviceName: string; + + /** SubmitConfigSourceRequest configSource. */ + public configSource?: (google.api.servicemanagement.v1.IConfigSource|null); + + /** SubmitConfigSourceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new SubmitConfigSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SubmitConfigSourceRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.ISubmitConfigSourceRequest): google.api.servicemanagement.v1.SubmitConfigSourceRequest; + + /** + * Encodes the specified SubmitConfigSourceRequest message. Does not implicitly {@link google.api.servicemanagement.v1.SubmitConfigSourceRequest.verify|verify} messages. + * @param message SubmitConfigSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.ISubmitConfigSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubmitConfigSourceRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.SubmitConfigSourceRequest.verify|verify} messages. + * @param message SubmitConfigSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.ISubmitConfigSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubmitConfigSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubmitConfigSourceRequest + * @throws {Error} If the payload is not 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.servicemanagement.v1.SubmitConfigSourceRequest; + + /** + * Decodes a SubmitConfigSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubmitConfigSourceRequest + * @throws {Error} If the payload 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.servicemanagement.v1.SubmitConfigSourceRequest; + + /** + * Verifies a SubmitConfigSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubmitConfigSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubmitConfigSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.SubmitConfigSourceRequest; + + /** + * Creates a plain object from a SubmitConfigSourceRequest message. Also converts values to other types if specified. + * @param message SubmitConfigSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.SubmitConfigSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubmitConfigSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubmitConfigSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubmitConfigSourceResponse. */ + interface ISubmitConfigSourceResponse { + + /** SubmitConfigSourceResponse serviceConfig */ + serviceConfig?: (google.api.IService|null); + } + + /** Represents a SubmitConfigSourceResponse. */ + class SubmitConfigSourceResponse implements ISubmitConfigSourceResponse { + + /** + * Constructs a new SubmitConfigSourceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.ISubmitConfigSourceResponse); + + /** SubmitConfigSourceResponse serviceConfig. */ + public serviceConfig?: (google.api.IService|null); + + /** + * Creates a new SubmitConfigSourceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SubmitConfigSourceResponse instance + */ + public static create(properties?: google.api.servicemanagement.v1.ISubmitConfigSourceResponse): google.api.servicemanagement.v1.SubmitConfigSourceResponse; + + /** + * Encodes the specified SubmitConfigSourceResponse message. Does not implicitly {@link google.api.servicemanagement.v1.SubmitConfigSourceResponse.verify|verify} messages. + * @param message SubmitConfigSourceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.ISubmitConfigSourceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubmitConfigSourceResponse message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.SubmitConfigSourceResponse.verify|verify} messages. + * @param message SubmitConfigSourceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.ISubmitConfigSourceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubmitConfigSourceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubmitConfigSourceResponse + * @throws {Error} If the payload is not 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.servicemanagement.v1.SubmitConfigSourceResponse; + + /** + * Decodes a SubmitConfigSourceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubmitConfigSourceResponse + * @throws {Error} If the payload 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.servicemanagement.v1.SubmitConfigSourceResponse; + + /** + * Verifies a SubmitConfigSourceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubmitConfigSourceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubmitConfigSourceResponse + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.SubmitConfigSourceResponse; + + /** + * Creates a plain object from a SubmitConfigSourceResponse message. Also converts values to other types if specified. + * @param message SubmitConfigSourceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.SubmitConfigSourceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubmitConfigSourceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubmitConfigSourceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateServiceRolloutRequest. */ + interface ICreateServiceRolloutRequest { + + /** CreateServiceRolloutRequest serviceName */ + serviceName?: (string|null); + + /** CreateServiceRolloutRequest rollout */ + rollout?: (google.api.servicemanagement.v1.IRollout|null); + } + + /** Represents a CreateServiceRolloutRequest. */ + class CreateServiceRolloutRequest implements ICreateServiceRolloutRequest { + + /** + * Constructs a new CreateServiceRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.ICreateServiceRolloutRequest); + + /** CreateServiceRolloutRequest serviceName. */ + public serviceName: string; + + /** CreateServiceRolloutRequest rollout. */ + public rollout?: (google.api.servicemanagement.v1.IRollout|null); + + /** + * Creates a new CreateServiceRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateServiceRolloutRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.ICreateServiceRolloutRequest): google.api.servicemanagement.v1.CreateServiceRolloutRequest; + + /** + * Encodes the specified CreateServiceRolloutRequest message. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceRolloutRequest.verify|verify} messages. + * @param message CreateServiceRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.ICreateServiceRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateServiceRolloutRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceRolloutRequest.verify|verify} messages. + * @param message CreateServiceRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.ICreateServiceRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateServiceRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateServiceRolloutRequest + * @throws {Error} If the payload is not 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.servicemanagement.v1.CreateServiceRolloutRequest; + + /** + * Decodes a CreateServiceRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateServiceRolloutRequest + * @throws {Error} If the payload 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.servicemanagement.v1.CreateServiceRolloutRequest; + + /** + * Verifies a CreateServiceRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateServiceRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateServiceRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.CreateServiceRolloutRequest; + + /** + * Creates a plain object from a CreateServiceRolloutRequest message. Also converts values to other types if specified. + * @param message CreateServiceRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.CreateServiceRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateServiceRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateServiceRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListServiceRolloutsRequest. */ + interface IListServiceRolloutsRequest { + + /** ListServiceRolloutsRequest serviceName */ + serviceName?: (string|null); + + /** ListServiceRolloutsRequest pageToken */ + pageToken?: (string|null); + + /** ListServiceRolloutsRequest pageSize */ + pageSize?: (number|null); + + /** ListServiceRolloutsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListServiceRolloutsRequest. */ + class ListServiceRolloutsRequest implements IListServiceRolloutsRequest { + + /** + * Constructs a new ListServiceRolloutsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IListServiceRolloutsRequest); + + /** ListServiceRolloutsRequest serviceName. */ + public serviceName: string; + + /** ListServiceRolloutsRequest pageToken. */ + public pageToken: string; + + /** ListServiceRolloutsRequest pageSize. */ + public pageSize: number; + + /** ListServiceRolloutsRequest filter. */ + public filter: string; + + /** + * Creates a new ListServiceRolloutsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServiceRolloutsRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.IListServiceRolloutsRequest): google.api.servicemanagement.v1.ListServiceRolloutsRequest; + + /** + * Encodes the specified ListServiceRolloutsRequest message. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceRolloutsRequest.verify|verify} messages. + * @param message ListServiceRolloutsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IListServiceRolloutsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServiceRolloutsRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceRolloutsRequest.verify|verify} messages. + * @param message ListServiceRolloutsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IListServiceRolloutsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServiceRolloutsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServiceRolloutsRequest + * @throws {Error} If the payload is not 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.servicemanagement.v1.ListServiceRolloutsRequest; + + /** + * Decodes a ListServiceRolloutsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServiceRolloutsRequest + * @throws {Error} If the payload 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.servicemanagement.v1.ListServiceRolloutsRequest; + + /** + * Verifies a ListServiceRolloutsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServiceRolloutsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServiceRolloutsRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.ListServiceRolloutsRequest; + + /** + * Creates a plain object from a ListServiceRolloutsRequest message. Also converts values to other types if specified. + * @param message ListServiceRolloutsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.ListServiceRolloutsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServiceRolloutsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServiceRolloutsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListServiceRolloutsResponse. */ + interface IListServiceRolloutsResponse { + + /** ListServiceRolloutsResponse rollouts */ + rollouts?: (google.api.servicemanagement.v1.IRollout[]|null); + + /** ListServiceRolloutsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListServiceRolloutsResponse. */ + class ListServiceRolloutsResponse implements IListServiceRolloutsResponse { + + /** + * Constructs a new ListServiceRolloutsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IListServiceRolloutsResponse); + + /** ListServiceRolloutsResponse rollouts. */ + public rollouts: google.api.servicemanagement.v1.IRollout[]; + + /** ListServiceRolloutsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListServiceRolloutsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServiceRolloutsResponse instance + */ + public static create(properties?: google.api.servicemanagement.v1.IListServiceRolloutsResponse): google.api.servicemanagement.v1.ListServiceRolloutsResponse; + + /** + * Encodes the specified ListServiceRolloutsResponse message. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceRolloutsResponse.verify|verify} messages. + * @param message ListServiceRolloutsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IListServiceRolloutsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServiceRolloutsResponse message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceRolloutsResponse.verify|verify} messages. + * @param message ListServiceRolloutsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IListServiceRolloutsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServiceRolloutsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServiceRolloutsResponse + * @throws {Error} If the payload is not 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.servicemanagement.v1.ListServiceRolloutsResponse; + + /** + * Decodes a ListServiceRolloutsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServiceRolloutsResponse + * @throws {Error} If the payload 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.servicemanagement.v1.ListServiceRolloutsResponse; + + /** + * Verifies a ListServiceRolloutsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServiceRolloutsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServiceRolloutsResponse + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.ListServiceRolloutsResponse; + + /** + * Creates a plain object from a ListServiceRolloutsResponse message. Also converts values to other types if specified. + * @param message ListServiceRolloutsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.ListServiceRolloutsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServiceRolloutsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServiceRolloutsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetServiceRolloutRequest. */ + interface IGetServiceRolloutRequest { + + /** GetServiceRolloutRequest serviceName */ + serviceName?: (string|null); + + /** GetServiceRolloutRequest rolloutId */ + rolloutId?: (string|null); + } + + /** Represents a GetServiceRolloutRequest. */ + class GetServiceRolloutRequest implements IGetServiceRolloutRequest { + + /** + * Constructs a new GetServiceRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IGetServiceRolloutRequest); + + /** GetServiceRolloutRequest serviceName. */ + public serviceName: string; + + /** GetServiceRolloutRequest rolloutId. */ + public rolloutId: string; + + /** + * Creates a new GetServiceRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServiceRolloutRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.IGetServiceRolloutRequest): google.api.servicemanagement.v1.GetServiceRolloutRequest; + + /** + * Encodes the specified GetServiceRolloutRequest message. Does not implicitly {@link google.api.servicemanagement.v1.GetServiceRolloutRequest.verify|verify} messages. + * @param message GetServiceRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IGetServiceRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetServiceRolloutRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.GetServiceRolloutRequest.verify|verify} messages. + * @param message GetServiceRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IGetServiceRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetServiceRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetServiceRolloutRequest + * @throws {Error} If the payload is not 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.servicemanagement.v1.GetServiceRolloutRequest; + + /** + * Decodes a GetServiceRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetServiceRolloutRequest + * @throws {Error} If the payload 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.servicemanagement.v1.GetServiceRolloutRequest; + + /** + * Verifies a GetServiceRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetServiceRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetServiceRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.GetServiceRolloutRequest; + + /** + * Creates a plain object from a GetServiceRolloutRequest message. Also converts values to other types if specified. + * @param message GetServiceRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.GetServiceRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetServiceRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetServiceRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateConfigReportRequest. */ + interface IGenerateConfigReportRequest { + + /** GenerateConfigReportRequest newConfig */ + newConfig?: (google.protobuf.IAny|null); + + /** GenerateConfigReportRequest oldConfig */ + oldConfig?: (google.protobuf.IAny|null); + } + + /** Represents a GenerateConfigReportRequest. */ + class GenerateConfigReportRequest implements IGenerateConfigReportRequest { + + /** + * Constructs a new GenerateConfigReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IGenerateConfigReportRequest); + + /** GenerateConfigReportRequest newConfig. */ + public newConfig?: (google.protobuf.IAny|null); + + /** GenerateConfigReportRequest oldConfig. */ + public oldConfig?: (google.protobuf.IAny|null); + + /** + * Creates a new GenerateConfigReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateConfigReportRequest instance + */ + public static create(properties?: google.api.servicemanagement.v1.IGenerateConfigReportRequest): google.api.servicemanagement.v1.GenerateConfigReportRequest; + + /** + * Encodes the specified GenerateConfigReportRequest message. Does not implicitly {@link google.api.servicemanagement.v1.GenerateConfigReportRequest.verify|verify} messages. + * @param message GenerateConfigReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IGenerateConfigReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateConfigReportRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.GenerateConfigReportRequest.verify|verify} messages. + * @param message GenerateConfigReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IGenerateConfigReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateConfigReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateConfigReportRequest + * @throws {Error} If the payload is not 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.servicemanagement.v1.GenerateConfigReportRequest; + + /** + * Decodes a GenerateConfigReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateConfigReportRequest + * @throws {Error} If the payload 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.servicemanagement.v1.GenerateConfigReportRequest; + + /** + * Verifies a GenerateConfigReportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateConfigReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateConfigReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.GenerateConfigReportRequest; + + /** + * Creates a plain object from a GenerateConfigReportRequest message. Also converts values to other types if specified. + * @param message GenerateConfigReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.GenerateConfigReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateConfigReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateConfigReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateConfigReportResponse. */ + interface IGenerateConfigReportResponse { + + /** GenerateConfigReportResponse serviceName */ + serviceName?: (string|null); + + /** GenerateConfigReportResponse id */ + id?: (string|null); + + /** GenerateConfigReportResponse changeReports */ + changeReports?: (google.api.servicemanagement.v1.IChangeReport[]|null); + + /** GenerateConfigReportResponse diagnostics */ + diagnostics?: (google.api.servicemanagement.v1.IDiagnostic[]|null); + } + + /** Represents a GenerateConfigReportResponse. */ + class GenerateConfigReportResponse implements IGenerateConfigReportResponse { + + /** + * Constructs a new GenerateConfigReportResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.servicemanagement.v1.IGenerateConfigReportResponse); + + /** GenerateConfigReportResponse serviceName. */ + public serviceName: string; + + /** GenerateConfigReportResponse id. */ + public id: string; + + /** GenerateConfigReportResponse changeReports. */ + public changeReports: google.api.servicemanagement.v1.IChangeReport[]; + + /** GenerateConfigReportResponse diagnostics. */ + public diagnostics: google.api.servicemanagement.v1.IDiagnostic[]; + + /** + * Creates a new GenerateConfigReportResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateConfigReportResponse instance + */ + public static create(properties?: google.api.servicemanagement.v1.IGenerateConfigReportResponse): google.api.servicemanagement.v1.GenerateConfigReportResponse; + + /** + * Encodes the specified GenerateConfigReportResponse message. Does not implicitly {@link google.api.servicemanagement.v1.GenerateConfigReportResponse.verify|verify} messages. + * @param message GenerateConfigReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.servicemanagement.v1.IGenerateConfigReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateConfigReportResponse message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.GenerateConfigReportResponse.verify|verify} messages. + * @param message GenerateConfigReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.servicemanagement.v1.IGenerateConfigReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateConfigReportResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateConfigReportResponse + * @throws {Error} If the payload is not 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.servicemanagement.v1.GenerateConfigReportResponse; + + /** + * Decodes a GenerateConfigReportResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateConfigReportResponse + * @throws {Error} If the payload 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.servicemanagement.v1.GenerateConfigReportResponse; + + /** + * Verifies a GenerateConfigReportResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateConfigReportResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateConfigReportResponse + */ + public static fromObject(object: { [k: string]: any }): google.api.servicemanagement.v1.GenerateConfigReportResponse; + + /** + * Creates a plain object from a GenerateConfigReportResponse message. Also converts values to other types if specified. + * @param message GenerateConfigReportResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.servicemanagement.v1.GenerateConfigReportResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateConfigReportResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateConfigReportResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a ConfigChange. */ + interface IConfigChange { + + /** ConfigChange element */ + element?: (string|null); + + /** ConfigChange oldValue */ + oldValue?: (string|null); + + /** ConfigChange newValue */ + newValue?: (string|null); + + /** ConfigChange changeType */ + changeType?: (google.api.ChangeType|keyof typeof google.api.ChangeType|null); + + /** ConfigChange advices */ + advices?: (google.api.IAdvice[]|null); + } + + /** Represents a ConfigChange. */ + class ConfigChange implements IConfigChange { + + /** + * Constructs a new ConfigChange. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IConfigChange); + + /** ConfigChange element. */ + public element: string; + + /** ConfigChange oldValue. */ + public oldValue: string; + + /** ConfigChange newValue. */ + public newValue: string; + + /** ConfigChange changeType. */ + public changeType: (google.api.ChangeType|keyof typeof google.api.ChangeType); + + /** ConfigChange advices. */ + public advices: google.api.IAdvice[]; + + /** + * Creates a new ConfigChange instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfigChange instance + */ + public static create(properties?: google.api.IConfigChange): google.api.ConfigChange; + + /** + * Encodes the specified ConfigChange message. Does not implicitly {@link google.api.ConfigChange.verify|verify} messages. + * @param message ConfigChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IConfigChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfigChange message, length delimited. Does not implicitly {@link google.api.ConfigChange.verify|verify} messages. + * @param message ConfigChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IConfigChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfigChange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfigChange + * @throws {Error} If the payload is not 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.ConfigChange; + + /** + * Decodes a ConfigChange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfigChange + * @throws {Error} If the payload 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.ConfigChange; + + /** + * Verifies a ConfigChange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfigChange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfigChange + */ + public static fromObject(object: { [k: string]: any }): google.api.ConfigChange; + + /** + * Creates a plain object from a ConfigChange message. Also converts values to other types if specified. + * @param message ConfigChange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ConfigChange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfigChange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfigChange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Advice. */ + interface IAdvice { + + /** Advice description */ + description?: (string|null); + } + + /** Represents an Advice. */ + class Advice implements IAdvice { + + /** + * Constructs a new Advice. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IAdvice); + + /** Advice description. */ + public description: string; + + /** + * Creates a new Advice instance using the specified properties. + * @param [properties] Properties to set + * @returns Advice instance + */ + public static create(properties?: google.api.IAdvice): google.api.Advice; + + /** + * Encodes the specified Advice message. Does not implicitly {@link google.api.Advice.verify|verify} messages. + * @param message Advice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IAdvice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Advice message, length delimited. Does not implicitly {@link google.api.Advice.verify|verify} messages. + * @param message Advice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IAdvice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Advice message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Advice + * @throws {Error} If the payload is not 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.Advice; + + /** + * Decodes an Advice message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Advice + * @throws {Error} If the payload 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.Advice; + + /** + * Verifies an Advice message. + * @param message Plain 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 Advice message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Advice + */ + public static fromObject(object: { [k: string]: any }): google.api.Advice; + + /** + * Creates a plain object from an Advice message. Also converts values to other types if specified. + * @param message Advice + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Advice, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Advice to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Advice + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ChangeType enum. */ + enum ChangeType { + CHANGE_TYPE_UNSPECIFIED = 0, + ADDED = 1, + REMOVED = 2, + MODIFIED = 3 + } + + /** 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 Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Service. */ + interface IService { + + /** Service name */ + name?: (string|null); + + /** Service title */ + title?: (string|null); + + /** Service producerProjectId */ + producerProjectId?: (string|null); + + /** Service id */ + id?: (string|null); + + /** Service apis */ + apis?: (google.protobuf.IApi[]|null); + + /** Service types */ + types?: (google.protobuf.IType[]|null); + + /** Service enums */ + enums?: (google.protobuf.IEnum[]|null); + + /** Service documentation */ + documentation?: (google.api.IDocumentation|null); + + /** Service backend */ + backend?: (google.api.IBackend|null); + + /** Service http */ + http?: (google.api.IHttp|null); + + /** Service quota */ + quota?: (google.api.IQuota|null); + + /** Service authentication */ + authentication?: (google.api.IAuthentication|null); + + /** Service context */ + context?: (google.api.IContext|null); + + /** Service usage */ + usage?: (google.api.IUsage|null); + + /** Service endpoints */ + endpoints?: (google.api.IEndpoint[]|null); + + /** Service control */ + control?: (google.api.IControl|null); + + /** Service logs */ + logs?: (google.api.ILogDescriptor[]|null); + + /** Service metrics */ + metrics?: (google.api.IMetricDescriptor[]|null); + + /** Service monitoredResources */ + monitoredResources?: (google.api.IMonitoredResourceDescriptor[]|null); + + /** Service billing */ + billing?: (google.api.IBilling|null); + + /** Service logging */ + logging?: (google.api.ILogging|null); + + /** Service monitoring */ + monitoring?: (google.api.IMonitoring|null); + + /** Service systemParameters */ + systemParameters?: (google.api.ISystemParameters|null); + + /** Service sourceInfo */ + sourceInfo?: (google.api.ISourceInfo|null); + + /** Service configVersion */ + configVersion?: (google.protobuf.IUInt32Value|null); + } + + /** Represents a Service. */ + class Service implements IService { + + /** + * Constructs a new Service. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IService); + + /** Service name. */ + public name: string; + + /** Service title. */ + public title: string; + + /** Service producerProjectId. */ + public producerProjectId: string; + + /** Service id. */ + public id: string; + + /** Service apis. */ + public apis: google.protobuf.IApi[]; + + /** Service types. */ + public types: google.protobuf.IType[]; + + /** Service enums. */ + public enums: google.protobuf.IEnum[]; + + /** Service documentation. */ + public documentation?: (google.api.IDocumentation|null); + + /** Service backend. */ + public backend?: (google.api.IBackend|null); + + /** Service http. */ + public http?: (google.api.IHttp|null); + + /** Service quota. */ + public quota?: (google.api.IQuota|null); + + /** Service authentication. */ + public authentication?: (google.api.IAuthentication|null); + + /** Service context. */ + public context?: (google.api.IContext|null); + + /** Service usage. */ + public usage?: (google.api.IUsage|null); + + /** Service endpoints. */ + public endpoints: google.api.IEndpoint[]; + + /** Service control. */ + public control?: (google.api.IControl|null); + + /** Service logs. */ + public logs: google.api.ILogDescriptor[]; + + /** Service metrics. */ + public metrics: google.api.IMetricDescriptor[]; + + /** Service monitoredResources. */ + public monitoredResources: google.api.IMonitoredResourceDescriptor[]; + + /** Service billing. */ + public billing?: (google.api.IBilling|null); + + /** Service logging. */ + public logging?: (google.api.ILogging|null); + + /** Service monitoring. */ + public monitoring?: (google.api.IMonitoring|null); + + /** Service systemParameters. */ + public systemParameters?: (google.api.ISystemParameters|null); + + /** Service sourceInfo. */ + public sourceInfo?: (google.api.ISourceInfo|null); + + /** Service configVersion. */ + public configVersion?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new Service instance using the specified properties. + * @param [properties] Properties to set + * @returns Service instance + */ + public static create(properties?: google.api.IService): google.api.Service; + + /** + * Encodes the specified Service message. Does not implicitly {@link google.api.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.api.IService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.api.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.api.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.api.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.api.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.api.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.api.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 an Authentication. */ + interface IAuthentication { + + /** Authentication rules */ + rules?: (google.api.IAuthenticationRule[]|null); + + /** Authentication providers */ + providers?: (google.api.IAuthProvider[]|null); + } + + /** Represents an Authentication. */ + class Authentication implements IAuthentication { + + /** + * Constructs a new Authentication. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IAuthentication); + + /** Authentication rules. */ + public rules: google.api.IAuthenticationRule[]; + + /** Authentication providers. */ + public providers: google.api.IAuthProvider[]; + + /** + * Creates a new Authentication instance using the specified properties. + * @param [properties] Properties to set + * @returns Authentication instance + */ + public static create(properties?: google.api.IAuthentication): google.api.Authentication; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.api.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.api.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Authentication + * @throws {Error} If the payload is not 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.Authentication; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Authentication + * @throws {Error} If the payload 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.Authentication; + + /** + * Verifies an Authentication message. + * @param message Plain 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 Authentication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Authentication + */ + public static fromObject(object: { [k: string]: any }): google.api.Authentication; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @param message Authentication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Authentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Authentication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Authentication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuthenticationRule. */ + interface IAuthenticationRule { + + /** AuthenticationRule selector */ + selector?: (string|null); + + /** AuthenticationRule oauth */ + oauth?: (google.api.IOAuthRequirements|null); + + /** AuthenticationRule allowWithoutCredential */ + allowWithoutCredential?: (boolean|null); + + /** AuthenticationRule requirements */ + requirements?: (google.api.IAuthRequirement[]|null); + } + + /** Represents an AuthenticationRule. */ + class AuthenticationRule implements IAuthenticationRule { + + /** + * Constructs a new AuthenticationRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IAuthenticationRule); + + /** AuthenticationRule selector. */ + public selector: string; + + /** AuthenticationRule oauth. */ + public oauth?: (google.api.IOAuthRequirements|null); + + /** AuthenticationRule allowWithoutCredential. */ + public allowWithoutCredential: boolean; + + /** AuthenticationRule requirements. */ + public requirements: google.api.IAuthRequirement[]; + + /** + * Creates a new AuthenticationRule instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthenticationRule instance + */ + public static create(properties?: google.api.IAuthenticationRule): google.api.AuthenticationRule; + + /** + * Encodes the specified AuthenticationRule message. Does not implicitly {@link google.api.AuthenticationRule.verify|verify} messages. + * @param message AuthenticationRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IAuthenticationRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthenticationRule message, length delimited. Does not implicitly {@link google.api.AuthenticationRule.verify|verify} messages. + * @param message AuthenticationRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IAuthenticationRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthenticationRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthenticationRule + * @throws {Error} If the payload is not 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.AuthenticationRule; + + /** + * Decodes an AuthenticationRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthenticationRule + * @throws {Error} If the payload 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.AuthenticationRule; + + /** + * Verifies an AuthenticationRule message. + * @param message Plain 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 AuthenticationRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthenticationRule + */ + public static fromObject(object: { [k: string]: any }): google.api.AuthenticationRule; + + /** + * Creates a plain object from an AuthenticationRule message. Also converts values to other types if specified. + * @param message AuthenticationRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.AuthenticationRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthenticationRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthenticationRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JwtLocation. */ + interface IJwtLocation { + + /** JwtLocation header */ + header?: (string|null); + + /** JwtLocation query */ + query?: (string|null); + + /** JwtLocation valuePrefix */ + valuePrefix?: (string|null); + } + + /** Represents a JwtLocation. */ + class JwtLocation implements IJwtLocation { + + /** + * Constructs a new JwtLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJwtLocation); + + /** JwtLocation header. */ + public header?: (string|null); + + /** JwtLocation query. */ + public query?: (string|null); + + /** JwtLocation valuePrefix. */ + public valuePrefix: string; + + /** JwtLocation in. */ + public in_?: ("header"|"query"); + + /** + * Creates a new JwtLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns JwtLocation instance + */ + public static create(properties?: google.api.IJwtLocation): google.api.JwtLocation; + + /** + * Encodes the specified JwtLocation message. Does not implicitly {@link google.api.JwtLocation.verify|verify} messages. + * @param message JwtLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJwtLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JwtLocation message, length delimited. Does not implicitly {@link google.api.JwtLocation.verify|verify} messages. + * @param message JwtLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJwtLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JwtLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JwtLocation + * @throws {Error} If the payload is not 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.JwtLocation; + + /** + * Decodes a JwtLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JwtLocation + * @throws {Error} If the payload 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.JwtLocation; + + /** + * Verifies a JwtLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JwtLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JwtLocation + */ + public static fromObject(object: { [k: string]: any }): google.api.JwtLocation; + + /** + * Creates a plain object from a JwtLocation message. Also converts values to other types if specified. + * @param message JwtLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JwtLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JwtLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JwtLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuthProvider. */ + interface IAuthProvider { + + /** AuthProvider id */ + id?: (string|null); + + /** AuthProvider issuer */ + issuer?: (string|null); + + /** AuthProvider jwksUri */ + jwksUri?: (string|null); + + /** AuthProvider audiences */ + audiences?: (string|null); + + /** AuthProvider authorizationUrl */ + authorizationUrl?: (string|null); + + /** AuthProvider jwtLocations */ + jwtLocations?: (google.api.IJwtLocation[]|null); + } + + /** Represents an AuthProvider. */ + class AuthProvider implements IAuthProvider { + + /** + * Constructs a new AuthProvider. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IAuthProvider); + + /** AuthProvider id. */ + public id: string; + + /** AuthProvider issuer. */ + public issuer: string; + + /** AuthProvider jwksUri. */ + public jwksUri: string; + + /** AuthProvider audiences. */ + public audiences: string; + + /** AuthProvider authorizationUrl. */ + public authorizationUrl: string; + + /** AuthProvider jwtLocations. */ + public jwtLocations: google.api.IJwtLocation[]; + + /** + * Creates a new AuthProvider instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthProvider instance + */ + public static create(properties?: google.api.IAuthProvider): google.api.AuthProvider; + + /** + * Encodes the specified AuthProvider message. Does not implicitly {@link google.api.AuthProvider.verify|verify} messages. + * @param message AuthProvider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IAuthProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthProvider message, length delimited. Does not implicitly {@link google.api.AuthProvider.verify|verify} messages. + * @param message AuthProvider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IAuthProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthProvider message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthProvider + * @throws {Error} If the payload is not 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.AuthProvider; + + /** + * Decodes an AuthProvider message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthProvider + * @throws {Error} If the payload 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.AuthProvider; + + /** + * Verifies an AuthProvider message. + * @param message Plain 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 AuthProvider message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthProvider + */ + public static fromObject(object: { [k: string]: any }): google.api.AuthProvider; + + /** + * Creates a plain object from an AuthProvider message. Also converts values to other types if specified. + * @param message AuthProvider + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.AuthProvider, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthProvider to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthProvider + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a OAuthRequirements. */ + interface IOAuthRequirements { + + /** OAuthRequirements canonicalScopes */ + canonicalScopes?: (string|null); + } + + /** Represents a OAuthRequirements. */ + class OAuthRequirements implements IOAuthRequirements { + + /** + * Constructs a new OAuthRequirements. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IOAuthRequirements); + + /** OAuthRequirements canonicalScopes. */ + public canonicalScopes: string; + + /** + * Creates a new OAuthRequirements instance using the specified properties. + * @param [properties] Properties to set + * @returns OAuthRequirements instance + */ + public static create(properties?: google.api.IOAuthRequirements): google.api.OAuthRequirements; + + /** + * Encodes the specified OAuthRequirements message. Does not implicitly {@link google.api.OAuthRequirements.verify|verify} messages. + * @param message OAuthRequirements message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IOAuthRequirements, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OAuthRequirements message, length delimited. Does not implicitly {@link google.api.OAuthRequirements.verify|verify} messages. + * @param message OAuthRequirements message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IOAuthRequirements, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OAuthRequirements message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OAuthRequirements + * @throws {Error} If the payload is not 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.OAuthRequirements; + + /** + * Decodes a OAuthRequirements message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OAuthRequirements + * @throws {Error} If the payload 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.OAuthRequirements; + + /** + * Verifies a OAuthRequirements message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OAuthRequirements message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OAuthRequirements + */ + public static fromObject(object: { [k: string]: any }): google.api.OAuthRequirements; + + /** + * Creates a plain object from a OAuthRequirements message. Also converts values to other types if specified. + * @param message OAuthRequirements + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.OAuthRequirements, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OAuthRequirements to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OAuthRequirements + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuthRequirement. */ + interface IAuthRequirement { + + /** AuthRequirement providerId */ + providerId?: (string|null); + + /** AuthRequirement audiences */ + audiences?: (string|null); + } + + /** Represents an AuthRequirement. */ + class AuthRequirement implements IAuthRequirement { + + /** + * Constructs a new AuthRequirement. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IAuthRequirement); + + /** AuthRequirement providerId. */ + public providerId: string; + + /** AuthRequirement audiences. */ + public audiences: string; + + /** + * Creates a new AuthRequirement instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthRequirement instance + */ + public static create(properties?: google.api.IAuthRequirement): google.api.AuthRequirement; + + /** + * Encodes the specified AuthRequirement message. Does not implicitly {@link google.api.AuthRequirement.verify|verify} messages. + * @param message AuthRequirement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IAuthRequirement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthRequirement message, length delimited. Does not implicitly {@link google.api.AuthRequirement.verify|verify} messages. + * @param message AuthRequirement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IAuthRequirement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthRequirement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthRequirement + * @throws {Error} If the payload is not 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.AuthRequirement; + + /** + * Decodes an AuthRequirement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthRequirement + * @throws {Error} If the payload 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.AuthRequirement; + + /** + * Verifies an AuthRequirement message. + * @param message Plain 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 AuthRequirement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthRequirement + */ + public static fromObject(object: { [k: string]: any }): google.api.AuthRequirement; + + /** + * Creates a plain object from an AuthRequirement message. Also converts values to other types if specified. + * @param message AuthRequirement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.AuthRequirement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthRequirement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthRequirement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Backend. */ + interface IBackend { + + /** Backend rules */ + rules?: (google.api.IBackendRule[]|null); + } + + /** Represents a Backend. */ + class Backend implements IBackend { + + /** + * Constructs a new Backend. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IBackend); + + /** Backend rules. */ + public rules: google.api.IBackendRule[]; + + /** + * Creates a new Backend instance using the specified properties. + * @param [properties] Properties to set + * @returns Backend instance + */ + public static create(properties?: google.api.IBackend): google.api.Backend; + + /** + * Encodes the specified Backend message. Does not implicitly {@link google.api.Backend.verify|verify} messages. + * @param message Backend message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IBackend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backend message, length delimited. Does not implicitly {@link google.api.Backend.verify|verify} messages. + * @param message Backend message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IBackend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backend message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backend + * @throws {Error} If the payload is not 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.Backend; + + /** + * Decodes a Backend message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backend + * @throws {Error} If the payload 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.Backend; + + /** + * Verifies a Backend message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backend message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backend + */ + public static fromObject(object: { [k: string]: any }): google.api.Backend; + + /** + * Creates a plain object from a Backend message. Also converts values to other types if specified. + * @param message Backend + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Backend, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backend to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backend + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackendRule. */ + interface IBackendRule { + + /** BackendRule selector */ + selector?: (string|null); + + /** BackendRule address */ + address?: (string|null); + + /** BackendRule deadline */ + deadline?: (number|null); + + /** BackendRule minDeadline */ + minDeadline?: (number|null); + + /** BackendRule operationDeadline */ + operationDeadline?: (number|null); + + /** BackendRule pathTranslation */ + pathTranslation?: (google.api.BackendRule.PathTranslation|keyof typeof google.api.BackendRule.PathTranslation|null); + + /** BackendRule jwtAudience */ + jwtAudience?: (string|null); + + /** BackendRule disableAuth */ + disableAuth?: (boolean|null); + + /** BackendRule protocol */ + protocol?: (string|null); + } + + /** Represents a BackendRule. */ + class BackendRule implements IBackendRule { + + /** + * Constructs a new BackendRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IBackendRule); + + /** BackendRule selector. */ + public selector: string; + + /** BackendRule address. */ + public address: string; + + /** BackendRule deadline. */ + public deadline: number; + + /** BackendRule minDeadline. */ + public minDeadline: number; + + /** BackendRule operationDeadline. */ + public operationDeadline: number; + + /** BackendRule pathTranslation. */ + public pathTranslation: (google.api.BackendRule.PathTranslation|keyof typeof google.api.BackendRule.PathTranslation); + + /** BackendRule jwtAudience. */ + public jwtAudience?: (string|null); + + /** BackendRule disableAuth. */ + public disableAuth?: (boolean|null); + + /** BackendRule protocol. */ + public protocol: string; + + /** BackendRule authentication. */ + public authentication?: ("jwtAudience"|"disableAuth"); + + /** + * Creates a new BackendRule instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendRule instance + */ + public static create(properties?: google.api.IBackendRule): google.api.BackendRule; + + /** + * Encodes the specified BackendRule message. Does not implicitly {@link google.api.BackendRule.verify|verify} messages. + * @param message BackendRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IBackendRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendRule message, length delimited. Does not implicitly {@link google.api.BackendRule.verify|verify} messages. + * @param message BackendRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IBackendRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendRule + * @throws {Error} If the payload is not 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.BackendRule; + + /** + * Decodes a BackendRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendRule + * @throws {Error} If the payload 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.BackendRule; + + /** + * Verifies a BackendRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendRule + */ + public static fromObject(object: { [k: string]: any }): google.api.BackendRule; + + /** + * Creates a plain object from a BackendRule message. Also converts values to other types if specified. + * @param message BackendRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.BackendRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackendRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackendRule { + + /** PathTranslation enum. */ + enum PathTranslation { + PATH_TRANSLATION_UNSPECIFIED = 0, + CONSTANT_ADDRESS = 1, + APPEND_PATH_TO_ADDRESS = 2 + } + } + + /** Properties of a Billing. */ + interface IBilling { + + /** Billing consumerDestinations */ + consumerDestinations?: (google.api.Billing.IBillingDestination[]|null); + } + + /** Represents a Billing. */ + class Billing implements IBilling { + + /** + * Constructs a new Billing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IBilling); + + /** Billing consumerDestinations. */ + public consumerDestinations: google.api.Billing.IBillingDestination[]; + + /** + * Creates a new Billing instance using the specified properties. + * @param [properties] Properties to set + * @returns Billing instance + */ + public static create(properties?: google.api.IBilling): google.api.Billing; + + /** + * Encodes the specified Billing message. Does not implicitly {@link google.api.Billing.verify|verify} messages. + * @param message Billing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IBilling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Billing message, length delimited. Does not implicitly {@link google.api.Billing.verify|verify} messages. + * @param message Billing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IBilling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Billing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Billing + * @throws {Error} If the payload is not 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.Billing; + + /** + * Decodes a Billing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Billing + * @throws {Error} If the payload 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.Billing; + + /** + * Verifies a Billing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Billing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Billing + */ + public static fromObject(object: { [k: string]: any }): google.api.Billing; + + /** + * Creates a plain object from a Billing message. Also converts values to other types if specified. + * @param message Billing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Billing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Billing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Billing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Billing { + + /** Properties of a BillingDestination. */ + interface IBillingDestination { + + /** BillingDestination monitoredResource */ + monitoredResource?: (string|null); + + /** BillingDestination metrics */ + metrics?: (string[]|null); + } + + /** Represents a BillingDestination. */ + class BillingDestination implements IBillingDestination { + + /** + * Constructs a new BillingDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Billing.IBillingDestination); + + /** BillingDestination monitoredResource. */ + public monitoredResource: string; + + /** BillingDestination metrics. */ + public metrics: string[]; + + /** + * Creates a new BillingDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BillingDestination instance + */ + public static create(properties?: google.api.Billing.IBillingDestination): google.api.Billing.BillingDestination; + + /** + * Encodes the specified BillingDestination message. Does not implicitly {@link google.api.Billing.BillingDestination.verify|verify} messages. + * @param message BillingDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.Billing.IBillingDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BillingDestination message, length delimited. Does not implicitly {@link google.api.Billing.BillingDestination.verify|verify} messages. + * @param message BillingDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.Billing.IBillingDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BillingDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BillingDestination + * @throws {Error} If the payload is not 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.Billing.BillingDestination; + + /** + * Decodes a BillingDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BillingDestination + * @throws {Error} If the payload 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.Billing.BillingDestination; + + /** + * Verifies a BillingDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BillingDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BillingDestination + */ + public static fromObject(object: { [k: string]: any }): google.api.Billing.BillingDestination; + + /** + * Creates a plain object from a BillingDestination message. Also converts values to other types if specified. + * @param message BillingDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Billing.BillingDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BillingDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BillingDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Context. */ + interface IContext { + + /** Context rules */ + rules?: (google.api.IContextRule[]|null); + } + + /** Represents a Context. */ + class Context implements IContext { + + /** + * Constructs a new Context. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IContext); + + /** Context rules. */ + public rules: google.api.IContextRule[]; + + /** + * Creates a new Context instance using the specified properties. + * @param [properties] Properties to set + * @returns Context instance + */ + public static create(properties?: google.api.IContext): google.api.Context; + + /** + * Encodes the specified Context message. Does not implicitly {@link google.api.Context.verify|verify} messages. + * @param message Context message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Context message, length delimited. Does not implicitly {@link google.api.Context.verify|verify} messages. + * @param message Context message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Context message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Context + * @throws {Error} If the payload is not 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.Context; + + /** + * Decodes a Context message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Context + * @throws {Error} If the payload 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.Context; + + /** + * Verifies a Context message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Context message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Context + */ + public static fromObject(object: { [k: string]: any }): google.api.Context; + + /** + * Creates a plain object from a Context message. Also converts values to other types if specified. + * @param message Context + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Context, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Context to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Context + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContextRule. */ + interface IContextRule { + + /** ContextRule selector */ + selector?: (string|null); + + /** ContextRule requested */ + requested?: (string[]|null); + + /** ContextRule provided */ + provided?: (string[]|null); + + /** ContextRule allowedRequestExtensions */ + allowedRequestExtensions?: (string[]|null); + + /** ContextRule allowedResponseExtensions */ + allowedResponseExtensions?: (string[]|null); + } + + /** Represents a ContextRule. */ + class ContextRule implements IContextRule { + + /** + * Constructs a new ContextRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IContextRule); + + /** ContextRule selector. */ + public selector: string; + + /** ContextRule requested. */ + public requested: string[]; + + /** ContextRule provided. */ + public provided: string[]; + + /** ContextRule allowedRequestExtensions. */ + public allowedRequestExtensions: string[]; + + /** ContextRule allowedResponseExtensions. */ + public allowedResponseExtensions: string[]; + + /** + * Creates a new ContextRule instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextRule instance + */ + public static create(properties?: google.api.IContextRule): google.api.ContextRule; + + /** + * Encodes the specified ContextRule message. Does not implicitly {@link google.api.ContextRule.verify|verify} messages. + * @param message ContextRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IContextRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContextRule message, length delimited. Does not implicitly {@link google.api.ContextRule.verify|verify} messages. + * @param message ContextRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IContextRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContextRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextRule + * @throws {Error} If the payload is not 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.ContextRule; + + /** + * Decodes a ContextRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextRule + * @throws {Error} If the payload 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.ContextRule; + + /** + * Verifies a ContextRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContextRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContextRule + */ + public static fromObject(object: { [k: string]: any }): google.api.ContextRule; + + /** + * Creates a plain object from a ContextRule message. Also converts values to other types if specified. + * @param message ContextRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ContextRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContextRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContextRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Control. */ + interface IControl { + + /** Control environment */ + environment?: (string|null); + } + + /** Represents a Control. */ + class Control implements IControl { + + /** + * Constructs a new Control. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IControl); + + /** Control environment. */ + public environment: string; + + /** + * Creates a new Control instance using the specified properties. + * @param [properties] Properties to set + * @returns Control instance + */ + public static create(properties?: google.api.IControl): google.api.Control; + + /** + * Encodes the specified Control message. Does not implicitly {@link google.api.Control.verify|verify} messages. + * @param message Control message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Control message, length delimited. Does not implicitly {@link google.api.Control.verify|verify} messages. + * @param message Control message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Control message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Control + * @throws {Error} If the payload is not 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.Control; + + /** + * Decodes a Control message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Control + * @throws {Error} If the payload 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.Control; + + /** + * Verifies a Control message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Control message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Control + */ + public static fromObject(object: { [k: string]: any }): google.api.Control; + + /** + * Creates a plain object from a Control message. Also converts values to other types if specified. + * @param message Control + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Control, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Control to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Control + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Documentation. */ + interface IDocumentation { + + /** Documentation summary */ + summary?: (string|null); + + /** Documentation pages */ + pages?: (google.api.IPage[]|null); + + /** Documentation rules */ + rules?: (google.api.IDocumentationRule[]|null); + + /** Documentation documentationRootUrl */ + documentationRootUrl?: (string|null); + + /** Documentation serviceRootUrl */ + serviceRootUrl?: (string|null); + + /** Documentation overview */ + overview?: (string|null); + } + + /** Represents a Documentation. */ + class Documentation implements IDocumentation { + + /** + * Constructs a new Documentation. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDocumentation); + + /** Documentation summary. */ + public summary: string; + + /** Documentation pages. */ + public pages: google.api.IPage[]; + + /** Documentation rules. */ + public rules: google.api.IDocumentationRule[]; + + /** Documentation documentationRootUrl. */ + public documentationRootUrl: string; + + /** Documentation serviceRootUrl. */ + public serviceRootUrl: string; + + /** Documentation overview. */ + public overview: string; + + /** + * Creates a new Documentation instance using the specified properties. + * @param [properties] Properties to set + * @returns Documentation instance + */ + public static create(properties?: google.api.IDocumentation): google.api.Documentation; + + /** + * Encodes the specified Documentation message. Does not implicitly {@link google.api.Documentation.verify|verify} messages. + * @param message Documentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.api.Documentation.verify|verify} messages. + * @param message Documentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Documentation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Documentation + * @throws {Error} If the payload is not 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.Documentation; + + /** + * Decodes a Documentation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Documentation + * @throws {Error} If the payload 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.Documentation; + + /** + * Verifies a Documentation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Documentation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Documentation + */ + public static fromObject(object: { [k: string]: any }): google.api.Documentation; + + /** + * Creates a plain object from a Documentation message. Also converts values to other types if specified. + * @param message Documentation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Documentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Documentation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Documentation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentationRule. */ + interface IDocumentationRule { + + /** DocumentationRule selector */ + selector?: (string|null); + + /** DocumentationRule description */ + description?: (string|null); + + /** DocumentationRule deprecationDescription */ + deprecationDescription?: (string|null); + } + + /** Represents a DocumentationRule. */ + class DocumentationRule implements IDocumentationRule { + + /** + * Constructs a new DocumentationRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDocumentationRule); + + /** DocumentationRule selector. */ + public selector: string; + + /** DocumentationRule description. */ + public description: string; + + /** DocumentationRule deprecationDescription. */ + public deprecationDescription: string; + + /** + * Creates a new DocumentationRule instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentationRule instance + */ + public static create(properties?: google.api.IDocumentationRule): google.api.DocumentationRule; + + /** + * Encodes the specified DocumentationRule message. Does not implicitly {@link google.api.DocumentationRule.verify|verify} messages. + * @param message DocumentationRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDocumentationRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentationRule message, length delimited. Does not implicitly {@link google.api.DocumentationRule.verify|verify} messages. + * @param message DocumentationRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDocumentationRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentationRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentationRule + * @throws {Error} If the payload is not 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.DocumentationRule; + + /** + * Decodes a DocumentationRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentationRule + * @throws {Error} If the payload 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.DocumentationRule; + + /** + * Verifies a DocumentationRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentationRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentationRule + */ + public static fromObject(object: { [k: string]: any }): google.api.DocumentationRule; + + /** + * Creates a plain object from a DocumentationRule message. Also converts values to other types if specified. + * @param message DocumentationRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DocumentationRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentationRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentationRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Page. */ + interface IPage { + + /** Page name */ + name?: (string|null); + + /** Page content */ + content?: (string|null); + + /** Page subpages */ + subpages?: (google.api.IPage[]|null); + } + + /** Represents a Page. */ + class Page implements IPage { + + /** + * Constructs a new Page. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPage); + + /** Page name. */ + public name: string; + + /** Page content. */ + public content: string; + + /** Page subpages. */ + public subpages: google.api.IPage[]; + + /** + * Creates a new Page instance using the specified properties. + * @param [properties] Properties to set + * @returns Page instance + */ + public static create(properties?: google.api.IPage): google.api.Page; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.api.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.api.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Page message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Page + * @throws {Error} If the payload is not 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.Page; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Page + * @throws {Error} If the payload 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.Page; + + /** + * Verifies a Page message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Page + */ + public static fromObject(object: { [k: string]: any }): google.api.Page; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @param message Page + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Page, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Page to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Page + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Endpoint. */ + interface IEndpoint { + + /** Endpoint name */ + name?: (string|null); + + /** Endpoint aliases */ + aliases?: (string[]|null); + + /** Endpoint target */ + target?: (string|null); + + /** Endpoint allowCors */ + allowCors?: (boolean|null); + } + + /** Represents an Endpoint. */ + class Endpoint implements IEndpoint { + + /** + * Constructs a new Endpoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IEndpoint); + + /** Endpoint name. */ + public name: string; + + /** Endpoint aliases. */ + public aliases: string[]; + + /** Endpoint target. */ + public target: string; + + /** Endpoint allowCors. */ + public allowCors: boolean; + + /** + * Creates a new Endpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns Endpoint instance + */ + public static create(properties?: google.api.IEndpoint): google.api.Endpoint; + + /** + * Encodes the specified Endpoint message. Does not implicitly {@link google.api.Endpoint.verify|verify} messages. + * @param message Endpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Endpoint message, length delimited. Does not implicitly {@link google.api.Endpoint.verify|verify} messages. + * @param message Endpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Endpoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Endpoint + * @throws {Error} If the payload is not 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.Endpoint; + + /** + * Decodes an Endpoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Endpoint + * @throws {Error} If the payload 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.Endpoint; + + /** + * Verifies an Endpoint message. + * @param message Plain 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 Endpoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Endpoint + */ + public static fromObject(object: { [k: string]: any }): google.api.Endpoint; + + /** + * Creates a plain object from an Endpoint message. Also converts values to other types if specified. + * @param message Endpoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Endpoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Endpoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Endpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogDescriptor. */ + interface ILogDescriptor { + + /** LogDescriptor name */ + name?: (string|null); + + /** LogDescriptor labels */ + labels?: (google.api.ILabelDescriptor[]|null); + + /** LogDescriptor description */ + description?: (string|null); + + /** LogDescriptor displayName */ + displayName?: (string|null); + } + + /** Represents a LogDescriptor. */ + class LogDescriptor implements ILogDescriptor { + + /** + * Constructs a new LogDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ILogDescriptor); + + /** LogDescriptor name. */ + public name: string; + + /** LogDescriptor labels. */ + public labels: google.api.ILabelDescriptor[]; + + /** LogDescriptor description. */ + public description: string; + + /** LogDescriptor displayName. */ + public displayName: string; + + /** + * Creates a new LogDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns LogDescriptor instance + */ + public static create(properties?: google.api.ILogDescriptor): google.api.LogDescriptor; + + /** + * Encodes the specified LogDescriptor message. Does not implicitly {@link google.api.LogDescriptor.verify|verify} messages. + * @param message LogDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ILogDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogDescriptor message, length delimited. Does not implicitly {@link google.api.LogDescriptor.verify|verify} messages. + * @param message LogDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ILogDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogDescriptor + * @throws {Error} If the payload is not 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.LogDescriptor; + + /** + * Decodes a LogDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogDescriptor + * @throws {Error} If the payload 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.LogDescriptor; + + /** + * Verifies a LogDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.LogDescriptor; + + /** + * Creates a plain object from a LogDescriptor message. Also converts values to other types if specified. + * @param message LogDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.LogDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelDescriptor. */ + interface ILabelDescriptor { + + /** LabelDescriptor key */ + key?: (string|null); + + /** LabelDescriptor valueType */ + valueType?: (google.api.LabelDescriptor.ValueType|keyof typeof google.api.LabelDescriptor.ValueType|null); + + /** LabelDescriptor description */ + description?: (string|null); + } + + /** Represents a LabelDescriptor. */ + class LabelDescriptor implements ILabelDescriptor { + + /** + * Constructs a new LabelDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ILabelDescriptor); + + /** LabelDescriptor key. */ + public key: string; + + /** LabelDescriptor valueType. */ + public valueType: (google.api.LabelDescriptor.ValueType|keyof typeof google.api.LabelDescriptor.ValueType); + + /** LabelDescriptor description. */ + public description: string; + + /** + * Creates a new LabelDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelDescriptor instance + */ + public static create(properties?: google.api.ILabelDescriptor): google.api.LabelDescriptor; + + /** + * Encodes the specified LabelDescriptor message. Does not implicitly {@link google.api.LabelDescriptor.verify|verify} messages. + * @param message LabelDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ILabelDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelDescriptor message, length delimited. Does not implicitly {@link google.api.LabelDescriptor.verify|verify} messages. + * @param message LabelDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ILabelDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelDescriptor + * @throws {Error} If the payload is not 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.LabelDescriptor; + + /** + * Decodes a LabelDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelDescriptor + * @throws {Error} If the payload 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.LabelDescriptor; + + /** + * Verifies a LabelDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.LabelDescriptor; + + /** + * Creates a plain object from a LabelDescriptor message. Also converts values to other types if specified. + * @param message LabelDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.LabelDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LabelDescriptor { + + /** ValueType enum. */ + enum ValueType { + STRING = 0, + BOOL = 1, + INT64 = 2 + } + } + + /** Properties of a Logging. */ + interface ILogging { + + /** Logging producerDestinations */ + producerDestinations?: (google.api.Logging.ILoggingDestination[]|null); + + /** Logging consumerDestinations */ + consumerDestinations?: (google.api.Logging.ILoggingDestination[]|null); + } + + /** Represents a Logging. */ + class Logging implements ILogging { + + /** + * Constructs a new Logging. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ILogging); + + /** Logging producerDestinations. */ + public producerDestinations: google.api.Logging.ILoggingDestination[]; + + /** Logging consumerDestinations. */ + public consumerDestinations: google.api.Logging.ILoggingDestination[]; + + /** + * Creates a new Logging instance using the specified properties. + * @param [properties] Properties to set + * @returns Logging instance + */ + public static create(properties?: google.api.ILogging): google.api.Logging; + + /** + * Encodes the specified Logging message. Does not implicitly {@link google.api.Logging.verify|verify} messages. + * @param message Logging message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ILogging, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Logging message, length delimited. Does not implicitly {@link google.api.Logging.verify|verify} messages. + * @param message Logging message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ILogging, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Logging message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Logging + * @throws {Error} If the payload is not 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.Logging; + + /** + * Decodes a Logging message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Logging + * @throws {Error} If the payload 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.Logging; + + /** + * Verifies a Logging message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Logging message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Logging + */ + public static fromObject(object: { [k: string]: any }): google.api.Logging; + + /** + * Creates a plain object from a Logging message. Also converts values to other types if specified. + * @param message Logging + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Logging, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Logging to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Logging + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Logging { + + /** Properties of a LoggingDestination. */ + interface ILoggingDestination { + + /** LoggingDestination monitoredResource */ + monitoredResource?: (string|null); + + /** LoggingDestination logs */ + logs?: (string[]|null); + } + + /** Represents a LoggingDestination. */ + class LoggingDestination implements ILoggingDestination { + + /** + * Constructs a new LoggingDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Logging.ILoggingDestination); + + /** LoggingDestination monitoredResource. */ + public monitoredResource: string; + + /** LoggingDestination logs. */ + public logs: string[]; + + /** + * Creates a new LoggingDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns LoggingDestination instance + */ + public static create(properties?: google.api.Logging.ILoggingDestination): google.api.Logging.LoggingDestination; + + /** + * Encodes the specified LoggingDestination message. Does not implicitly {@link google.api.Logging.LoggingDestination.verify|verify} messages. + * @param message LoggingDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.Logging.ILoggingDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoggingDestination message, length delimited. Does not implicitly {@link google.api.Logging.LoggingDestination.verify|verify} messages. + * @param message LoggingDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.Logging.ILoggingDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoggingDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoggingDestination + * @throws {Error} If the payload is not 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.Logging.LoggingDestination; + + /** + * Decodes a LoggingDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoggingDestination + * @throws {Error} If the payload 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.Logging.LoggingDestination; + + /** + * Verifies a LoggingDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoggingDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoggingDestination + */ + public static fromObject(object: { [k: string]: any }): google.api.Logging.LoggingDestination; + + /** + * Creates a plain object from a LoggingDestination message. Also converts values to other types if specified. + * @param message LoggingDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Logging.LoggingDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoggingDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoggingDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MetricDescriptor. */ + interface IMetricDescriptor { + + /** MetricDescriptor name */ + name?: (string|null); + + /** MetricDescriptor type */ + type?: (string|null); + + /** MetricDescriptor labels */ + labels?: (google.api.ILabelDescriptor[]|null); + + /** MetricDescriptor metricKind */ + metricKind?: (google.api.MetricDescriptor.MetricKind|keyof typeof google.api.MetricDescriptor.MetricKind|null); + + /** MetricDescriptor valueType */ + valueType?: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType|null); + + /** MetricDescriptor unit */ + unit?: (string|null); + + /** MetricDescriptor description */ + description?: (string|null); + + /** MetricDescriptor displayName */ + displayName?: (string|null); + + /** MetricDescriptor metadata */ + metadata?: (google.api.MetricDescriptor.IMetricDescriptorMetadata|null); + + /** MetricDescriptor launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** MetricDescriptor monitoredResourceTypes */ + monitoredResourceTypes?: (string[]|null); + } + + /** Represents a MetricDescriptor. */ + class MetricDescriptor implements IMetricDescriptor { + + /** + * Constructs a new MetricDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMetricDescriptor); + + /** MetricDescriptor name. */ + public name: string; + + /** MetricDescriptor type. */ + public type: string; + + /** MetricDescriptor labels. */ + public labels: google.api.ILabelDescriptor[]; + + /** MetricDescriptor metricKind. */ + public metricKind: (google.api.MetricDescriptor.MetricKind|keyof typeof google.api.MetricDescriptor.MetricKind); + + /** MetricDescriptor valueType. */ + public valueType: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType); + + /** MetricDescriptor unit. */ + public unit: string; + + /** MetricDescriptor description. */ + public description: string; + + /** MetricDescriptor displayName. */ + public displayName: string; + + /** MetricDescriptor metadata. */ + public metadata?: (google.api.MetricDescriptor.IMetricDescriptorMetadata|null); + + /** MetricDescriptor launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** MetricDescriptor monitoredResourceTypes. */ + public monitoredResourceTypes: string[]; + + /** + * Creates a new MetricDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricDescriptor instance + */ + public static create(properties?: google.api.IMetricDescriptor): google.api.MetricDescriptor; + + /** + * Encodes the specified MetricDescriptor message. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. + * @param message MetricDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMetricDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricDescriptor message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. + * @param message MetricDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMetricDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricDescriptor + * @throws {Error} If the payload is not 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.MetricDescriptor; + + /** + * Decodes a MetricDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricDescriptor + * @throws {Error} If the payload 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.MetricDescriptor; + + /** + * Verifies a MetricDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.MetricDescriptor; + + /** + * Creates a plain object from a MetricDescriptor message. Also converts values to other types if specified. + * @param message MetricDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MetricDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MetricDescriptor { + + /** Properties of a MetricDescriptorMetadata. */ + interface IMetricDescriptorMetadata { + + /** MetricDescriptorMetadata launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** MetricDescriptorMetadata samplePeriod */ + samplePeriod?: (google.protobuf.IDuration|null); + + /** MetricDescriptorMetadata ingestDelay */ + ingestDelay?: (google.protobuf.IDuration|null); + } + + /** Represents a MetricDescriptorMetadata. */ + class MetricDescriptorMetadata implements IMetricDescriptorMetadata { + + /** + * Constructs a new MetricDescriptorMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MetricDescriptor.IMetricDescriptorMetadata); + + /** MetricDescriptorMetadata launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** MetricDescriptorMetadata samplePeriod. */ + public samplePeriod?: (google.protobuf.IDuration|null); + + /** MetricDescriptorMetadata ingestDelay. */ + public ingestDelay?: (google.protobuf.IDuration|null); + + /** + * Creates a new MetricDescriptorMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricDescriptorMetadata instance + */ + public static create(properties?: google.api.MetricDescriptor.IMetricDescriptorMetadata): google.api.MetricDescriptor.MetricDescriptorMetadata; + + /** + * Encodes the specified MetricDescriptorMetadata message. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. + * @param message MetricDescriptorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MetricDescriptor.IMetricDescriptorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricDescriptorMetadata message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. + * @param message MetricDescriptorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MetricDescriptor.IMetricDescriptorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricDescriptorMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricDescriptorMetadata + * @throws {Error} If the payload is not 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.MetricDescriptor.MetricDescriptorMetadata; + + /** + * Decodes a MetricDescriptorMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricDescriptorMetadata + * @throws {Error} If the payload 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.MetricDescriptor.MetricDescriptorMetadata; + + /** + * Verifies a MetricDescriptorMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricDescriptorMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricDescriptorMetadata + */ + public static fromObject(object: { [k: string]: any }): google.api.MetricDescriptor.MetricDescriptorMetadata; + + /** + * Creates a plain object from a MetricDescriptorMetadata message. Also converts values to other types if specified. + * @param message MetricDescriptorMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MetricDescriptor.MetricDescriptorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricDescriptorMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricDescriptorMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** MetricKind enum. */ + enum MetricKind { + METRIC_KIND_UNSPECIFIED = 0, + GAUGE = 1, + DELTA = 2, + CUMULATIVE = 3 + } + + /** ValueType enum. */ + enum ValueType { + VALUE_TYPE_UNSPECIFIED = 0, + BOOL = 1, + INT64 = 2, + DOUBLE = 3, + STRING = 4, + DISTRIBUTION = 5, + MONEY = 6 + } + } + + /** Properties of a Metric. */ + interface IMetric { + + /** Metric type */ + type?: (string|null); + + /** Metric labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Metric. */ + class Metric implements IMetric { + + /** + * Constructs a new Metric. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMetric); + + /** Metric type. */ + public type: string; + + /** Metric labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new Metric instance using the specified properties. + * @param [properties] Properties to set + * @returns Metric instance + */ + public static create(properties?: google.api.IMetric): google.api.Metric; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.api.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.api.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Metric; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Metric; + + /** + * Verifies a Metric message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metric + */ + public static fromObject(object: { [k: string]: any }): google.api.Metric; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @param message Metric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Metric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** Properties of a MonitoredResourceDescriptor. */ + interface IMonitoredResourceDescriptor { + + /** MonitoredResourceDescriptor name */ + name?: (string|null); + + /** MonitoredResourceDescriptor type */ + type?: (string|null); + + /** MonitoredResourceDescriptor displayName */ + displayName?: (string|null); + + /** MonitoredResourceDescriptor description */ + description?: (string|null); + + /** MonitoredResourceDescriptor labels */ + labels?: (google.api.ILabelDescriptor[]|null); + + /** MonitoredResourceDescriptor launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + } + + /** Represents a MonitoredResourceDescriptor. */ + class MonitoredResourceDescriptor implements IMonitoredResourceDescriptor { + + /** + * Constructs a new MonitoredResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMonitoredResourceDescriptor); + + /** MonitoredResourceDescriptor name. */ + public name: string; + + /** MonitoredResourceDescriptor type. */ + public type: string; + + /** MonitoredResourceDescriptor displayName. */ + public displayName: string; + + /** MonitoredResourceDescriptor description. */ + public description: string; + + /** MonitoredResourceDescriptor labels. */ + public labels: google.api.ILabelDescriptor[]; + + /** MonitoredResourceDescriptor launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** + * Creates a new MonitoredResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns MonitoredResourceDescriptor instance + */ + public static create(properties?: google.api.IMonitoredResourceDescriptor): google.api.MonitoredResourceDescriptor; + + /** + * Encodes the specified MonitoredResourceDescriptor message. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. + * @param message MonitoredResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMonitoredResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MonitoredResourceDescriptor message, length delimited. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. + * @param message MonitoredResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMonitoredResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MonitoredResourceDescriptor + * @throws {Error} If the payload is not 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.MonitoredResourceDescriptor; + + /** + * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MonitoredResourceDescriptor + * @throws {Error} If the payload 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.MonitoredResourceDescriptor; + + /** + * Verifies a MonitoredResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MonitoredResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MonitoredResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.MonitoredResourceDescriptor; + + /** + * Creates a plain object from a MonitoredResourceDescriptor message. Also converts values to other types if specified. + * @param message MonitoredResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MonitoredResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MonitoredResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MonitoredResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MonitoredResource. */ + interface IMonitoredResource { + + /** MonitoredResource type */ + type?: (string|null); + + /** MonitoredResource labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a MonitoredResource. */ + class MonitoredResource implements IMonitoredResource { + + /** + * Constructs a new MonitoredResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMonitoredResource); + + /** MonitoredResource type. */ + public type: string; + + /** MonitoredResource labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new MonitoredResource instance using the specified properties. + * @param [properties] Properties to set + * @returns MonitoredResource instance + */ + public static create(properties?: google.api.IMonitoredResource): google.api.MonitoredResource; + + /** + * Encodes the specified MonitoredResource message. Does not implicitly {@link google.api.MonitoredResource.verify|verify} messages. + * @param message MonitoredResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMonitoredResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MonitoredResource message, length delimited. Does not implicitly {@link google.api.MonitoredResource.verify|verify} messages. + * @param message MonitoredResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMonitoredResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MonitoredResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MonitoredResource + * @throws {Error} If the payload is not 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.MonitoredResource; + + /** + * Decodes a MonitoredResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MonitoredResource + * @throws {Error} If the payload 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.MonitoredResource; + + /** + * Verifies a MonitoredResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MonitoredResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MonitoredResource + */ + public static fromObject(object: { [k: string]: any }): google.api.MonitoredResource; + + /** + * Creates a plain object from a MonitoredResource message. Also converts values to other types if specified. + * @param message MonitoredResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MonitoredResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MonitoredResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MonitoredResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MonitoredResourceMetadata. */ + interface IMonitoredResourceMetadata { + + /** MonitoredResourceMetadata systemLabels */ + systemLabels?: (google.protobuf.IStruct|null); + + /** MonitoredResourceMetadata userLabels */ + userLabels?: ({ [k: string]: string }|null); + } + + /** Represents a MonitoredResourceMetadata. */ + class MonitoredResourceMetadata implements IMonitoredResourceMetadata { + + /** + * Constructs a new MonitoredResourceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMonitoredResourceMetadata); + + /** MonitoredResourceMetadata systemLabels. */ + public systemLabels?: (google.protobuf.IStruct|null); + + /** MonitoredResourceMetadata userLabels. */ + public userLabels: { [k: string]: string }; + + /** + * Creates a new MonitoredResourceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns MonitoredResourceMetadata instance + */ + public static create(properties?: google.api.IMonitoredResourceMetadata): google.api.MonitoredResourceMetadata; + + /** + * Encodes the specified MonitoredResourceMetadata message. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. + * @param message MonitoredResourceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMonitoredResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MonitoredResourceMetadata message, length delimited. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. + * @param message MonitoredResourceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMonitoredResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MonitoredResourceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MonitoredResourceMetadata + * @throws {Error} If the payload is not 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.MonitoredResourceMetadata; + + /** + * Decodes a MonitoredResourceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MonitoredResourceMetadata + * @throws {Error} If the payload 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.MonitoredResourceMetadata; + + /** + * Verifies a MonitoredResourceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MonitoredResourceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MonitoredResourceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.api.MonitoredResourceMetadata; + + /** + * Creates a plain object from a MonitoredResourceMetadata message. Also converts values to other types if specified. + * @param message MonitoredResourceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MonitoredResourceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MonitoredResourceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MonitoredResourceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Monitoring. */ + interface IMonitoring { + + /** Monitoring producerDestinations */ + producerDestinations?: (google.api.Monitoring.IMonitoringDestination[]|null); + + /** Monitoring consumerDestinations */ + consumerDestinations?: (google.api.Monitoring.IMonitoringDestination[]|null); + } + + /** Represents a Monitoring. */ + class Monitoring implements IMonitoring { + + /** + * Constructs a new Monitoring. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMonitoring); + + /** Monitoring producerDestinations. */ + public producerDestinations: google.api.Monitoring.IMonitoringDestination[]; + + /** Monitoring consumerDestinations. */ + public consumerDestinations: google.api.Monitoring.IMonitoringDestination[]; + + /** + * Creates a new Monitoring instance using the specified properties. + * @param [properties] Properties to set + * @returns Monitoring instance + */ + public static create(properties?: google.api.IMonitoring): google.api.Monitoring; + + /** + * Encodes the specified Monitoring message. Does not implicitly {@link google.api.Monitoring.verify|verify} messages. + * @param message Monitoring message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMonitoring, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Monitoring message, length delimited. Does not implicitly {@link google.api.Monitoring.verify|verify} messages. + * @param message Monitoring message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMonitoring, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Monitoring message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Monitoring + * @throws {Error} If the payload is not 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.Monitoring; + + /** + * Decodes a Monitoring message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Monitoring + * @throws {Error} If the payload 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.Monitoring; + + /** + * Verifies a Monitoring message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Monitoring message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Monitoring + */ + public static fromObject(object: { [k: string]: any }): google.api.Monitoring; + + /** + * Creates a plain object from a Monitoring message. Also converts values to other types if specified. + * @param message Monitoring + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Monitoring, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Monitoring to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Monitoring + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Monitoring { + + /** Properties of a MonitoringDestination. */ + interface IMonitoringDestination { + + /** MonitoringDestination monitoredResource */ + monitoredResource?: (string|null); + + /** MonitoringDestination metrics */ + metrics?: (string[]|null); + } + + /** Represents a MonitoringDestination. */ + class MonitoringDestination implements IMonitoringDestination { + + /** + * Constructs a new MonitoringDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Monitoring.IMonitoringDestination); + + /** MonitoringDestination monitoredResource. */ + public monitoredResource: string; + + /** MonitoringDestination metrics. */ + public metrics: string[]; + + /** + * Creates a new MonitoringDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns MonitoringDestination instance + */ + public static create(properties?: google.api.Monitoring.IMonitoringDestination): google.api.Monitoring.MonitoringDestination; + + /** + * Encodes the specified MonitoringDestination message. Does not implicitly {@link google.api.Monitoring.MonitoringDestination.verify|verify} messages. + * @param message MonitoringDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.Monitoring.IMonitoringDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MonitoringDestination message, length delimited. Does not implicitly {@link google.api.Monitoring.MonitoringDestination.verify|verify} messages. + * @param message MonitoringDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.Monitoring.IMonitoringDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MonitoringDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MonitoringDestination + * @throws {Error} If the payload is not 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.Monitoring.MonitoringDestination; + + /** + * Decodes a MonitoringDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MonitoringDestination + * @throws {Error} If the payload 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.Monitoring.MonitoringDestination; + + /** + * Verifies a MonitoringDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MonitoringDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MonitoringDestination + */ + public static fromObject(object: { [k: string]: any }): google.api.Monitoring.MonitoringDestination; + + /** + * Creates a plain object from a MonitoringDestination message. Also converts values to other types if specified. + * @param message MonitoringDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Monitoring.MonitoringDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MonitoringDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MonitoringDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Quota. */ + interface IQuota { + + /** Quota limits */ + limits?: (google.api.IQuotaLimit[]|null); + + /** Quota metricRules */ + metricRules?: (google.api.IMetricRule[]|null); + } + + /** Represents a Quota. */ + class Quota implements IQuota { + + /** + * Constructs a new Quota. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IQuota); + + /** Quota limits. */ + public limits: google.api.IQuotaLimit[]; + + /** Quota metricRules. */ + public metricRules: google.api.IMetricRule[]; + + /** + * Creates a new Quota instance using the specified properties. + * @param [properties] Properties to set + * @returns Quota instance + */ + public static create(properties?: google.api.IQuota): google.api.Quota; + + /** + * Encodes the specified Quota message. Does not implicitly {@link google.api.Quota.verify|verify} messages. + * @param message Quota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Quota message, length delimited. Does not implicitly {@link google.api.Quota.verify|verify} messages. + * @param message Quota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Quota message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Quota + * @throws {Error} If the payload is not 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.Quota; + + /** + * Decodes a Quota message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Quota + * @throws {Error} If the payload 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.Quota; + + /** + * Verifies a Quota message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Quota message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Quota + */ + public static fromObject(object: { [k: string]: any }): google.api.Quota; + + /** + * Creates a plain object from a Quota message. Also converts values to other types if specified. + * @param message Quota + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Quota, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Quota to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Quota + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricRule. */ + interface IMetricRule { + + /** MetricRule selector */ + selector?: (string|null); + + /** MetricRule metricCosts */ + metricCosts?: ({ [k: string]: (number|Long|string) }|null); + } + + /** Represents a MetricRule. */ + class MetricRule implements IMetricRule { + + /** + * Constructs a new MetricRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMetricRule); + + /** MetricRule selector. */ + public selector: string; + + /** MetricRule metricCosts. */ + public metricCosts: { [k: string]: (number|Long|string) }; + + /** + * Creates a new MetricRule instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricRule instance + */ + public static create(properties?: google.api.IMetricRule): google.api.MetricRule; + + /** + * Encodes the specified MetricRule message. Does not implicitly {@link google.api.MetricRule.verify|verify} messages. + * @param message MetricRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMetricRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricRule message, length delimited. Does not implicitly {@link google.api.MetricRule.verify|verify} messages. + * @param message MetricRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMetricRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricRule + * @throws {Error} If the payload is not 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.MetricRule; + + /** + * Decodes a MetricRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricRule + * @throws {Error} If the payload 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.MetricRule; + + /** + * Verifies a MetricRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricRule + */ + public static fromObject(object: { [k: string]: any }): google.api.MetricRule; + + /** + * Creates a plain object from a MetricRule message. Also converts values to other types if specified. + * @param message MetricRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MetricRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QuotaLimit. */ + interface IQuotaLimit { + + /** QuotaLimit name */ + name?: (string|null); + + /** QuotaLimit description */ + description?: (string|null); + + /** QuotaLimit defaultLimit */ + defaultLimit?: (number|Long|string|null); + + /** QuotaLimit maxLimit */ + maxLimit?: (number|Long|string|null); + + /** QuotaLimit freeTier */ + freeTier?: (number|Long|string|null); + + /** QuotaLimit duration */ + duration?: (string|null); + + /** QuotaLimit metric */ + metric?: (string|null); + + /** QuotaLimit unit */ + unit?: (string|null); + + /** QuotaLimit values */ + values?: ({ [k: string]: (number|Long|string) }|null); + + /** QuotaLimit displayName */ + displayName?: (string|null); + } + + /** Represents a QuotaLimit. */ + class QuotaLimit implements IQuotaLimit { + + /** + * Constructs a new QuotaLimit. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IQuotaLimit); + + /** QuotaLimit name. */ + public name: string; + + /** QuotaLimit description. */ + public description: string; + + /** QuotaLimit defaultLimit. */ + public defaultLimit: (number|Long|string); + + /** QuotaLimit maxLimit. */ + public maxLimit: (number|Long|string); + + /** QuotaLimit freeTier. */ + public freeTier: (number|Long|string); + + /** QuotaLimit duration. */ + public duration: string; + + /** QuotaLimit metric. */ + public metric: string; + + /** QuotaLimit unit. */ + public unit: string; + + /** QuotaLimit values. */ + public values: { [k: string]: (number|Long|string) }; + + /** QuotaLimit displayName. */ + public displayName: string; + + /** + * Creates a new QuotaLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns QuotaLimit instance + */ + public static create(properties?: google.api.IQuotaLimit): google.api.QuotaLimit; + + /** + * Encodes the specified QuotaLimit message. Does not implicitly {@link google.api.QuotaLimit.verify|verify} messages. + * @param message QuotaLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IQuotaLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuotaLimit message, length delimited. Does not implicitly {@link google.api.QuotaLimit.verify|verify} messages. + * @param message QuotaLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IQuotaLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuotaLimit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuotaLimit + * @throws {Error} If the payload is not 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.QuotaLimit; + + /** + * Decodes a QuotaLimit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuotaLimit + * @throws {Error} If the payload 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.QuotaLimit; + + /** + * Verifies a QuotaLimit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuotaLimit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuotaLimit + */ + public static fromObject(object: { [k: string]: any }): google.api.QuotaLimit; + + /** + * Creates a plain object from a QuotaLimit message. Also converts values to other types if specified. + * @param message QuotaLimit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.QuotaLimit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuotaLimit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuotaLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SourceInfo. */ + interface ISourceInfo { + + /** SourceInfo sourceFiles */ + sourceFiles?: (google.protobuf.IAny[]|null); + } + + /** Represents a SourceInfo. */ + class SourceInfo implements ISourceInfo { + + /** + * Constructs a new SourceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISourceInfo); + + /** SourceInfo sourceFiles. */ + public sourceFiles: google.protobuf.IAny[]; + + /** + * Creates a new SourceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceInfo instance + */ + public static create(properties?: google.api.ISourceInfo): google.api.SourceInfo; + + /** + * Encodes the specified SourceInfo message. Does not implicitly {@link google.api.SourceInfo.verify|verify} messages. + * @param message SourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceInfo message, length delimited. Does not implicitly {@link google.api.SourceInfo.verify|verify} messages. + * @param message SourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceInfo + * @throws {Error} If the payload is not 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.SourceInfo; + + /** + * Decodes a SourceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceInfo + * @throws {Error} If the payload 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.SourceInfo; + + /** + * Verifies a SourceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.SourceInfo; + + /** + * Creates a plain object from a SourceInfo message. Also converts values to other types if specified. + * @param message SourceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SourceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SystemParameters. */ + interface ISystemParameters { + + /** SystemParameters rules */ + rules?: (google.api.ISystemParameterRule[]|null); + } + + /** Represents a SystemParameters. */ + class SystemParameters implements ISystemParameters { + + /** + * Constructs a new SystemParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISystemParameters); + + /** SystemParameters rules. */ + public rules: google.api.ISystemParameterRule[]; + + /** + * Creates a new SystemParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns SystemParameters instance + */ + public static create(properties?: google.api.ISystemParameters): google.api.SystemParameters; + + /** + * Encodes the specified SystemParameters message. Does not implicitly {@link google.api.SystemParameters.verify|verify} messages. + * @param message SystemParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISystemParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SystemParameters message, length delimited. Does not implicitly {@link google.api.SystemParameters.verify|verify} messages. + * @param message SystemParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISystemParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SystemParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SystemParameters + * @throws {Error} If the payload is not 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.SystemParameters; + + /** + * Decodes a SystemParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SystemParameters + * @throws {Error} If the payload 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.SystemParameters; + + /** + * Verifies a SystemParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SystemParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SystemParameters + */ + public static fromObject(object: { [k: string]: any }): google.api.SystemParameters; + + /** + * Creates a plain object from a SystemParameters message. Also converts values to other types if specified. + * @param message SystemParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SystemParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SystemParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SystemParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SystemParameterRule. */ + interface ISystemParameterRule { + + /** SystemParameterRule selector */ + selector?: (string|null); + + /** SystemParameterRule parameters */ + parameters?: (google.api.ISystemParameter[]|null); + } + + /** Represents a SystemParameterRule. */ + class SystemParameterRule implements ISystemParameterRule { + + /** + * Constructs a new SystemParameterRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISystemParameterRule); + + /** SystemParameterRule selector. */ + public selector: string; + + /** SystemParameterRule parameters. */ + public parameters: google.api.ISystemParameter[]; + + /** + * Creates a new SystemParameterRule instance using the specified properties. + * @param [properties] Properties to set + * @returns SystemParameterRule instance + */ + public static create(properties?: google.api.ISystemParameterRule): google.api.SystemParameterRule; + + /** + * Encodes the specified SystemParameterRule message. Does not implicitly {@link google.api.SystemParameterRule.verify|verify} messages. + * @param message SystemParameterRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISystemParameterRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SystemParameterRule message, length delimited. Does not implicitly {@link google.api.SystemParameterRule.verify|verify} messages. + * @param message SystemParameterRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISystemParameterRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SystemParameterRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SystemParameterRule + * @throws {Error} If the payload is not 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.SystemParameterRule; + + /** + * Decodes a SystemParameterRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SystemParameterRule + * @throws {Error} If the payload 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.SystemParameterRule; + + /** + * Verifies a SystemParameterRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SystemParameterRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SystemParameterRule + */ + public static fromObject(object: { [k: string]: any }): google.api.SystemParameterRule; + + /** + * Creates a plain object from a SystemParameterRule message. Also converts values to other types if specified. + * @param message SystemParameterRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SystemParameterRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SystemParameterRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SystemParameterRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SystemParameter. */ + interface ISystemParameter { + + /** SystemParameter name */ + name?: (string|null); + + /** SystemParameter httpHeader */ + httpHeader?: (string|null); + + /** SystemParameter urlQueryParameter */ + urlQueryParameter?: (string|null); + } + + /** Represents a SystemParameter. */ + class SystemParameter implements ISystemParameter { + + /** + * Constructs a new SystemParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISystemParameter); + + /** SystemParameter name. */ + public name: string; + + /** SystemParameter httpHeader. */ + public httpHeader: string; + + /** SystemParameter urlQueryParameter. */ + public urlQueryParameter: string; + + /** + * Creates a new SystemParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns SystemParameter instance + */ + public static create(properties?: google.api.ISystemParameter): google.api.SystemParameter; + + /** + * Encodes the specified SystemParameter message. Does not implicitly {@link google.api.SystemParameter.verify|verify} messages. + * @param message SystemParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISystemParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SystemParameter message, length delimited. Does not implicitly {@link google.api.SystemParameter.verify|verify} messages. + * @param message SystemParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISystemParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SystemParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SystemParameter + * @throws {Error} If the payload is not 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.SystemParameter; + + /** + * Decodes a SystemParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SystemParameter + * @throws {Error} If the payload 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.SystemParameter; + + /** + * Verifies a SystemParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SystemParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SystemParameter + */ + public static fromObject(object: { [k: string]: any }): google.api.SystemParameter; + + /** + * Creates a plain object from a SystemParameter message. Also converts values to other types if specified. + * @param message SystemParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SystemParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SystemParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SystemParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Usage. */ + interface IUsage { + + /** Usage requirements */ + requirements?: (string[]|null); + + /** Usage rules */ + rules?: (google.api.IUsageRule[]|null); + + /** Usage producerNotificationChannel */ + producerNotificationChannel?: (string|null); + } + + /** Represents a Usage. */ + class Usage implements IUsage { + + /** + * Constructs a new Usage. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IUsage); + + /** Usage requirements. */ + public requirements: string[]; + + /** Usage rules. */ + public rules: google.api.IUsageRule[]; + + /** Usage producerNotificationChannel. */ + public producerNotificationChannel: string; + + /** + * Creates a new Usage instance using the specified properties. + * @param [properties] Properties to set + * @returns Usage instance + */ + public static create(properties?: google.api.IUsage): google.api.Usage; + + /** + * Encodes the specified Usage message. Does not implicitly {@link google.api.Usage.verify|verify} messages. + * @param message Usage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Usage message, length delimited. Does not implicitly {@link google.api.Usage.verify|verify} messages. + * @param message Usage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Usage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Usage + * @throws {Error} If the payload is not 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.Usage; + + /** + * Decodes a Usage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Usage + * @throws {Error} If the payload 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.Usage; + + /** + * Verifies a Usage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Usage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Usage + */ + public static fromObject(object: { [k: string]: any }): google.api.Usage; + + /** + * Creates a plain object from a Usage message. Also converts values to other types if specified. + * @param message Usage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Usage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Usage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Usage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UsageRule. */ + interface IUsageRule { + + /** UsageRule selector */ + selector?: (string|null); + + /** UsageRule allowUnregisteredCalls */ + allowUnregisteredCalls?: (boolean|null); + + /** UsageRule skipServiceControl */ + skipServiceControl?: (boolean|null); + } + + /** Represents a UsageRule. */ + class UsageRule implements IUsageRule { + + /** + * Constructs a new UsageRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IUsageRule); + + /** UsageRule selector. */ + public selector: string; + + /** UsageRule allowUnregisteredCalls. */ + public allowUnregisteredCalls: boolean; + + /** UsageRule skipServiceControl. */ + public skipServiceControl: boolean; + + /** + * Creates a new UsageRule instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageRule instance + */ + public static create(properties?: google.api.IUsageRule): google.api.UsageRule; + + /** + * Encodes the specified UsageRule message. Does not implicitly {@link google.api.UsageRule.verify|verify} messages. + * @param message UsageRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IUsageRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageRule message, length delimited. Does not implicitly {@link google.api.UsageRule.verify|verify} messages. + * @param message UsageRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IUsageRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsageRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsageRule + * @throws {Error} If the payload is not 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.UsageRule; + + /** + * Decodes a UsageRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsageRule + * @throws {Error} If the payload 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.UsageRule; + + /** + * Verifies a UsageRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsageRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsageRule + */ + public static fromObject(object: { [k: string]: any }): google.api.UsageRule; + + /** + * Creates a plain object from a UsageRule message. Also converts values to other types if specified. + * @param message UsageRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.UsageRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsageRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UsageRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** 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); + } + + /** 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); + } + + /** 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 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 Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @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 Api. */ + interface IApi { + + /** Api name */ + name?: (string|null); + + /** Api methods */ + methods?: (google.protobuf.IMethod[]|null); + + /** Api options */ + options?: (google.protobuf.IOption[]|null); + + /** Api version */ + version?: (string|null); + + /** Api sourceContext */ + sourceContext?: (google.protobuf.ISourceContext|null); + + /** Api mixins */ + mixins?: (google.protobuf.IMixin[]|null); + + /** Api syntax */ + syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|null); + } + + /** Represents an Api. */ + class Api implements IApi { + + /** + * Constructs a new Api. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IApi); + + /** Api name. */ + public name: string; + + /** Api methods. */ + public methods: google.protobuf.IMethod[]; + + /** Api options. */ + public options: google.protobuf.IOption[]; + + /** Api version. */ + public version: string; + + /** Api sourceContext. */ + public sourceContext?: (google.protobuf.ISourceContext|null); + + /** Api mixins. */ + public mixins: google.protobuf.IMixin[]; + + /** Api syntax. */ + public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); + + /** + * Creates a new Api instance using the specified properties. + * @param [properties] Properties to set + * @returns Api instance + */ + public static create(properties?: google.protobuf.IApi): google.protobuf.Api; + + /** + * Encodes the specified Api message. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. + * @param message Api message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. + * @param message Api message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Api message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Api + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Api; + + /** + * Decodes an Api message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Api + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Api; + + /** + * Verifies an Api message. + * @param message Plain 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 Api message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Api + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Api; + + /** + * Creates a plain object from an Api message. Also converts values to other types if specified. + * @param message Api + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Api, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Api to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Api + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Method. */ + interface IMethod { + + /** Method name */ + name?: (string|null); + + /** Method requestTypeUrl */ + requestTypeUrl?: (string|null); + + /** Method requestStreaming */ + requestStreaming?: (boolean|null); + + /** Method responseTypeUrl */ + responseTypeUrl?: (string|null); + + /** Method responseStreaming */ + responseStreaming?: (boolean|null); + + /** Method options */ + options?: (google.protobuf.IOption[]|null); + + /** Method syntax */ + syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|null); + } + + /** Represents a Method. */ + class Method implements IMethod { + + /** + * Constructs a new Method. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethod); + + /** Method name. */ + public name: string; + + /** Method requestTypeUrl. */ + public requestTypeUrl: string; + + /** Method requestStreaming. */ + public requestStreaming: boolean; + + /** Method responseTypeUrl. */ + public responseTypeUrl: string; + + /** Method responseStreaming. */ + public responseStreaming: boolean; + + /** Method options. */ + public options: google.protobuf.IOption[]; + + /** Method syntax. */ + public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); + + /** + * Creates a new Method instance using the specified properties. + * @param [properties] Properties to set + * @returns Method instance + */ + public static create(properties?: google.protobuf.IMethod): google.protobuf.Method; + + /** + * Encodes the specified Method message. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. + * @param message Method message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Method message, length delimited. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. + * @param message Method message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Method message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Method + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Method; + + /** + * Decodes a Method message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Method + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Method; + + /** + * Verifies a Method message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Method message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Method + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Method; + + /** + * Creates a plain object from a Method message. Also converts values to other types if specified. + * @param message Method + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Method, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Method to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Method + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Mixin. */ + interface IMixin { + + /** Mixin name */ + name?: (string|null); + + /** Mixin root */ + root?: (string|null); + } + + /** Represents a Mixin. */ + class Mixin implements IMixin { + + /** + * Constructs a new Mixin. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMixin); + + /** Mixin name. */ + public name: string; + + /** Mixin root. */ + public root: string; + + /** + * Creates a new Mixin instance using the specified properties. + * @param [properties] Properties to set + * @returns Mixin instance + */ + public static create(properties?: google.protobuf.IMixin): google.protobuf.Mixin; + + /** + * Encodes the specified Mixin message. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. + * @param message Mixin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMixin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Mixin message, length delimited. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. + * @param message Mixin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMixin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Mixin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Mixin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Mixin; + + /** + * Decodes a Mixin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Mixin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Mixin; + + /** + * Verifies a Mixin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Mixin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Mixin + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Mixin; + + /** + * Creates a plain object from a Mixin message. Also converts values to other types if specified. + * @param message Mixin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Mixin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Mixin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Mixin + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SourceContext. */ + interface ISourceContext { + + /** SourceContext fileName */ + fileName?: (string|null); + } + + /** Represents a SourceContext. */ + class SourceContext implements ISourceContext { + + /** + * Constructs a new SourceContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceContext); + + /** SourceContext fileName. */ + public fileName: string; + + /** + * Creates a new SourceContext instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceContext instance + */ + public static create(properties?: google.protobuf.ISourceContext): google.protobuf.SourceContext; + + /** + * Encodes the specified SourceContext message. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. + * @param message SourceContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceContext message, length delimited. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. + * @param message SourceContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceContext; + + /** + * Decodes a SourceContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceContext; + + /** + * Verifies a SourceContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceContext + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceContext; + + /** + * Creates a plain object from a SourceContext message. Also converts values to other types if specified. + * @param message SourceContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Type. */ + interface IType { + + /** Type name */ + name?: (string|null); + + /** Type fields */ + fields?: (google.protobuf.IField[]|null); + + /** Type oneofs */ + oneofs?: (string[]|null); + + /** Type options */ + options?: (google.protobuf.IOption[]|null); + + /** Type sourceContext */ + sourceContext?: (google.protobuf.ISourceContext|null); + + /** Type syntax */ + syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|null); + } + + /** Represents a Type. */ + class Type implements IType { + + /** + * Constructs a new Type. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IType); + + /** Type name. */ + public name: string; + + /** Type fields. */ + public fields: google.protobuf.IField[]; + + /** Type oneofs. */ + public oneofs: string[]; + + /** Type options. */ + public options: google.protobuf.IOption[]; + + /** Type sourceContext. */ + public sourceContext?: (google.protobuf.ISourceContext|null); + + /** Type syntax. */ + public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); + + /** + * Creates a new Type instance using the specified properties. + * @param [properties] Properties to set + * @returns Type instance + */ + public static create(properties?: google.protobuf.IType): google.protobuf.Type; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Type message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Type; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Type; + + /** + * Verifies a Type message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Type + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Type; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @param message Type + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Type, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Type to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Type + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Field. */ + interface IField { + + /** Field kind */ + kind?: (google.protobuf.Field.Kind|keyof typeof google.protobuf.Field.Kind|null); + + /** Field cardinality */ + cardinality?: (google.protobuf.Field.Cardinality|keyof typeof google.protobuf.Field.Cardinality|null); + + /** Field number */ + number?: (number|null); + + /** Field name */ + name?: (string|null); + + /** Field typeUrl */ + typeUrl?: (string|null); + + /** Field oneofIndex */ + oneofIndex?: (number|null); + + /** Field packed */ + packed?: (boolean|null); + + /** Field options */ + options?: (google.protobuf.IOption[]|null); + + /** Field jsonName */ + jsonName?: (string|null); + + /** Field defaultValue */ + defaultValue?: (string|null); + } + + /** Represents a Field. */ + class Field implements IField { + + /** + * Constructs a new Field. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IField); + + /** Field kind. */ + public kind: (google.protobuf.Field.Kind|keyof typeof google.protobuf.Field.Kind); + + /** Field cardinality. */ + public cardinality: (google.protobuf.Field.Cardinality|keyof typeof google.protobuf.Field.Cardinality); + + /** Field number. */ + public number: number; + + /** Field name. */ + public name: string; + + /** Field typeUrl. */ + public typeUrl: string; + + /** Field oneofIndex. */ + public oneofIndex: number; + + /** Field packed. */ + public packed: boolean; + + /** Field options. */ + public options: google.protobuf.IOption[]; + + /** Field jsonName. */ + public jsonName: string; + + /** Field defaultValue. */ + public defaultValue: string; + + /** + * Creates a new Field instance using the specified properties. + * @param [properties] Properties to set + * @returns Field instance + */ + public static create(properties?: google.protobuf.IField): google.protobuf.Field; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Field message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Field; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Field; + + /** + * Verifies a Field message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Field + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Field; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @param message Field + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Field to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Field + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Field { + + /** Kind enum. */ + enum Kind { + TYPE_UNKNOWN = 0, + 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 + } + + /** Cardinality enum. */ + enum Cardinality { + CARDINALITY_UNKNOWN = 0, + CARDINALITY_OPTIONAL = 1, + CARDINALITY_REQUIRED = 2, + CARDINALITY_REPEATED = 3 + } + } + + /** Properties of an Enum. */ + interface IEnum { + + /** Enum name */ + name?: (string|null); + + /** Enum enumvalue */ + enumvalue?: (google.protobuf.IEnumValue[]|null); + + /** Enum options */ + options?: (google.protobuf.IOption[]|null); + + /** Enum sourceContext */ + sourceContext?: (google.protobuf.ISourceContext|null); + + /** Enum syntax */ + syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|null); + } + + /** Represents an Enum. */ + class Enum implements IEnum { + + /** + * Constructs a new Enum. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnum); + + /** Enum name. */ + public name: string; + + /** Enum enumvalue. */ + public enumvalue: google.protobuf.IEnumValue[]; + + /** Enum options. */ + public options: google.protobuf.IOption[]; + + /** Enum sourceContext. */ + public sourceContext?: (google.protobuf.ISourceContext|null); + + /** Enum syntax. */ + public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); + + /** + * Creates a new Enum instance using the specified properties. + * @param [properties] Properties to set + * @returns Enum instance + */ + public static create(properties?: google.protobuf.IEnum): google.protobuf.Enum; + + /** + * Encodes the specified Enum message. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. + * @param message Enum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. + * @param message Enum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Enum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Enum; + + /** + * Decodes an Enum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Enum; + + /** + * Verifies an Enum message. + * @param message Plain 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 Enum message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Enum + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Enum; + + /** + * Creates a plain object from an Enum message. Also converts values to other types if specified. + * @param message Enum + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Enum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Enum to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Enum + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValue. */ + interface IEnumValue { + + /** EnumValue name */ + name?: (string|null); + + /** EnumValue number */ + number?: (number|null); + + /** EnumValue options */ + options?: (google.protobuf.IOption[]|null); + } + + /** Represents an EnumValue. */ + class EnumValue implements IEnumValue { + + /** + * Constructs a new EnumValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValue); + + /** EnumValue name. */ + public name: string; + + /** EnumValue number. */ + public number: number; + + /** EnumValue options. */ + public options: google.protobuf.IOption[]; + + /** + * Creates a new EnumValue instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValue instance + */ + public static create(properties?: google.protobuf.IEnumValue): google.protobuf.EnumValue; + + /** + * Encodes the specified EnumValue message. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. + * @param message EnumValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. + * @param message EnumValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValue; + + /** + * Decodes an EnumValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValue; + + /** + * Verifies an EnumValue message. + * @param message Plain 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 EnumValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValue; + + /** + * Creates a plain object from an EnumValue message. Also converts values to other types if specified. + * @param message EnumValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Option. */ + interface IOption { + + /** Option name */ + name?: (string|null); + + /** Option value */ + value?: (google.protobuf.IAny|null); + } + + /** Represents an Option. */ + class Option implements IOption { + + /** + * Constructs a new Option. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOption); + + /** Option name. */ + public name: string; + + /** Option value. */ + public value?: (google.protobuf.IAny|null); + + /** + * Creates a new Option instance using the specified properties. + * @param [properties] Properties to set + * @returns Option instance + */ + public static create(properties?: google.protobuf.IOption): google.protobuf.Option; + + /** + * Encodes the specified Option message. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. + * @param message Option message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Option message, length delimited. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. + * @param message Option message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Option message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Option + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Option; + + /** + * Decodes an Option message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Option + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Option; + + /** + * Verifies an Option message. + * @param message Plain 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 Option message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Option + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Option; + + /** + * Creates a plain object from an Option message. Also converts values to other types if specified. + * @param message Option + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Option, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Option to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Option + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Syntax enum. */ + enum Syntax { + SYNTAX_PROTO2 = 0, + SYNTAX_PROTO3 = 1 + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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; + } + } + + /** 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-api-servicemanagement/protos/protos.js b/packages/google-api-servicemanagement/protos/protos.js new file mode 100644 index 00000000000..dedc7ddd352 --- /dev/null +++ b/packages/google-api-servicemanagement/protos/protos.js @@ -0,0 +1,40146 @@ +// 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_service_management_protos || ($protobuf.roots._google_cloud_service_management_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.servicemanagement = (function() { + + /** + * Namespace servicemanagement. + * @memberof google.api + * @namespace + */ + var servicemanagement = {}; + + servicemanagement.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.api.servicemanagement + * @namespace + */ + var v1 = {}; + + v1.ManagedService = (function() { + + /** + * Properties of a ManagedService. + * @memberof google.api.servicemanagement.v1 + * @interface IManagedService + * @property {string|null} [serviceName] ManagedService serviceName + * @property {string|null} [producerProjectId] ManagedService producerProjectId + */ + + /** + * Constructs a new ManagedService. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ManagedService. + * @implements IManagedService + * @constructor + * @param {google.api.servicemanagement.v1.IManagedService=} [properties] Properties to set + */ + function ManagedService(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagedService serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.ManagedService + * @instance + */ + ManagedService.prototype.serviceName = ""; + + /** + * ManagedService producerProjectId. + * @member {string} producerProjectId + * @memberof google.api.servicemanagement.v1.ManagedService + * @instance + */ + ManagedService.prototype.producerProjectId = ""; + + /** + * Creates a new ManagedService instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.ManagedService + * @static + * @param {google.api.servicemanagement.v1.IManagedService=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.ManagedService} ManagedService instance + */ + ManagedService.create = function create(properties) { + return new ManagedService(properties); + }; + + /** + * Encodes the specified ManagedService message. Does not implicitly {@link google.api.servicemanagement.v1.ManagedService.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.ManagedService + * @static + * @param {google.api.servicemanagement.v1.IManagedService} message ManagedService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceName); + if (message.producerProjectId != null && Object.hasOwnProperty.call(message, "producerProjectId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.producerProjectId); + return writer; + }; + + /** + * Encodes the specified ManagedService message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ManagedService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.ManagedService + * @static + * @param {google.api.servicemanagement.v1.IManagedService} message ManagedService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagedService message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.ManagedService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.ManagedService} ManagedService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedService.decode = function 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.servicemanagement.v1.ManagedService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.serviceName = reader.string(); + break; + } + case 3: { + message.producerProjectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagedService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.ManagedService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.ManagedService} ManagedService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagedService message. + * @function verify + * @memberof google.api.servicemanagement.v1.ManagedService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagedService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.producerProjectId != null && message.hasOwnProperty("producerProjectId")) + if (!$util.isString(message.producerProjectId)) + return "producerProjectId: string expected"; + return null; + }; + + /** + * Creates a ManagedService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.ManagedService + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.ManagedService} ManagedService + */ + ManagedService.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.ManagedService) + return object; + var message = new $root.google.api.servicemanagement.v1.ManagedService(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.producerProjectId != null) + message.producerProjectId = String(object.producerProjectId); + return message; + }; + + /** + * Creates a plain object from a ManagedService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.ManagedService + * @static + * @param {google.api.servicemanagement.v1.ManagedService} message ManagedService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagedService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.producerProjectId = ""; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.producerProjectId != null && message.hasOwnProperty("producerProjectId")) + object.producerProjectId = message.producerProjectId; + return object; + }; + + /** + * Converts this ManagedService to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.ManagedService + * @instance + * @returns {Object.} JSON object + */ + ManagedService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ManagedService + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.ManagedService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ManagedService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.ManagedService"; + }; + + return ManagedService; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.api.servicemanagement.v1 + * @interface IOperationMetadata + * @property {Array.|null} [resourceNames] OperationMetadata resourceNames + * @property {Array.|null} [steps] OperationMetadata steps + * @property {number|null} [progressPercentage] OperationMetadata progressPercentage + * @property {google.protobuf.ITimestamp|null} [startTime] OperationMetadata startTime + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.api.servicemanagement.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + this.resourceNames = []; + this.steps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata resourceNames. + * @member {Array.} resourceNames + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.resourceNames = $util.emptyArray; + + /** + * OperationMetadata steps. + * @member {Array.} steps + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.steps = $util.emptyArray; + + /** + * OperationMetadata progressPercentage. + * @member {number} progressPercentage + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.progressPercentage = 0; + + /** + * OperationMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.startTime = null; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @static + * @param {google.api.servicemanagement.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.api.servicemanagement.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @static + * @param {google.api.servicemanagement.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceNames != null && message.resourceNames.length) + for (var i = 0; i < message.resourceNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceNames[i]); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.api.servicemanagement.v1.OperationMetadata.Step.encode(message.steps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.progressPercentage != null && Object.hasOwnProperty.call(message, "progressPercentage")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.progressPercentage); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @static + * @param {google.api.servicemanagement.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.servicemanagement.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resourceNames && message.resourceNames.length)) + message.resourceNames = []; + message.resourceNames.push(reader.string()); + break; + } + case 2: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.api.servicemanagement.v1.OperationMetadata.Step.decode(reader, reader.uint32())); + break; + } + case 3: { + message.progressPercentage = reader.int32(); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceNames != null && message.hasOwnProperty("resourceNames")) { + if (!Array.isArray(message.resourceNames)) + return "resourceNames: array expected"; + for (var i = 0; i < message.resourceNames.length; ++i) + if (!$util.isString(message.resourceNames[i])) + return "resourceNames: string[] expected"; + } + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.api.servicemanagement.v1.OperationMetadata.Step.verify(message.steps[i]); + if (error) + return "steps." + error; + } + } + if (message.progressPercentage != null && message.hasOwnProperty("progressPercentage")) + if (!$util.isInteger(message.progressPercentage)) + return "progressPercentage: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.OperationMetadata) + return object; + var message = new $root.google.api.servicemanagement.v1.OperationMetadata(); + if (object.resourceNames) { + if (!Array.isArray(object.resourceNames)) + throw TypeError(".google.api.servicemanagement.v1.OperationMetadata.resourceNames: array expected"); + message.resourceNames = []; + for (var i = 0; i < object.resourceNames.length; ++i) + message.resourceNames[i] = String(object.resourceNames[i]); + } + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.api.servicemanagement.v1.OperationMetadata.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.api.servicemanagement.v1.OperationMetadata.steps: object expected"); + message.steps[i] = $root.google.api.servicemanagement.v1.OperationMetadata.Step.fromObject(object.steps[i]); + } + } + if (object.progressPercentage != null) + message.progressPercentage = object.progressPercentage | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.api.servicemanagement.v1.OperationMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @static + * @param {google.api.servicemanagement.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resourceNames = []; + object.steps = []; + } + if (options.defaults) { + object.progressPercentage = 0; + object.startTime = null; + } + if (message.resourceNames && message.resourceNames.length) { + object.resourceNames = []; + for (var j = 0; j < message.resourceNames.length; ++j) + object.resourceNames[j] = message.resourceNames[j]; + } + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.api.servicemanagement.v1.OperationMetadata.Step.toObject(message.steps[j], options); + } + if (message.progressPercentage != null && message.hasOwnProperty("progressPercentage")) + object.progressPercentage = message.progressPercentage; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.OperationMetadata"; + }; + + OperationMetadata.Step = (function() { + + /** + * Properties of a Step. + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @interface IStep + * @property {string|null} [description] Step description + * @property {google.api.servicemanagement.v1.OperationMetadata.Status|null} [status] Step status + */ + + /** + * Constructs a new Step. + * @memberof google.api.servicemanagement.v1.OperationMetadata + * @classdesc Represents a Step. + * @implements IStep + * @constructor + * @param {google.api.servicemanagement.v1.OperationMetadata.IStep=} [properties] Properties to set + */ + function Step(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Step description. + * @member {string} description + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @instance + */ + Step.prototype.description = ""; + + /** + * Step status. + * @member {google.api.servicemanagement.v1.OperationMetadata.Status} status + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @instance + */ + Step.prototype.status = 0; + + /** + * Creates a new Step instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @static + * @param {google.api.servicemanagement.v1.OperationMetadata.IStep=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.OperationMetadata.Step} Step instance + */ + Step.create = function create(properties) { + return new Step(properties); + }; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.api.servicemanagement.v1.OperationMetadata.Step.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @static + * @param {google.api.servicemanagement.v1.OperationMetadata.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + return writer; + }; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.OperationMetadata.Step.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @static + * @param {google.api.servicemanagement.v1.OperationMetadata.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Step message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.OperationMetadata.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decode = function 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.servicemanagement.v1.OperationMetadata.Step(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.description = reader.string(); + break; + } + case 4: { + message.status = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.OperationMetadata.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Step message. + * @function verify + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Step.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a Step message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.OperationMetadata.Step} Step + */ + Step.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.OperationMetadata.Step) + return object; + var message = new $root.google.api.servicemanagement.v1.OperationMetadata.Step(); + if (object.description != null) + message.description = String(object.description); + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "DONE": + case 1: + message.status = 1; + break; + case "NOT_STARTED": + case 2: + message.status = 2; + break; + case "IN_PROGRESS": + case 3: + message.status = 3; + break; + case "FAILED": + case 4: + message.status = 4; + break; + case "CANCELLED": + case 5: + message.status = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @static + * @param {google.api.servicemanagement.v1.OperationMetadata.Step} message Step + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Step.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.api.servicemanagement.v1.OperationMetadata.Status[message.status] === undefined ? message.status : $root.google.api.servicemanagement.v1.OperationMetadata.Status[message.status] : message.status; + return object; + }; + + /** + * Converts this Step to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @instance + * @returns {Object.} JSON object + */ + Step.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Step + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.OperationMetadata.Step + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Step.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.OperationMetadata.Step"; + }; + + return Step; + })(); + + /** + * Status enum. + * @name google.api.servicemanagement.v1.OperationMetadata.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} DONE=1 DONE value + * @property {number} NOT_STARTED=2 NOT_STARTED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + * @property {number} FAILED=4 FAILED value + * @property {number} CANCELLED=5 CANCELLED value + */ + OperationMetadata.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "DONE"] = 1; + values[valuesById[2] = "NOT_STARTED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return OperationMetadata; + })(); + + v1.Diagnostic = (function() { + + /** + * Properties of a Diagnostic. + * @memberof google.api.servicemanagement.v1 + * @interface IDiagnostic + * @property {string|null} [location] Diagnostic location + * @property {google.api.servicemanagement.v1.Diagnostic.Kind|null} [kind] Diagnostic kind + * @property {string|null} [message] Diagnostic message + */ + + /** + * Constructs a new Diagnostic. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a Diagnostic. + * @implements IDiagnostic + * @constructor + * @param {google.api.servicemanagement.v1.IDiagnostic=} [properties] Properties to set + */ + function Diagnostic(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Diagnostic location. + * @member {string} location + * @memberof google.api.servicemanagement.v1.Diagnostic + * @instance + */ + Diagnostic.prototype.location = ""; + + /** + * Diagnostic kind. + * @member {google.api.servicemanagement.v1.Diagnostic.Kind} kind + * @memberof google.api.servicemanagement.v1.Diagnostic + * @instance + */ + Diagnostic.prototype.kind = 0; + + /** + * Diagnostic message. + * @member {string} message + * @memberof google.api.servicemanagement.v1.Diagnostic + * @instance + */ + Diagnostic.prototype.message = ""; + + /** + * Creates a new Diagnostic instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.Diagnostic + * @static + * @param {google.api.servicemanagement.v1.IDiagnostic=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.Diagnostic} Diagnostic instance + */ + Diagnostic.create = function create(properties) { + return new Diagnostic(properties); + }; + + /** + * Encodes the specified Diagnostic message. Does not implicitly {@link google.api.servicemanagement.v1.Diagnostic.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.Diagnostic + * @static + * @param {google.api.servicemanagement.v1.IDiagnostic} message Diagnostic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Diagnostic.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.kind); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); + return writer; + }; + + /** + * Encodes the specified Diagnostic message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.Diagnostic.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.Diagnostic + * @static + * @param {google.api.servicemanagement.v1.IDiagnostic} message Diagnostic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Diagnostic.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Diagnostic message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.Diagnostic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.Diagnostic} Diagnostic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Diagnostic.decode = function 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.servicemanagement.v1.Diagnostic(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.kind = reader.int32(); + break; + } + case 3: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Diagnostic message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.Diagnostic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.Diagnostic} Diagnostic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Diagnostic.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Diagnostic message. + * @function verify + * @memberof google.api.servicemanagement.v1.Diagnostic + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Diagnostic.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a Diagnostic message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.Diagnostic + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.Diagnostic} Diagnostic + */ + Diagnostic.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.Diagnostic) + return object; + var message = new $root.google.api.servicemanagement.v1.Diagnostic(); + if (object.location != null) + message.location = String(object.location); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "WARNING": + case 0: + message.kind = 0; + break; + case "ERROR": + case 1: + message.kind = 1; + break; + } + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a Diagnostic message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.Diagnostic + * @static + * @param {google.api.servicemanagement.v1.Diagnostic} message Diagnostic + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Diagnostic.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.kind = options.enums === String ? "WARNING" : 0; + object.message = ""; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.api.servicemanagement.v1.Diagnostic.Kind[message.kind] === undefined ? message.kind : $root.google.api.servicemanagement.v1.Diagnostic.Kind[message.kind] : message.kind; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this Diagnostic to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.Diagnostic + * @instance + * @returns {Object.} JSON object + */ + Diagnostic.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Diagnostic + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.Diagnostic + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Diagnostic.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.Diagnostic"; + }; + + /** + * Kind enum. + * @name google.api.servicemanagement.v1.Diagnostic.Kind + * @enum {number} + * @property {number} WARNING=0 WARNING value + * @property {number} ERROR=1 ERROR value + */ + Diagnostic.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WARNING"] = 0; + values[valuesById[1] = "ERROR"] = 1; + return values; + })(); + + return Diagnostic; + })(); + + v1.ConfigSource = (function() { + + /** + * Properties of a ConfigSource. + * @memberof google.api.servicemanagement.v1 + * @interface IConfigSource + * @property {string|null} [id] ConfigSource id + * @property {Array.|null} [files] ConfigSource files + */ + + /** + * Constructs a new ConfigSource. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ConfigSource. + * @implements IConfigSource + * @constructor + * @param {google.api.servicemanagement.v1.IConfigSource=} [properties] Properties to set + */ + function ConfigSource(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]]; + } + + /** + * ConfigSource id. + * @member {string} id + * @memberof google.api.servicemanagement.v1.ConfigSource + * @instance + */ + ConfigSource.prototype.id = ""; + + /** + * ConfigSource files. + * @member {Array.} files + * @memberof google.api.servicemanagement.v1.ConfigSource + * @instance + */ + ConfigSource.prototype.files = $util.emptyArray; + + /** + * Creates a new ConfigSource instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.ConfigSource + * @static + * @param {google.api.servicemanagement.v1.IConfigSource=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.ConfigSource} ConfigSource instance + */ + ConfigSource.create = function create(properties) { + return new ConfigSource(properties); + }; + + /** + * Encodes the specified ConfigSource message. Does not implicitly {@link google.api.servicemanagement.v1.ConfigSource.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.ConfigSource + * @static + * @param {google.api.servicemanagement.v1.IConfigSource} message ConfigSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.files != null && message.files.length) + for (var i = 0; i < message.files.length; ++i) + $root.google.api.servicemanagement.v1.ConfigFile.encode(message.files[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.id); + return writer; + }; + + /** + * Encodes the specified ConfigSource message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ConfigSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.ConfigSource + * @static + * @param {google.api.servicemanagement.v1.IConfigSource} message ConfigSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfigSource message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.ConfigSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.ConfigSource} ConfigSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigSource.decode = function 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.servicemanagement.v1.ConfigSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.id = reader.string(); + break; + } + case 2: { + if (!(message.files && message.files.length)) + message.files = []; + message.files.push($root.google.api.servicemanagement.v1.ConfigFile.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfigSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.ConfigSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.ConfigSource} ConfigSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfigSource message. + * @function verify + * @memberof google.api.servicemanagement.v1.ConfigSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfigSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.files != null && message.hasOwnProperty("files")) { + if (!Array.isArray(message.files)) + return "files: array expected"; + for (var i = 0; i < message.files.length; ++i) { + var error = $root.google.api.servicemanagement.v1.ConfigFile.verify(message.files[i]); + if (error) + return "files." + error; + } + } + return null; + }; + + /** + * Creates a ConfigSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.ConfigSource + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.ConfigSource} ConfigSource + */ + ConfigSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.ConfigSource) + return object; + var message = new $root.google.api.servicemanagement.v1.ConfigSource(); + if (object.id != null) + message.id = String(object.id); + if (object.files) { + if (!Array.isArray(object.files)) + throw TypeError(".google.api.servicemanagement.v1.ConfigSource.files: array expected"); + message.files = []; + for (var i = 0; i < object.files.length; ++i) { + if (typeof object.files[i] !== "object") + throw TypeError(".google.api.servicemanagement.v1.ConfigSource.files: object expected"); + message.files[i] = $root.google.api.servicemanagement.v1.ConfigFile.fromObject(object.files[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConfigSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.ConfigSource + * @static + * @param {google.api.servicemanagement.v1.ConfigSource} message ConfigSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfigSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.files = []; + if (options.defaults) + object.id = ""; + if (message.files && message.files.length) { + object.files = []; + for (var j = 0; j < message.files.length; ++j) + object.files[j] = $root.google.api.servicemanagement.v1.ConfigFile.toObject(message.files[j], options); + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this ConfigSource to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.ConfigSource + * @instance + * @returns {Object.} JSON object + */ + ConfigSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfigSource + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.ConfigSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfigSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.ConfigSource"; + }; + + return ConfigSource; + })(); + + v1.ConfigFile = (function() { + + /** + * Properties of a ConfigFile. + * @memberof google.api.servicemanagement.v1 + * @interface IConfigFile + * @property {string|null} [filePath] ConfigFile filePath + * @property {Uint8Array|null} [fileContents] ConfigFile fileContents + * @property {google.api.servicemanagement.v1.ConfigFile.FileType|null} [fileType] ConfigFile fileType + */ + + /** + * Constructs a new ConfigFile. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ConfigFile. + * @implements IConfigFile + * @constructor + * @param {google.api.servicemanagement.v1.IConfigFile=} [properties] Properties to set + */ + function ConfigFile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfigFile filePath. + * @member {string} filePath + * @memberof google.api.servicemanagement.v1.ConfigFile + * @instance + */ + ConfigFile.prototype.filePath = ""; + + /** + * ConfigFile fileContents. + * @member {Uint8Array} fileContents + * @memberof google.api.servicemanagement.v1.ConfigFile + * @instance + */ + ConfigFile.prototype.fileContents = $util.newBuffer([]); + + /** + * ConfigFile fileType. + * @member {google.api.servicemanagement.v1.ConfigFile.FileType} fileType + * @memberof google.api.servicemanagement.v1.ConfigFile + * @instance + */ + ConfigFile.prototype.fileType = 0; + + /** + * Creates a new ConfigFile instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.ConfigFile + * @static + * @param {google.api.servicemanagement.v1.IConfigFile=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.ConfigFile} ConfigFile instance + */ + ConfigFile.create = function create(properties) { + return new ConfigFile(properties); + }; + + /** + * Encodes the specified ConfigFile message. Does not implicitly {@link google.api.servicemanagement.v1.ConfigFile.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.ConfigFile + * @static + * @param {google.api.servicemanagement.v1.IConfigFile} message ConfigFile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigFile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filePath != null && Object.hasOwnProperty.call(message, "filePath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filePath); + if (message.fileContents != null && Object.hasOwnProperty.call(message, "fileContents")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileContents); + if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.fileType); + return writer; + }; + + /** + * Encodes the specified ConfigFile message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ConfigFile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.ConfigFile + * @static + * @param {google.api.servicemanagement.v1.IConfigFile} message ConfigFile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigFile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfigFile message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.ConfigFile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.ConfigFile} ConfigFile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigFile.decode = function 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.servicemanagement.v1.ConfigFile(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filePath = reader.string(); + break; + } + case 3: { + message.fileContents = reader.bytes(); + break; + } + case 4: { + message.fileType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfigFile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.ConfigFile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.ConfigFile} ConfigFile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigFile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfigFile message. + * @function verify + * @memberof google.api.servicemanagement.v1.ConfigFile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfigFile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filePath != null && message.hasOwnProperty("filePath")) + if (!$util.isString(message.filePath)) + return "filePath: string expected"; + if (message.fileContents != null && message.hasOwnProperty("fileContents")) + if (!(message.fileContents && typeof message.fileContents.length === "number" || $util.isString(message.fileContents))) + return "fileContents: buffer expected"; + if (message.fileType != null && message.hasOwnProperty("fileType")) + switch (message.fileType) { + default: + return "fileType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 6: + break; + } + return null; + }; + + /** + * Creates a ConfigFile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.ConfigFile + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.ConfigFile} ConfigFile + */ + ConfigFile.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.ConfigFile) + return object; + var message = new $root.google.api.servicemanagement.v1.ConfigFile(); + if (object.filePath != null) + message.filePath = String(object.filePath); + if (object.fileContents != null) + if (typeof object.fileContents === "string") + $util.base64.decode(object.fileContents, message.fileContents = $util.newBuffer($util.base64.length(object.fileContents)), 0); + else if (object.fileContents.length >= 0) + message.fileContents = object.fileContents; + switch (object.fileType) { + default: + if (typeof object.fileType === "number") { + message.fileType = object.fileType; + break; + } + break; + case "FILE_TYPE_UNSPECIFIED": + case 0: + message.fileType = 0; + break; + case "SERVICE_CONFIG_YAML": + case 1: + message.fileType = 1; + break; + case "OPEN_API_JSON": + case 2: + message.fileType = 2; + break; + case "OPEN_API_YAML": + case 3: + message.fileType = 3; + break; + case "FILE_DESCRIPTOR_SET_PROTO": + case 4: + message.fileType = 4; + break; + case "PROTO_FILE": + case 6: + message.fileType = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a ConfigFile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.ConfigFile + * @static + * @param {google.api.servicemanagement.v1.ConfigFile} message ConfigFile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfigFile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filePath = ""; + if (options.bytes === String) + object.fileContents = ""; + else { + object.fileContents = []; + if (options.bytes !== Array) + object.fileContents = $util.newBuffer(object.fileContents); + } + object.fileType = options.enums === String ? "FILE_TYPE_UNSPECIFIED" : 0; + } + if (message.filePath != null && message.hasOwnProperty("filePath")) + object.filePath = message.filePath; + if (message.fileContents != null && message.hasOwnProperty("fileContents")) + object.fileContents = options.bytes === String ? $util.base64.encode(message.fileContents, 0, message.fileContents.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileContents) : message.fileContents; + if (message.fileType != null && message.hasOwnProperty("fileType")) + object.fileType = options.enums === String ? $root.google.api.servicemanagement.v1.ConfigFile.FileType[message.fileType] === undefined ? message.fileType : $root.google.api.servicemanagement.v1.ConfigFile.FileType[message.fileType] : message.fileType; + return object; + }; + + /** + * Converts this ConfigFile to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.ConfigFile + * @instance + * @returns {Object.} JSON object + */ + ConfigFile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfigFile + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.ConfigFile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfigFile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.ConfigFile"; + }; + + /** + * FileType enum. + * @name google.api.servicemanagement.v1.ConfigFile.FileType + * @enum {number} + * @property {number} FILE_TYPE_UNSPECIFIED=0 FILE_TYPE_UNSPECIFIED value + * @property {number} SERVICE_CONFIG_YAML=1 SERVICE_CONFIG_YAML value + * @property {number} OPEN_API_JSON=2 OPEN_API_JSON value + * @property {number} OPEN_API_YAML=3 OPEN_API_YAML value + * @property {number} FILE_DESCRIPTOR_SET_PROTO=4 FILE_DESCRIPTOR_SET_PROTO value + * @property {number} PROTO_FILE=6 PROTO_FILE value + */ + ConfigFile.FileType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVICE_CONFIG_YAML"] = 1; + values[valuesById[2] = "OPEN_API_JSON"] = 2; + values[valuesById[3] = "OPEN_API_YAML"] = 3; + values[valuesById[4] = "FILE_DESCRIPTOR_SET_PROTO"] = 4; + values[valuesById[6] = "PROTO_FILE"] = 6; + return values; + })(); + + return ConfigFile; + })(); + + v1.ConfigRef = (function() { + + /** + * Properties of a ConfigRef. + * @memberof google.api.servicemanagement.v1 + * @interface IConfigRef + * @property {string|null} [name] ConfigRef name + */ + + /** + * Constructs a new ConfigRef. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ConfigRef. + * @implements IConfigRef + * @constructor + * @param {google.api.servicemanagement.v1.IConfigRef=} [properties] Properties to set + */ + function ConfigRef(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfigRef name. + * @member {string} name + * @memberof google.api.servicemanagement.v1.ConfigRef + * @instance + */ + ConfigRef.prototype.name = ""; + + /** + * Creates a new ConfigRef instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.ConfigRef + * @static + * @param {google.api.servicemanagement.v1.IConfigRef=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.ConfigRef} ConfigRef instance + */ + ConfigRef.create = function create(properties) { + return new ConfigRef(properties); + }; + + /** + * Encodes the specified ConfigRef message. Does not implicitly {@link google.api.servicemanagement.v1.ConfigRef.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.ConfigRef + * @static + * @param {google.api.servicemanagement.v1.IConfigRef} message ConfigRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigRef.encode = function encode(message, writer) { + 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 ConfigRef message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ConfigRef.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.ConfigRef + * @static + * @param {google.api.servicemanagement.v1.IConfigRef} message ConfigRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfigRef message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.ConfigRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.ConfigRef} ConfigRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigRef.decode = function 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.servicemanagement.v1.ConfigRef(); + 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 ConfigRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.ConfigRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.ConfigRef} ConfigRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfigRef message. + * @function verify + * @memberof google.api.servicemanagement.v1.ConfigRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfigRef.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 ConfigRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.ConfigRef + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.ConfigRef} ConfigRef + */ + ConfigRef.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.ConfigRef) + return object; + var message = new $root.google.api.servicemanagement.v1.ConfigRef(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ConfigRef message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.ConfigRef + * @static + * @param {google.api.servicemanagement.v1.ConfigRef} message ConfigRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfigRef.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 ConfigRef to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.ConfigRef + * @instance + * @returns {Object.} JSON object + */ + ConfigRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfigRef + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.ConfigRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfigRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.ConfigRef"; + }; + + return ConfigRef; + })(); + + v1.ChangeReport = (function() { + + /** + * Properties of a ChangeReport. + * @memberof google.api.servicemanagement.v1 + * @interface IChangeReport + * @property {Array.|null} [configChanges] ChangeReport configChanges + */ + + /** + * Constructs a new ChangeReport. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ChangeReport. + * @implements IChangeReport + * @constructor + * @param {google.api.servicemanagement.v1.IChangeReport=} [properties] Properties to set + */ + function ChangeReport(properties) { + this.configChanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChangeReport configChanges. + * @member {Array.} configChanges + * @memberof google.api.servicemanagement.v1.ChangeReport + * @instance + */ + ChangeReport.prototype.configChanges = $util.emptyArray; + + /** + * Creates a new ChangeReport instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.ChangeReport + * @static + * @param {google.api.servicemanagement.v1.IChangeReport=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.ChangeReport} ChangeReport instance + */ + ChangeReport.create = function create(properties) { + return new ChangeReport(properties); + }; + + /** + * Encodes the specified ChangeReport message. Does not implicitly {@link google.api.servicemanagement.v1.ChangeReport.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.ChangeReport + * @static + * @param {google.api.servicemanagement.v1.IChangeReport} message ChangeReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeReport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.configChanges != null && message.configChanges.length) + for (var i = 0; i < message.configChanges.length; ++i) + $root.google.api.ConfigChange.encode(message.configChanges[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChangeReport message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ChangeReport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.ChangeReport + * @static + * @param {google.api.servicemanagement.v1.IChangeReport} message ChangeReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeReport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChangeReport message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.ChangeReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.ChangeReport} ChangeReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeReport.decode = function 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.servicemanagement.v1.ChangeReport(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.configChanges && message.configChanges.length)) + message.configChanges = []; + message.configChanges.push($root.google.api.ConfigChange.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChangeReport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.ChangeReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.ChangeReport} ChangeReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeReport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChangeReport message. + * @function verify + * @memberof google.api.servicemanagement.v1.ChangeReport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChangeReport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.configChanges != null && message.hasOwnProperty("configChanges")) { + if (!Array.isArray(message.configChanges)) + return "configChanges: array expected"; + for (var i = 0; i < message.configChanges.length; ++i) { + var error = $root.google.api.ConfigChange.verify(message.configChanges[i]); + if (error) + return "configChanges." + error; + } + } + return null; + }; + + /** + * Creates a ChangeReport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.ChangeReport + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.ChangeReport} ChangeReport + */ + ChangeReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.ChangeReport) + return object; + var message = new $root.google.api.servicemanagement.v1.ChangeReport(); + if (object.configChanges) { + if (!Array.isArray(object.configChanges)) + throw TypeError(".google.api.servicemanagement.v1.ChangeReport.configChanges: array expected"); + message.configChanges = []; + for (var i = 0; i < object.configChanges.length; ++i) { + if (typeof object.configChanges[i] !== "object") + throw TypeError(".google.api.servicemanagement.v1.ChangeReport.configChanges: object expected"); + message.configChanges[i] = $root.google.api.ConfigChange.fromObject(object.configChanges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ChangeReport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.ChangeReport + * @static + * @param {google.api.servicemanagement.v1.ChangeReport} message ChangeReport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChangeReport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.configChanges = []; + if (message.configChanges && message.configChanges.length) { + object.configChanges = []; + for (var j = 0; j < message.configChanges.length; ++j) + object.configChanges[j] = $root.google.api.ConfigChange.toObject(message.configChanges[j], options); + } + return object; + }; + + /** + * Converts this ChangeReport to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.ChangeReport + * @instance + * @returns {Object.} JSON object + */ + ChangeReport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChangeReport + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.ChangeReport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChangeReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.ChangeReport"; + }; + + return ChangeReport; + })(); + + v1.Rollout = (function() { + + /** + * Properties of a Rollout. + * @memberof google.api.servicemanagement.v1 + * @interface IRollout + * @property {string|null} [rolloutId] Rollout rolloutId + * @property {google.protobuf.ITimestamp|null} [createTime] Rollout createTime + * @property {string|null} [createdBy] Rollout createdBy + * @property {google.api.servicemanagement.v1.Rollout.RolloutStatus|null} [status] Rollout status + * @property {google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy|null} [trafficPercentStrategy] Rollout trafficPercentStrategy + * @property {google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy|null} [deleteServiceStrategy] Rollout deleteServiceStrategy + * @property {string|null} [serviceName] Rollout serviceName + */ + + /** + * Constructs a new Rollout. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a Rollout. + * @implements IRollout + * @constructor + * @param {google.api.servicemanagement.v1.IRollout=} [properties] Properties to set + */ + function Rollout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Rollout rolloutId. + * @member {string} rolloutId + * @memberof google.api.servicemanagement.v1.Rollout + * @instance + */ + Rollout.prototype.rolloutId = ""; + + /** + * Rollout createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.api.servicemanagement.v1.Rollout + * @instance + */ + Rollout.prototype.createTime = null; + + /** + * Rollout createdBy. + * @member {string} createdBy + * @memberof google.api.servicemanagement.v1.Rollout + * @instance + */ + Rollout.prototype.createdBy = ""; + + /** + * Rollout status. + * @member {google.api.servicemanagement.v1.Rollout.RolloutStatus} status + * @memberof google.api.servicemanagement.v1.Rollout + * @instance + */ + Rollout.prototype.status = 0; + + /** + * Rollout trafficPercentStrategy. + * @member {google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy|null|undefined} trafficPercentStrategy + * @memberof google.api.servicemanagement.v1.Rollout + * @instance + */ + Rollout.prototype.trafficPercentStrategy = null; + + /** + * Rollout deleteServiceStrategy. + * @member {google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy|null|undefined} deleteServiceStrategy + * @memberof google.api.servicemanagement.v1.Rollout + * @instance + */ + Rollout.prototype.deleteServiceStrategy = null; + + /** + * Rollout serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.Rollout + * @instance + */ + Rollout.prototype.serviceName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Rollout strategy. + * @member {"trafficPercentStrategy"|"deleteServiceStrategy"|undefined} strategy + * @memberof google.api.servicemanagement.v1.Rollout + * @instance + */ + Object.defineProperty(Rollout.prototype, "strategy", { + get: $util.oneOfGetter($oneOfFields = ["trafficPercentStrategy", "deleteServiceStrategy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Rollout instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.Rollout + * @static + * @param {google.api.servicemanagement.v1.IRollout=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.Rollout} Rollout instance + */ + Rollout.create = function create(properties) { + return new Rollout(properties); + }; + + /** + * Encodes the specified Rollout message. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.Rollout + * @static + * @param {google.api.servicemanagement.v1.IRollout} message Rollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rollout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rolloutId != null && Object.hasOwnProperty.call(message, "rolloutId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rolloutId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.createdBy != null && Object.hasOwnProperty.call(message, "createdBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.createdBy); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + if (message.trafficPercentStrategy != null && Object.hasOwnProperty.call(message, "trafficPercentStrategy")) + $root.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.encode(message.trafficPercentStrategy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceName); + if (message.deleteServiceStrategy != null && Object.hasOwnProperty.call(message, "deleteServiceStrategy")) + $root.google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy.encode(message.deleteServiceStrategy, writer.uint32(/* id 200, wireType 2 =*/1602).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Rollout message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.Rollout + * @static + * @param {google.api.servicemanagement.v1.IRollout} message Rollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rollout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Rollout message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.Rollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.Rollout} Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rollout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.servicemanagement.v1.Rollout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rolloutId = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.createdBy = reader.string(); + break; + } + case 4: { + message.status = reader.int32(); + break; + } + case 5: { + message.trafficPercentStrategy = $root.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.decode(reader, reader.uint32()); + break; + } + case 200: { + message.deleteServiceStrategy = $root.google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy.decode(reader, reader.uint32()); + break; + } + case 8: { + message.serviceName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Rollout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.Rollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.Rollout} Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rollout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Rollout message. + * @function verify + * @memberof google.api.servicemanagement.v1.Rollout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Rollout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rolloutId != null && message.hasOwnProperty("rolloutId")) + if (!$util.isString(message.rolloutId)) + return "rolloutId: 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.createdBy != null && message.hasOwnProperty("createdBy")) + if (!$util.isString(message.createdBy)) + return "createdBy: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.trafficPercentStrategy != null && message.hasOwnProperty("trafficPercentStrategy")) { + properties.strategy = 1; + { + var error = $root.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.verify(message.trafficPercentStrategy); + if (error) + return "trafficPercentStrategy." + error; + } + } + if (message.deleteServiceStrategy != null && message.hasOwnProperty("deleteServiceStrategy")) { + if (properties.strategy === 1) + return "strategy: multiple values"; + properties.strategy = 1; + { + var error = $root.google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy.verify(message.deleteServiceStrategy); + if (error) + return "deleteServiceStrategy." + error; + } + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + return null; + }; + + /** + * Creates a Rollout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.Rollout + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.Rollout} Rollout + */ + Rollout.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.Rollout) + return object; + var message = new $root.google.api.servicemanagement.v1.Rollout(); + if (object.rolloutId != null) + message.rolloutId = String(object.rolloutId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.api.servicemanagement.v1.Rollout.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.createdBy != null) + message.createdBy = String(object.createdBy); + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "ROLLOUT_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "IN_PROGRESS": + case 1: + message.status = 1; + break; + case "SUCCESS": + case 2: + message.status = 2; + break; + case "CANCELLED": + case 3: + message.status = 3; + break; + case "FAILED": + case 4: + message.status = 4; + break; + case "PENDING": + case 5: + message.status = 5; + break; + case "FAILED_ROLLED_BACK": + case 6: + message.status = 6; + break; + } + if (object.trafficPercentStrategy != null) { + if (typeof object.trafficPercentStrategy !== "object") + throw TypeError(".google.api.servicemanagement.v1.Rollout.trafficPercentStrategy: object expected"); + message.trafficPercentStrategy = $root.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.fromObject(object.trafficPercentStrategy); + } + if (object.deleteServiceStrategy != null) { + if (typeof object.deleteServiceStrategy !== "object") + throw TypeError(".google.api.servicemanagement.v1.Rollout.deleteServiceStrategy: object expected"); + message.deleteServiceStrategy = $root.google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy.fromObject(object.deleteServiceStrategy); + } + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + return message; + }; + + /** + * Creates a plain object from a Rollout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.Rollout + * @static + * @param {google.api.servicemanagement.v1.Rollout} message Rollout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Rollout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rolloutId = ""; + object.createTime = null; + object.createdBy = ""; + object.status = options.enums === String ? "ROLLOUT_STATUS_UNSPECIFIED" : 0; + object.serviceName = ""; + } + if (message.rolloutId != null && message.hasOwnProperty("rolloutId")) + object.rolloutId = message.rolloutId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + object.createdBy = message.createdBy; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.api.servicemanagement.v1.Rollout.RolloutStatus[message.status] === undefined ? message.status : $root.google.api.servicemanagement.v1.Rollout.RolloutStatus[message.status] : message.status; + if (message.trafficPercentStrategy != null && message.hasOwnProperty("trafficPercentStrategy")) { + object.trafficPercentStrategy = $root.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.toObject(message.trafficPercentStrategy, options); + if (options.oneofs) + object.strategy = "trafficPercentStrategy"; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.deleteServiceStrategy != null && message.hasOwnProperty("deleteServiceStrategy")) { + object.deleteServiceStrategy = $root.google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy.toObject(message.deleteServiceStrategy, options); + if (options.oneofs) + object.strategy = "deleteServiceStrategy"; + } + return object; + }; + + /** + * Converts this Rollout to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.Rollout + * @instance + * @returns {Object.} JSON object + */ + Rollout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Rollout + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.Rollout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Rollout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.Rollout"; + }; + + Rollout.TrafficPercentStrategy = (function() { + + /** + * Properties of a TrafficPercentStrategy. + * @memberof google.api.servicemanagement.v1.Rollout + * @interface ITrafficPercentStrategy + * @property {Object.|null} [percentages] TrafficPercentStrategy percentages + */ + + /** + * Constructs a new TrafficPercentStrategy. + * @memberof google.api.servicemanagement.v1.Rollout + * @classdesc Represents a TrafficPercentStrategy. + * @implements ITrafficPercentStrategy + * @constructor + * @param {google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy=} [properties] Properties to set + */ + function TrafficPercentStrategy(properties) { + this.percentages = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrafficPercentStrategy percentages. + * @member {Object.} percentages + * @memberof google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy + * @instance + */ + TrafficPercentStrategy.prototype.percentages = $util.emptyObject; + + /** + * Creates a new TrafficPercentStrategy instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy + * @static + * @param {google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy} TrafficPercentStrategy instance + */ + TrafficPercentStrategy.create = function create(properties) { + return new TrafficPercentStrategy(properties); + }; + + /** + * Encodes the specified TrafficPercentStrategy message. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy + * @static + * @param {google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy} message TrafficPercentStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficPercentStrategy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.percentages != null && Object.hasOwnProperty.call(message, "percentages")) + for (var keys = Object.keys(message.percentages), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 1 =*/17).double(message.percentages[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrafficPercentStrategy message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy + * @static + * @param {google.api.servicemanagement.v1.Rollout.ITrafficPercentStrategy} message TrafficPercentStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficPercentStrategy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrafficPercentStrategy message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy} TrafficPercentStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficPercentStrategy.decode = function 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.servicemanagement.v1.Rollout.TrafficPercentStrategy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.percentages === $util.emptyObject) + message.percentages = {}; + 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.percentages[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrafficPercentStrategy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy} TrafficPercentStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficPercentStrategy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrafficPercentStrategy message. + * @function verify + * @memberof google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrafficPercentStrategy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.percentages != null && message.hasOwnProperty("percentages")) { + if (!$util.isObject(message.percentages)) + return "percentages: object expected"; + var key = Object.keys(message.percentages); + for (var i = 0; i < key.length; ++i) + if (typeof message.percentages[key[i]] !== "number") + return "percentages: number{k:string} expected"; + } + return null; + }; + + /** + * Creates a TrafficPercentStrategy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy} TrafficPercentStrategy + */ + TrafficPercentStrategy.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy) + return object; + var message = new $root.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy(); + if (object.percentages) { + if (typeof object.percentages !== "object") + throw TypeError(".google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.percentages: object expected"); + message.percentages = {}; + for (var keys = Object.keys(object.percentages), i = 0; i < keys.length; ++i) + message.percentages[keys[i]] = Number(object.percentages[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a TrafficPercentStrategy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy + * @static + * @param {google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy} message TrafficPercentStrategy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrafficPercentStrategy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.percentages = {}; + var keys2; + if (message.percentages && (keys2 = Object.keys(message.percentages)).length) { + object.percentages = {}; + for (var j = 0; j < keys2.length; ++j) + object.percentages[keys2[j]] = options.json && !isFinite(message.percentages[keys2[j]]) ? String(message.percentages[keys2[j]]) : message.percentages[keys2[j]]; + } + return object; + }; + + /** + * Converts this TrafficPercentStrategy to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy + * @instance + * @returns {Object.} JSON object + */ + TrafficPercentStrategy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrafficPercentStrategy + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrafficPercentStrategy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy"; + }; + + return TrafficPercentStrategy; + })(); + + Rollout.DeleteServiceStrategy = (function() { + + /** + * Properties of a DeleteServiceStrategy. + * @memberof google.api.servicemanagement.v1.Rollout + * @interface IDeleteServiceStrategy + */ + + /** + * Constructs a new DeleteServiceStrategy. + * @memberof google.api.servicemanagement.v1.Rollout + * @classdesc Represents a DeleteServiceStrategy. + * @implements IDeleteServiceStrategy + * @constructor + * @param {google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy=} [properties] Properties to set + */ + function DeleteServiceStrategy(properties) { + if (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 DeleteServiceStrategy instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy + * @static + * @param {google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy} DeleteServiceStrategy instance + */ + DeleteServiceStrategy.create = function create(properties) { + return new DeleteServiceStrategy(properties); + }; + + /** + * Encodes the specified DeleteServiceStrategy message. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy + * @static + * @param {google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy} message DeleteServiceStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceStrategy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteServiceStrategy message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy + * @static + * @param {google.api.servicemanagement.v1.Rollout.IDeleteServiceStrategy} message DeleteServiceStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceStrategy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteServiceStrategy message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy} DeleteServiceStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceStrategy.decode = function 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.servicemanagement.v1.Rollout.DeleteServiceStrategy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteServiceStrategy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy} DeleteServiceStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceStrategy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteServiceStrategy message. + * @function verify + * @memberof google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteServiceStrategy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteServiceStrategy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy} DeleteServiceStrategy + */ + DeleteServiceStrategy.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy) + return object; + return new $root.google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy(); + }; + + /** + * Creates a plain object from a DeleteServiceStrategy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy + * @static + * @param {google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy} message DeleteServiceStrategy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteServiceStrategy.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteServiceStrategy to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy + * @instance + * @returns {Object.} JSON object + */ + DeleteServiceStrategy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteServiceStrategy + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteServiceStrategy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy"; + }; + + return DeleteServiceStrategy; + })(); + + /** + * RolloutStatus enum. + * @name google.api.servicemanagement.v1.Rollout.RolloutStatus + * @enum {number} + * @property {number} ROLLOUT_STATUS_UNSPECIFIED=0 ROLLOUT_STATUS_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} SUCCESS=2 SUCCESS value + * @property {number} CANCELLED=3 CANCELLED value + * @property {number} FAILED=4 FAILED value + * @property {number} PENDING=5 PENDING value + * @property {number} FAILED_ROLLED_BACK=6 FAILED_ROLLED_BACK value + */ + Rollout.RolloutStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLLOUT_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "SUCCESS"] = 2; + values[valuesById[3] = "CANCELLED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "PENDING"] = 5; + values[valuesById[6] = "FAILED_ROLLED_BACK"] = 6; + return values; + })(); + + return Rollout; + })(); + + v1.ServiceManager = (function() { + + /** + * Constructs a new ServiceManager service. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ServiceManager + * @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 ServiceManager(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ServiceManager.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ServiceManager; + + /** + * Creates new ServiceManager service using the specified rpc implementation. + * @function create + * @memberof google.api.servicemanagement.v1.ServiceManager + * @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 {ServiceManager} RPC service. Useful where requests and/or responses are streamed. + */ + ServiceManager.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|listServices}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef ListServicesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.servicemanagement.v1.ListServicesResponse} [response] ListServicesResponse + */ + + /** + * Calls ListServices. + * @function listServices + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IListServicesRequest} request ListServicesRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.ListServicesCallback} callback Node-style callback called with the error, if any, and ListServicesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.listServices = function listServices(request, callback) { + return this.rpcCall(listServices, $root.google.api.servicemanagement.v1.ListServicesRequest, $root.google.api.servicemanagement.v1.ListServicesResponse, request, callback); + }, "name", { value: "ListServices" }); + + /** + * Calls ListServices. + * @function listServices + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IListServicesRequest} request ListServicesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|getService}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef GetServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.servicemanagement.v1.ManagedService} [response] ManagedService + */ + + /** + * Calls GetService. + * @function getService + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IGetServiceRequest} request GetServiceRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.GetServiceCallback} callback Node-style callback called with the error, if any, and ManagedService + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.getService = function getService(request, callback) { + return this.rpcCall(getService, $root.google.api.servicemanagement.v1.GetServiceRequest, $root.google.api.servicemanagement.v1.ManagedService, request, callback); + }, "name", { value: "GetService" }); + + /** + * Calls GetService. + * @function getService + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IGetServiceRequest} request GetServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|createService}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef CreateServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateService. + * @function createService + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.ICreateServiceRequest} request CreateServiceRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.CreateServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.createService = function createService(request, callback) { + return this.rpcCall(createService, $root.google.api.servicemanagement.v1.CreateServiceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateService" }); + + /** + * Calls CreateService. + * @function createService + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.ICreateServiceRequest} request CreateServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|deleteService}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef DeleteServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteService. + * @function deleteService + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IDeleteServiceRequest} request DeleteServiceRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.DeleteServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.deleteService = function deleteService(request, callback) { + return this.rpcCall(deleteService, $root.google.api.servicemanagement.v1.DeleteServiceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteService" }); + + /** + * Calls DeleteService. + * @function deleteService + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IDeleteServiceRequest} request DeleteServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|undeleteService}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef UndeleteServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeleteService. + * @function undeleteService + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IUndeleteServiceRequest} request UndeleteServiceRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.UndeleteServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.undeleteService = function undeleteService(request, callback) { + return this.rpcCall(undeleteService, $root.google.api.servicemanagement.v1.UndeleteServiceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeleteService" }); + + /** + * Calls UndeleteService. + * @function undeleteService + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IUndeleteServiceRequest} request UndeleteServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|listServiceConfigs}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef ListServiceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.servicemanagement.v1.ListServiceConfigsResponse} [response] ListServiceConfigsResponse + */ + + /** + * Calls ListServiceConfigs. + * @function listServiceConfigs + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IListServiceConfigsRequest} request ListServiceConfigsRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.ListServiceConfigsCallback} callback Node-style callback called with the error, if any, and ListServiceConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.listServiceConfigs = function listServiceConfigs(request, callback) { + return this.rpcCall(listServiceConfigs, $root.google.api.servicemanagement.v1.ListServiceConfigsRequest, $root.google.api.servicemanagement.v1.ListServiceConfigsResponse, request, callback); + }, "name", { value: "ListServiceConfigs" }); + + /** + * Calls ListServiceConfigs. + * @function listServiceConfigs + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IListServiceConfigsRequest} request ListServiceConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|getServiceConfig}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef GetServiceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.Service} [response] Service + */ + + /** + * Calls GetServiceConfig. + * @function getServiceConfig + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IGetServiceConfigRequest} request GetServiceConfigRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.GetServiceConfigCallback} callback Node-style callback called with the error, if any, and Service + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.getServiceConfig = function getServiceConfig(request, callback) { + return this.rpcCall(getServiceConfig, $root.google.api.servicemanagement.v1.GetServiceConfigRequest, $root.google.api.Service, request, callback); + }, "name", { value: "GetServiceConfig" }); + + /** + * Calls GetServiceConfig. + * @function getServiceConfig + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IGetServiceConfigRequest} request GetServiceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|createServiceConfig}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef CreateServiceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.Service} [response] Service + */ + + /** + * Calls CreateServiceConfig. + * @function createServiceConfig + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.ICreateServiceConfigRequest} request CreateServiceConfigRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.CreateServiceConfigCallback} callback Node-style callback called with the error, if any, and Service + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.createServiceConfig = function createServiceConfig(request, callback) { + return this.rpcCall(createServiceConfig, $root.google.api.servicemanagement.v1.CreateServiceConfigRequest, $root.google.api.Service, request, callback); + }, "name", { value: "CreateServiceConfig" }); + + /** + * Calls CreateServiceConfig. + * @function createServiceConfig + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.ICreateServiceConfigRequest} request CreateServiceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|submitConfigSource}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef SubmitConfigSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SubmitConfigSource. + * @function submitConfigSource + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.ISubmitConfigSourceRequest} request SubmitConfigSourceRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.SubmitConfigSourceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.submitConfigSource = function submitConfigSource(request, callback) { + return this.rpcCall(submitConfigSource, $root.google.api.servicemanagement.v1.SubmitConfigSourceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SubmitConfigSource" }); + + /** + * Calls SubmitConfigSource. + * @function submitConfigSource + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.ISubmitConfigSourceRequest} request SubmitConfigSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|listServiceRollouts}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef ListServiceRolloutsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.servicemanagement.v1.ListServiceRolloutsResponse} [response] ListServiceRolloutsResponse + */ + + /** + * Calls ListServiceRollouts. + * @function listServiceRollouts + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IListServiceRolloutsRequest} request ListServiceRolloutsRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.ListServiceRolloutsCallback} callback Node-style callback called with the error, if any, and ListServiceRolloutsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.listServiceRollouts = function listServiceRollouts(request, callback) { + return this.rpcCall(listServiceRollouts, $root.google.api.servicemanagement.v1.ListServiceRolloutsRequest, $root.google.api.servicemanagement.v1.ListServiceRolloutsResponse, request, callback); + }, "name", { value: "ListServiceRollouts" }); + + /** + * Calls ListServiceRollouts. + * @function listServiceRollouts + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IListServiceRolloutsRequest} request ListServiceRolloutsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|getServiceRollout}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef GetServiceRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.servicemanagement.v1.Rollout} [response] Rollout + */ + + /** + * Calls GetServiceRollout. + * @function getServiceRollout + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IGetServiceRolloutRequest} request GetServiceRolloutRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.GetServiceRolloutCallback} callback Node-style callback called with the error, if any, and Rollout + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.getServiceRollout = function getServiceRollout(request, callback) { + return this.rpcCall(getServiceRollout, $root.google.api.servicemanagement.v1.GetServiceRolloutRequest, $root.google.api.servicemanagement.v1.Rollout, request, callback); + }, "name", { value: "GetServiceRollout" }); + + /** + * Calls GetServiceRollout. + * @function getServiceRollout + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IGetServiceRolloutRequest} request GetServiceRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|createServiceRollout}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef CreateServiceRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateServiceRollout. + * @function createServiceRollout + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.ICreateServiceRolloutRequest} request CreateServiceRolloutRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.CreateServiceRolloutCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.createServiceRollout = function createServiceRollout(request, callback) { + return this.rpcCall(createServiceRollout, $root.google.api.servicemanagement.v1.CreateServiceRolloutRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateServiceRollout" }); + + /** + * Calls CreateServiceRollout. + * @function createServiceRollout + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.ICreateServiceRolloutRequest} request CreateServiceRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.servicemanagement.v1.ServiceManager|generateConfigReport}. + * @memberof google.api.servicemanagement.v1.ServiceManager + * @typedef GenerateConfigReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.servicemanagement.v1.GenerateConfigReportResponse} [response] GenerateConfigReportResponse + */ + + /** + * Calls GenerateConfigReport. + * @function generateConfigReport + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IGenerateConfigReportRequest} request GenerateConfigReportRequest message or plain object + * @param {google.api.servicemanagement.v1.ServiceManager.GenerateConfigReportCallback} callback Node-style callback called with the error, if any, and GenerateConfigReportResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceManager.prototype.generateConfigReport = function generateConfigReport(request, callback) { + return this.rpcCall(generateConfigReport, $root.google.api.servicemanagement.v1.GenerateConfigReportRequest, $root.google.api.servicemanagement.v1.GenerateConfigReportResponse, request, callback); + }, "name", { value: "GenerateConfigReport" }); + + /** + * Calls GenerateConfigReport. + * @function generateConfigReport + * @memberof google.api.servicemanagement.v1.ServiceManager + * @instance + * @param {google.api.servicemanagement.v1.IGenerateConfigReportRequest} request GenerateConfigReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ServiceManager; + })(); + + v1.ListServicesRequest = (function() { + + /** + * Properties of a ListServicesRequest. + * @memberof google.api.servicemanagement.v1 + * @interface IListServicesRequest + * @property {string|null} [producerProjectId] ListServicesRequest producerProjectId + * @property {number|null} [pageSize] ListServicesRequest pageSize + * @property {string|null} [pageToken] ListServicesRequest pageToken + * @property {string|null} [consumerId] ListServicesRequest consumerId + */ + + /** + * Constructs a new ListServicesRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ListServicesRequest. + * @implements IListServicesRequest + * @constructor + * @param {google.api.servicemanagement.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 producerProjectId. + * @member {string} producerProjectId + * @memberof google.api.servicemanagement.v1.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.producerProjectId = ""; + + /** + * ListServicesRequest pageSize. + * @member {number} pageSize + * @memberof google.api.servicemanagement.v1.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.pageSize = 0; + + /** + * ListServicesRequest pageToken. + * @member {string} pageToken + * @memberof google.api.servicemanagement.v1.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.pageToken = ""; + + /** + * ListServicesRequest consumerId. + * @member {string} consumerId + * @memberof google.api.servicemanagement.v1.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.consumerId = ""; + + /** + * Creates a new ListServicesRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.ListServicesRequest + * @static + * @param {google.api.servicemanagement.v1.IListServicesRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.ListServicesRequest} ListServicesRequest instance + */ + ListServicesRequest.create = function create(properties) { + return new ListServicesRequest(properties); + }; + + /** + * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.api.servicemanagement.v1.ListServicesRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.ListServicesRequest + * @static + * @param {google.api.servicemanagement.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.producerProjectId != null && Object.hasOwnProperty.call(message, "producerProjectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.producerProjectId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.consumerId != null && Object.hasOwnProperty.call(message, "consumerId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.consumerId); + return writer; + }; + + /** + * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ListServicesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.ListServicesRequest + * @static + * @param {google.api.servicemanagement.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.api.servicemanagement.v1.ListServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.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.api.servicemanagement.v1.ListServicesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.producerProjectId = reader.string(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + case 7: { + message.consumerId = 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.api.servicemanagement.v1.ListServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.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.api.servicemanagement.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.producerProjectId != null && message.hasOwnProperty("producerProjectId")) + if (!$util.isString(message.producerProjectId)) + return "producerProjectId: 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.consumerId != null && message.hasOwnProperty("consumerId")) + if (!$util.isString(message.consumerId)) + return "consumerId: string expected"; + return null; + }; + + /** + * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.ListServicesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.ListServicesRequest} ListServicesRequest + */ + ListServicesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.ListServicesRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.ListServicesRequest(); + if (object.producerProjectId != null) + message.producerProjectId = String(object.producerProjectId); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.consumerId != null) + message.consumerId = String(object.consumerId); + return message; + }; + + /** + * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.ListServicesRequest + * @static + * @param {google.api.servicemanagement.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.producerProjectId = ""; + object.pageSize = 0; + object.pageToken = ""; + object.consumerId = ""; + } + if (message.producerProjectId != null && message.hasOwnProperty("producerProjectId")) + object.producerProjectId = message.producerProjectId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.consumerId != null && message.hasOwnProperty("consumerId")) + object.consumerId = message.consumerId; + return object; + }; + + /** + * Converts this ListServicesRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.v1.ListServicesRequest"; + }; + + return ListServicesRequest; + })(); + + v1.ListServicesResponse = (function() { + + /** + * Properties of a ListServicesResponse. + * @memberof google.api.servicemanagement.v1 + * @interface IListServicesResponse + * @property {Array.|null} [services] ListServicesResponse services + * @property {string|null} [nextPageToken] ListServicesResponse nextPageToken + */ + + /** + * Constructs a new ListServicesResponse. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ListServicesResponse. + * @implements IListServicesResponse + * @constructor + * @param {google.api.servicemanagement.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.api.servicemanagement.v1.ListServicesResponse + * @instance + */ + ListServicesResponse.prototype.services = $util.emptyArray; + + /** + * ListServicesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.api.servicemanagement.v1.ListServicesResponse + * @instance + */ + ListServicesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListServicesResponse instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.ListServicesResponse + * @static + * @param {google.api.servicemanagement.v1.IListServicesResponse=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.ListServicesResponse} ListServicesResponse instance + */ + ListServicesResponse.create = function create(properties) { + return new ListServicesResponse(properties); + }; + + /** + * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.api.servicemanagement.v1.ListServicesResponse.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.ListServicesResponse + * @static + * @param {google.api.servicemanagement.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.api.servicemanagement.v1.ManagedService.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.api.servicemanagement.v1.ListServicesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.ListServicesResponse + * @static + * @param {google.api.servicemanagement.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.api.servicemanagement.v1.ListServicesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.v1.ManagedService.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.api.servicemanagement.v1.ListServicesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.v1.ManagedService.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.api.servicemanagement.v1.ListServicesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.ListServicesResponse} ListServicesResponse + */ + ListServicesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.ListServicesResponse) + return object; + var message = new $root.google.api.servicemanagement.v1.ListServicesResponse(); + if (object.services) { + if (!Array.isArray(object.services)) + throw TypeError(".google.api.servicemanagement.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.api.servicemanagement.v1.ListServicesResponse.services: object expected"); + message.services[i] = $root.google.api.servicemanagement.v1.ManagedService.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.api.servicemanagement.v1.ListServicesResponse + * @static + * @param {google.api.servicemanagement.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.api.servicemanagement.v1.ManagedService.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.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.v1.ListServicesResponse"; + }; + + return ListServicesResponse; + })(); + + v1.GetServiceRequest = (function() { + + /** + * Properties of a GetServiceRequest. + * @memberof google.api.servicemanagement.v1 + * @interface IGetServiceRequest + * @property {string|null} [serviceName] GetServiceRequest serviceName + */ + + /** + * Constructs a new GetServiceRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a GetServiceRequest. + * @implements IGetServiceRequest + * @constructor + * @param {google.api.servicemanagement.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 serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.GetServiceRequest + * @instance + */ + GetServiceRequest.prototype.serviceName = ""; + + /** + * Creates a new GetServiceRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.GetServiceRequest + * @static + * @param {google.api.servicemanagement.v1.IGetServiceRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.GetServiceRequest} GetServiceRequest instance + */ + GetServiceRequest.create = function create(properties) { + return new GetServiceRequest(properties); + }; + + /** + * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.api.servicemanagement.v1.GetServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.GetServiceRequest + * @static + * @param {google.api.servicemanagement.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.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + return writer; + }; + + /** + * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.GetServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.GetServiceRequest + * @static + * @param {google.api.servicemanagement.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.api.servicemanagement.v1.GetServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.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.api.servicemanagement.v1.GetServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = 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.api.servicemanagement.v1.GetServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.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.api.servicemanagement.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.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + return null; + }; + + /** + * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.GetServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.GetServiceRequest} GetServiceRequest + */ + GetServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.GetServiceRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.GetServiceRequest(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + return message; + }; + + /** + * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.GetServiceRequest + * @static + * @param {google.api.servicemanagement.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.serviceName = ""; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + return object; + }; + + /** + * Converts this GetServiceRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.v1.GetServiceRequest"; + }; + + return GetServiceRequest; + })(); + + v1.CreateServiceRequest = (function() { + + /** + * Properties of a CreateServiceRequest. + * @memberof google.api.servicemanagement.v1 + * @interface ICreateServiceRequest + * @property {google.api.servicemanagement.v1.IManagedService|null} [service] CreateServiceRequest service + */ + + /** + * Constructs a new CreateServiceRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a CreateServiceRequest. + * @implements ICreateServiceRequest + * @constructor + * @param {google.api.servicemanagement.v1.ICreateServiceRequest=} [properties] Properties to set + */ + function CreateServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateServiceRequest service. + * @member {google.api.servicemanagement.v1.IManagedService|null|undefined} service + * @memberof google.api.servicemanagement.v1.CreateServiceRequest + * @instance + */ + CreateServiceRequest.prototype.service = null; + + /** + * Creates a new CreateServiceRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.CreateServiceRequest + * @static + * @param {google.api.servicemanagement.v1.ICreateServiceRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.CreateServiceRequest} CreateServiceRequest instance + */ + CreateServiceRequest.create = function create(properties) { + return new CreateServiceRequest(properties); + }; + + /** + * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.CreateServiceRequest + * @static + * @param {google.api.servicemanagement.v1.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + $root.google.api.servicemanagement.v1.ManagedService.encode(message.service, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.CreateServiceRequest + * @static + * @param {google.api.servicemanagement.v1.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.CreateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.CreateServiceRequest} CreateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceRequest.decode = function 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.servicemanagement.v1.CreateServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = $root.google.api.servicemanagement.v1.ManagedService.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.CreateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.CreateServiceRequest} CreateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateServiceRequest message. + * @function verify + * @memberof google.api.servicemanagement.v1.CreateServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) { + var error = $root.google.api.servicemanagement.v1.ManagedService.verify(message.service); + if (error) + return "service." + error; + } + return null; + }; + + /** + * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.CreateServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.CreateServiceRequest} CreateServiceRequest + */ + CreateServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.CreateServiceRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.CreateServiceRequest(); + if (object.service != null) { + if (typeof object.service !== "object") + throw TypeError(".google.api.servicemanagement.v1.CreateServiceRequest.service: object expected"); + message.service = $root.google.api.servicemanagement.v1.ManagedService.fromObject(object.service); + } + return message; + }; + + /** + * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.CreateServiceRequest + * @static + * @param {google.api.servicemanagement.v1.CreateServiceRequest} message CreateServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.service = null; + if (message.service != null && message.hasOwnProperty("service")) + object.service = $root.google.api.servicemanagement.v1.ManagedService.toObject(message.service, options); + return object; + }; + + /** + * Converts this CreateServiceRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.CreateServiceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateServiceRequest + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.CreateServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.CreateServiceRequest"; + }; + + return CreateServiceRequest; + })(); + + v1.DeleteServiceRequest = (function() { + + /** + * Properties of a DeleteServiceRequest. + * @memberof google.api.servicemanagement.v1 + * @interface IDeleteServiceRequest + * @property {string|null} [serviceName] DeleteServiceRequest serviceName + */ + + /** + * Constructs a new DeleteServiceRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a DeleteServiceRequest. + * @implements IDeleteServiceRequest + * @constructor + * @param {google.api.servicemanagement.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 serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.DeleteServiceRequest + * @instance + */ + DeleteServiceRequest.prototype.serviceName = ""; + + /** + * Creates a new DeleteServiceRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.DeleteServiceRequest + * @static + * @param {google.api.servicemanagement.v1.IDeleteServiceRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.DeleteServiceRequest} DeleteServiceRequest instance + */ + DeleteServiceRequest.create = function create(properties) { + return new DeleteServiceRequest(properties); + }; + + /** + * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.api.servicemanagement.v1.DeleteServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.DeleteServiceRequest + * @static + * @param {google.api.servicemanagement.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.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + return writer; + }; + + /** + * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.DeleteServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.DeleteServiceRequest + * @static + * @param {google.api.servicemanagement.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.api.servicemanagement.v1.DeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.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.api.servicemanagement.v1.DeleteServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = 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.api.servicemanagement.v1.DeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.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.api.servicemanagement.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.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + return null; + }; + + /** + * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.DeleteServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.DeleteServiceRequest} DeleteServiceRequest + */ + DeleteServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.DeleteServiceRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.DeleteServiceRequest(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + return message; + }; + + /** + * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.DeleteServiceRequest + * @static + * @param {google.api.servicemanagement.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.serviceName = ""; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + return object; + }; + + /** + * Converts this DeleteServiceRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.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.api.servicemanagement.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.api.servicemanagement.v1.DeleteServiceRequest"; + }; + + return DeleteServiceRequest; + })(); + + v1.UndeleteServiceRequest = (function() { + + /** + * Properties of an UndeleteServiceRequest. + * @memberof google.api.servicemanagement.v1 + * @interface IUndeleteServiceRequest + * @property {string|null} [serviceName] UndeleteServiceRequest serviceName + */ + + /** + * Constructs a new UndeleteServiceRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents an UndeleteServiceRequest. + * @implements IUndeleteServiceRequest + * @constructor + * @param {google.api.servicemanagement.v1.IUndeleteServiceRequest=} [properties] Properties to set + */ + function UndeleteServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeleteServiceRequest serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.UndeleteServiceRequest + * @instance + */ + UndeleteServiceRequest.prototype.serviceName = ""; + + /** + * Creates a new UndeleteServiceRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.UndeleteServiceRequest + * @static + * @param {google.api.servicemanagement.v1.IUndeleteServiceRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.UndeleteServiceRequest} UndeleteServiceRequest instance + */ + UndeleteServiceRequest.create = function create(properties) { + return new UndeleteServiceRequest(properties); + }; + + /** + * Encodes the specified UndeleteServiceRequest message. Does not implicitly {@link google.api.servicemanagement.v1.UndeleteServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.UndeleteServiceRequest + * @static + * @param {google.api.servicemanagement.v1.IUndeleteServiceRequest} message UndeleteServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + return writer; + }; + + /** + * Encodes the specified UndeleteServiceRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.UndeleteServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.UndeleteServiceRequest + * @static + * @param {google.api.servicemanagement.v1.IUndeleteServiceRequest} message UndeleteServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.UndeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.UndeleteServiceRequest} UndeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteServiceRequest.decode = function 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.servicemanagement.v1.UndeleteServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.UndeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.UndeleteServiceRequest} UndeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteServiceRequest message. + * @function verify + * @memberof google.api.servicemanagement.v1.UndeleteServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + return null; + }; + + /** + * Creates an UndeleteServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.UndeleteServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.UndeleteServiceRequest} UndeleteServiceRequest + */ + UndeleteServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.UndeleteServiceRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.UndeleteServiceRequest(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + return message; + }; + + /** + * Creates a plain object from an UndeleteServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.UndeleteServiceRequest + * @static + * @param {google.api.servicemanagement.v1.UndeleteServiceRequest} message UndeleteServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.serviceName = ""; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + return object; + }; + + /** + * Converts this UndeleteServiceRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.UndeleteServiceRequest + * @instance + * @returns {Object.} JSON object + */ + UndeleteServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteServiceRequest + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.UndeleteServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.UndeleteServiceRequest"; + }; + + return UndeleteServiceRequest; + })(); + + v1.UndeleteServiceResponse = (function() { + + /** + * Properties of an UndeleteServiceResponse. + * @memberof google.api.servicemanagement.v1 + * @interface IUndeleteServiceResponse + * @property {google.api.servicemanagement.v1.IManagedService|null} [service] UndeleteServiceResponse service + */ + + /** + * Constructs a new UndeleteServiceResponse. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents an UndeleteServiceResponse. + * @implements IUndeleteServiceResponse + * @constructor + * @param {google.api.servicemanagement.v1.IUndeleteServiceResponse=} [properties] Properties to set + */ + function UndeleteServiceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeleteServiceResponse service. + * @member {google.api.servicemanagement.v1.IManagedService|null|undefined} service + * @memberof google.api.servicemanagement.v1.UndeleteServiceResponse + * @instance + */ + UndeleteServiceResponse.prototype.service = null; + + /** + * Creates a new UndeleteServiceResponse instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.UndeleteServiceResponse + * @static + * @param {google.api.servicemanagement.v1.IUndeleteServiceResponse=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.UndeleteServiceResponse} UndeleteServiceResponse instance + */ + UndeleteServiceResponse.create = function create(properties) { + return new UndeleteServiceResponse(properties); + }; + + /** + * Encodes the specified UndeleteServiceResponse message. Does not implicitly {@link google.api.servicemanagement.v1.UndeleteServiceResponse.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.UndeleteServiceResponse + * @static + * @param {google.api.servicemanagement.v1.IUndeleteServiceResponse} message UndeleteServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteServiceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + $root.google.api.servicemanagement.v1.ManagedService.encode(message.service, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UndeleteServiceResponse message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.UndeleteServiceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.UndeleteServiceResponse + * @static + * @param {google.api.servicemanagement.v1.IUndeleteServiceResponse} message UndeleteServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteServiceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.UndeleteServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.UndeleteServiceResponse} UndeleteServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteServiceResponse.decode = function 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.servicemanagement.v1.UndeleteServiceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = $root.google.api.servicemanagement.v1.ManagedService.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteServiceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.UndeleteServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.UndeleteServiceResponse} UndeleteServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteServiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteServiceResponse message. + * @function verify + * @memberof google.api.servicemanagement.v1.UndeleteServiceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteServiceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) { + var error = $root.google.api.servicemanagement.v1.ManagedService.verify(message.service); + if (error) + return "service." + error; + } + return null; + }; + + /** + * Creates an UndeleteServiceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.UndeleteServiceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.UndeleteServiceResponse} UndeleteServiceResponse + */ + UndeleteServiceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.UndeleteServiceResponse) + return object; + var message = new $root.google.api.servicemanagement.v1.UndeleteServiceResponse(); + if (object.service != null) { + if (typeof object.service !== "object") + throw TypeError(".google.api.servicemanagement.v1.UndeleteServiceResponse.service: object expected"); + message.service = $root.google.api.servicemanagement.v1.ManagedService.fromObject(object.service); + } + return message; + }; + + /** + * Creates a plain object from an UndeleteServiceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.UndeleteServiceResponse + * @static + * @param {google.api.servicemanagement.v1.UndeleteServiceResponse} message UndeleteServiceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteServiceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.service = null; + if (message.service != null && message.hasOwnProperty("service")) + object.service = $root.google.api.servicemanagement.v1.ManagedService.toObject(message.service, options); + return object; + }; + + /** + * Converts this UndeleteServiceResponse to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.UndeleteServiceResponse + * @instance + * @returns {Object.} JSON object + */ + UndeleteServiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteServiceResponse + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.UndeleteServiceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.UndeleteServiceResponse"; + }; + + return UndeleteServiceResponse; + })(); + + v1.GetServiceConfigRequest = (function() { + + /** + * Properties of a GetServiceConfigRequest. + * @memberof google.api.servicemanagement.v1 + * @interface IGetServiceConfigRequest + * @property {string|null} [serviceName] GetServiceConfigRequest serviceName + * @property {string|null} [configId] GetServiceConfigRequest configId + * @property {google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView|null} [view] GetServiceConfigRequest view + */ + + /** + * Constructs a new GetServiceConfigRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a GetServiceConfigRequest. + * @implements IGetServiceConfigRequest + * @constructor + * @param {google.api.servicemanagement.v1.IGetServiceConfigRequest=} [properties] Properties to set + */ + function GetServiceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetServiceConfigRequest serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @instance + */ + GetServiceConfigRequest.prototype.serviceName = ""; + + /** + * GetServiceConfigRequest configId. + * @member {string} configId + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @instance + */ + GetServiceConfigRequest.prototype.configId = ""; + + /** + * GetServiceConfigRequest view. + * @member {google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView} view + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @instance + */ + GetServiceConfigRequest.prototype.view = 0; + + /** + * Creates a new GetServiceConfigRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @static + * @param {google.api.servicemanagement.v1.IGetServiceConfigRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.GetServiceConfigRequest} GetServiceConfigRequest instance + */ + GetServiceConfigRequest.create = function create(properties) { + return new GetServiceConfigRequest(properties); + }; + + /** + * Encodes the specified GetServiceConfigRequest message. Does not implicitly {@link google.api.servicemanagement.v1.GetServiceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @static + * @param {google.api.servicemanagement.v1.IGetServiceConfigRequest} message GetServiceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.configId != null && Object.hasOwnProperty.call(message, "configId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetServiceConfigRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.GetServiceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @static + * @param {google.api.servicemanagement.v1.IGetServiceConfigRequest} message GetServiceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetServiceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.GetServiceConfigRequest} GetServiceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceConfigRequest.decode = function 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.servicemanagement.v1.GetServiceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.configId = reader.string(); + break; + } + case 3: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetServiceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.GetServiceConfigRequest} GetServiceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetServiceConfigRequest message. + * @function verify + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetServiceConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.configId != null && message.hasOwnProperty("configId")) + if (!$util.isString(message.configId)) + return "configId: 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 GetServiceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.GetServiceConfigRequest} GetServiceConfigRequest + */ + GetServiceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.GetServiceConfigRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.GetServiceConfigRequest(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.configId != null) + message.configId = String(object.configId); + 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 GetServiceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @static + * @param {google.api.servicemanagement.v1.GetServiceConfigRequest} message GetServiceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetServiceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.configId = ""; + object.view = options.enums === String ? "BASIC" : 0; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.configId != null && message.hasOwnProperty("configId")) + object.configId = message.configId; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView[message.view] === undefined ? message.view : $root.google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetServiceConfigRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetServiceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetServiceConfigRequest + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.GetServiceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetServiceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.GetServiceConfigRequest"; + }; + + /** + * ConfigView enum. + * @name google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView + * @enum {number} + * @property {number} BASIC=0 BASIC value + * @property {number} FULL=1 FULL value + */ + GetServiceConfigRequest.ConfigView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BASIC"] = 0; + values[valuesById[1] = "FULL"] = 1; + return values; + })(); + + return GetServiceConfigRequest; + })(); + + v1.ListServiceConfigsRequest = (function() { + + /** + * Properties of a ListServiceConfigsRequest. + * @memberof google.api.servicemanagement.v1 + * @interface IListServiceConfigsRequest + * @property {string|null} [serviceName] ListServiceConfigsRequest serviceName + * @property {string|null} [pageToken] ListServiceConfigsRequest pageToken + * @property {number|null} [pageSize] ListServiceConfigsRequest pageSize + */ + + /** + * Constructs a new ListServiceConfigsRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ListServiceConfigsRequest. + * @implements IListServiceConfigsRequest + * @constructor + * @param {google.api.servicemanagement.v1.IListServiceConfigsRequest=} [properties] Properties to set + */ + function ListServiceConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServiceConfigsRequest serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @instance + */ + ListServiceConfigsRequest.prototype.serviceName = ""; + + /** + * ListServiceConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @instance + */ + ListServiceConfigsRequest.prototype.pageToken = ""; + + /** + * ListServiceConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @instance + */ + ListServiceConfigsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListServiceConfigsRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @static + * @param {google.api.servicemanagement.v1.IListServiceConfigsRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.ListServiceConfigsRequest} ListServiceConfigsRequest instance + */ + ListServiceConfigsRequest.create = function create(properties) { + return new ListServiceConfigsRequest(properties); + }; + + /** + * Encodes the specified ListServiceConfigsRequest message. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @static + * @param {google.api.servicemanagement.v1.IListServiceConfigsRequest} message ListServiceConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListServiceConfigsRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @static + * @param {google.api.servicemanagement.v1.IListServiceConfigsRequest} message ListServiceConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServiceConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.ListServiceConfigsRequest} ListServiceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceConfigsRequest.decode = function 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.servicemanagement.v1.ListServiceConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServiceConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.ListServiceConfigsRequest} ListServiceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServiceConfigsRequest message. + * @function verify + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServiceConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListServiceConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.ListServiceConfigsRequest} ListServiceConfigsRequest + */ + ListServiceConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.ListServiceConfigsRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.ListServiceConfigsRequest(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListServiceConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @static + * @param {google.api.servicemanagement.v1.ListServiceConfigsRequest} message ListServiceConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServiceConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListServiceConfigsRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListServiceConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServiceConfigsRequest + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.ListServiceConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServiceConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.ListServiceConfigsRequest"; + }; + + return ListServiceConfigsRequest; + })(); + + v1.ListServiceConfigsResponse = (function() { + + /** + * Properties of a ListServiceConfigsResponse. + * @memberof google.api.servicemanagement.v1 + * @interface IListServiceConfigsResponse + * @property {Array.|null} [serviceConfigs] ListServiceConfigsResponse serviceConfigs + * @property {string|null} [nextPageToken] ListServiceConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListServiceConfigsResponse. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ListServiceConfigsResponse. + * @implements IListServiceConfigsResponse + * @constructor + * @param {google.api.servicemanagement.v1.IListServiceConfigsResponse=} [properties] Properties to set + */ + function ListServiceConfigsResponse(properties) { + this.serviceConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServiceConfigsResponse serviceConfigs. + * @member {Array.} serviceConfigs + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @instance + */ + ListServiceConfigsResponse.prototype.serviceConfigs = $util.emptyArray; + + /** + * ListServiceConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @instance + */ + ListServiceConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListServiceConfigsResponse instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @static + * @param {google.api.servicemanagement.v1.IListServiceConfigsResponse=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.ListServiceConfigsResponse} ListServiceConfigsResponse instance + */ + ListServiceConfigsResponse.create = function create(properties) { + return new ListServiceConfigsResponse(properties); + }; + + /** + * Encodes the specified ListServiceConfigsResponse message. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @static + * @param {google.api.servicemanagement.v1.IListServiceConfigsResponse} message ListServiceConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceConfigs != null && message.serviceConfigs.length) + for (var i = 0; i < message.serviceConfigs.length; ++i) + $root.google.api.Service.encode(message.serviceConfigs[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 ListServiceConfigsResponse message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @static + * @param {google.api.servicemanagement.v1.IListServiceConfigsResponse} message ListServiceConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServiceConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.ListServiceConfigsResponse} ListServiceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceConfigsResponse.decode = function 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.servicemanagement.v1.ListServiceConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.serviceConfigs && message.serviceConfigs.length)) + message.serviceConfigs = []; + message.serviceConfigs.push($root.google.api.Service.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServiceConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.ListServiceConfigsResponse} ListServiceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServiceConfigsResponse message. + * @function verify + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServiceConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceConfigs != null && message.hasOwnProperty("serviceConfigs")) { + if (!Array.isArray(message.serviceConfigs)) + return "serviceConfigs: array expected"; + for (var i = 0; i < message.serviceConfigs.length; ++i) { + var error = $root.google.api.Service.verify(message.serviceConfigs[i]); + if (error) + return "serviceConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListServiceConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.ListServiceConfigsResponse} ListServiceConfigsResponse + */ + ListServiceConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.ListServiceConfigsResponse) + return object; + var message = new $root.google.api.servicemanagement.v1.ListServiceConfigsResponse(); + if (object.serviceConfigs) { + if (!Array.isArray(object.serviceConfigs)) + throw TypeError(".google.api.servicemanagement.v1.ListServiceConfigsResponse.serviceConfigs: array expected"); + message.serviceConfigs = []; + for (var i = 0; i < object.serviceConfigs.length; ++i) { + if (typeof object.serviceConfigs[i] !== "object") + throw TypeError(".google.api.servicemanagement.v1.ListServiceConfigsResponse.serviceConfigs: object expected"); + message.serviceConfigs[i] = $root.google.api.Service.fromObject(object.serviceConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListServiceConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @static + * @param {google.api.servicemanagement.v1.ListServiceConfigsResponse} message ListServiceConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServiceConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serviceConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.serviceConfigs && message.serviceConfigs.length) { + object.serviceConfigs = []; + for (var j = 0; j < message.serviceConfigs.length; ++j) + object.serviceConfigs[j] = $root.google.api.Service.toObject(message.serviceConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListServiceConfigsResponse to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListServiceConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServiceConfigsResponse + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.ListServiceConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServiceConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.ListServiceConfigsResponse"; + }; + + return ListServiceConfigsResponse; + })(); + + v1.CreateServiceConfigRequest = (function() { + + /** + * Properties of a CreateServiceConfigRequest. + * @memberof google.api.servicemanagement.v1 + * @interface ICreateServiceConfigRequest + * @property {string|null} [serviceName] CreateServiceConfigRequest serviceName + * @property {google.api.IService|null} [serviceConfig] CreateServiceConfigRequest serviceConfig + */ + + /** + * Constructs a new CreateServiceConfigRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a CreateServiceConfigRequest. + * @implements ICreateServiceConfigRequest + * @constructor + * @param {google.api.servicemanagement.v1.ICreateServiceConfigRequest=} [properties] Properties to set + */ + function CreateServiceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateServiceConfigRequest serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @instance + */ + CreateServiceConfigRequest.prototype.serviceName = ""; + + /** + * CreateServiceConfigRequest serviceConfig. + * @member {google.api.IService|null|undefined} serviceConfig + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @instance + */ + CreateServiceConfigRequest.prototype.serviceConfig = null; + + /** + * Creates a new CreateServiceConfigRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @static + * @param {google.api.servicemanagement.v1.ICreateServiceConfigRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.CreateServiceConfigRequest} CreateServiceConfigRequest instance + */ + CreateServiceConfigRequest.create = function create(properties) { + return new CreateServiceConfigRequest(properties); + }; + + /** + * Encodes the specified CreateServiceConfigRequest message. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @static + * @param {google.api.servicemanagement.v1.ICreateServiceConfigRequest} message CreateServiceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.serviceConfig != null && Object.hasOwnProperty.call(message, "serviceConfig")) + $root.google.api.Service.encode(message.serviceConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateServiceConfigRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @static + * @param {google.api.servicemanagement.v1.ICreateServiceConfigRequest} message CreateServiceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateServiceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.CreateServiceConfigRequest} CreateServiceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceConfigRequest.decode = function 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.servicemanagement.v1.CreateServiceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.serviceConfig = $root.google.api.Service.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateServiceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.CreateServiceConfigRequest} CreateServiceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateServiceConfigRequest message. + * @function verify + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateServiceConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.serviceConfig != null && message.hasOwnProperty("serviceConfig")) { + var error = $root.google.api.Service.verify(message.serviceConfig); + if (error) + return "serviceConfig." + error; + } + return null; + }; + + /** + * Creates a CreateServiceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.CreateServiceConfigRequest} CreateServiceConfigRequest + */ + CreateServiceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.CreateServiceConfigRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.CreateServiceConfigRequest(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.serviceConfig != null) { + if (typeof object.serviceConfig !== "object") + throw TypeError(".google.api.servicemanagement.v1.CreateServiceConfigRequest.serviceConfig: object expected"); + message.serviceConfig = $root.google.api.Service.fromObject(object.serviceConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateServiceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @static + * @param {google.api.servicemanagement.v1.CreateServiceConfigRequest} message CreateServiceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateServiceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.serviceConfig = null; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.serviceConfig != null && message.hasOwnProperty("serviceConfig")) + object.serviceConfig = $root.google.api.Service.toObject(message.serviceConfig, options); + return object; + }; + + /** + * Converts this CreateServiceConfigRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateServiceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateServiceConfigRequest + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.CreateServiceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateServiceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.CreateServiceConfigRequest"; + }; + + return CreateServiceConfigRequest; + })(); + + v1.SubmitConfigSourceRequest = (function() { + + /** + * Properties of a SubmitConfigSourceRequest. + * @memberof google.api.servicemanagement.v1 + * @interface ISubmitConfigSourceRequest + * @property {string|null} [serviceName] SubmitConfigSourceRequest serviceName + * @property {google.api.servicemanagement.v1.IConfigSource|null} [configSource] SubmitConfigSourceRequest configSource + * @property {boolean|null} [validateOnly] SubmitConfigSourceRequest validateOnly + */ + + /** + * Constructs a new SubmitConfigSourceRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a SubmitConfigSourceRequest. + * @implements ISubmitConfigSourceRequest + * @constructor + * @param {google.api.servicemanagement.v1.ISubmitConfigSourceRequest=} [properties] Properties to set + */ + function SubmitConfigSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubmitConfigSourceRequest serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @instance + */ + SubmitConfigSourceRequest.prototype.serviceName = ""; + + /** + * SubmitConfigSourceRequest configSource. + * @member {google.api.servicemanagement.v1.IConfigSource|null|undefined} configSource + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @instance + */ + SubmitConfigSourceRequest.prototype.configSource = null; + + /** + * SubmitConfigSourceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @instance + */ + SubmitConfigSourceRequest.prototype.validateOnly = false; + + /** + * Creates a new SubmitConfigSourceRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @static + * @param {google.api.servicemanagement.v1.ISubmitConfigSourceRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.SubmitConfigSourceRequest} SubmitConfigSourceRequest instance + */ + SubmitConfigSourceRequest.create = function create(properties) { + return new SubmitConfigSourceRequest(properties); + }; + + /** + * Encodes the specified SubmitConfigSourceRequest message. Does not implicitly {@link google.api.servicemanagement.v1.SubmitConfigSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @static + * @param {google.api.servicemanagement.v1.ISubmitConfigSourceRequest} message SubmitConfigSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitConfigSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.configSource != null && Object.hasOwnProperty.call(message, "configSource")) + $root.google.api.servicemanagement.v1.ConfigSource.encode(message.configSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified SubmitConfigSourceRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.SubmitConfigSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @static + * @param {google.api.servicemanagement.v1.ISubmitConfigSourceRequest} message SubmitConfigSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitConfigSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubmitConfigSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.SubmitConfigSourceRequest} SubmitConfigSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitConfigSourceRequest.decode = function 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.servicemanagement.v1.SubmitConfigSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.configSource = $root.google.api.servicemanagement.v1.ConfigSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubmitConfigSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.SubmitConfigSourceRequest} SubmitConfigSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitConfigSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubmitConfigSourceRequest message. + * @function verify + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubmitConfigSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.configSource != null && message.hasOwnProperty("configSource")) { + var error = $root.google.api.servicemanagement.v1.ConfigSource.verify(message.configSource); + if (error) + return "configSource." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a SubmitConfigSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.SubmitConfigSourceRequest} SubmitConfigSourceRequest + */ + SubmitConfigSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.SubmitConfigSourceRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.SubmitConfigSourceRequest(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.configSource != null) { + if (typeof object.configSource !== "object") + throw TypeError(".google.api.servicemanagement.v1.SubmitConfigSourceRequest.configSource: object expected"); + message.configSource = $root.google.api.servicemanagement.v1.ConfigSource.fromObject(object.configSource); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a SubmitConfigSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @static + * @param {google.api.servicemanagement.v1.SubmitConfigSourceRequest} message SubmitConfigSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubmitConfigSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.configSource = null; + object.validateOnly = false; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.configSource != null && message.hasOwnProperty("configSource")) + object.configSource = $root.google.api.servicemanagement.v1.ConfigSource.toObject(message.configSource, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this SubmitConfigSourceRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @instance + * @returns {Object.} JSON object + */ + SubmitConfigSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubmitConfigSourceRequest + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubmitConfigSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.SubmitConfigSourceRequest"; + }; + + return SubmitConfigSourceRequest; + })(); + + v1.SubmitConfigSourceResponse = (function() { + + /** + * Properties of a SubmitConfigSourceResponse. + * @memberof google.api.servicemanagement.v1 + * @interface ISubmitConfigSourceResponse + * @property {google.api.IService|null} [serviceConfig] SubmitConfigSourceResponse serviceConfig + */ + + /** + * Constructs a new SubmitConfigSourceResponse. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a SubmitConfigSourceResponse. + * @implements ISubmitConfigSourceResponse + * @constructor + * @param {google.api.servicemanagement.v1.ISubmitConfigSourceResponse=} [properties] Properties to set + */ + function SubmitConfigSourceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubmitConfigSourceResponse serviceConfig. + * @member {google.api.IService|null|undefined} serviceConfig + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceResponse + * @instance + */ + SubmitConfigSourceResponse.prototype.serviceConfig = null; + + /** + * Creates a new SubmitConfigSourceResponse instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceResponse + * @static + * @param {google.api.servicemanagement.v1.ISubmitConfigSourceResponse=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.SubmitConfigSourceResponse} SubmitConfigSourceResponse instance + */ + SubmitConfigSourceResponse.create = function create(properties) { + return new SubmitConfigSourceResponse(properties); + }; + + /** + * Encodes the specified SubmitConfigSourceResponse message. Does not implicitly {@link google.api.servicemanagement.v1.SubmitConfigSourceResponse.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceResponse + * @static + * @param {google.api.servicemanagement.v1.ISubmitConfigSourceResponse} message SubmitConfigSourceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitConfigSourceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceConfig != null && Object.hasOwnProperty.call(message, "serviceConfig")) + $root.google.api.Service.encode(message.serviceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubmitConfigSourceResponse message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.SubmitConfigSourceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceResponse + * @static + * @param {google.api.servicemanagement.v1.ISubmitConfigSourceResponse} message SubmitConfigSourceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitConfigSourceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubmitConfigSourceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.SubmitConfigSourceResponse} SubmitConfigSourceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitConfigSourceResponse.decode = function 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.servicemanagement.v1.SubmitConfigSourceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceConfig = $root.google.api.Service.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubmitConfigSourceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.SubmitConfigSourceResponse} SubmitConfigSourceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitConfigSourceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubmitConfigSourceResponse message. + * @function verify + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubmitConfigSourceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceConfig != null && message.hasOwnProperty("serviceConfig")) { + var error = $root.google.api.Service.verify(message.serviceConfig); + if (error) + return "serviceConfig." + error; + } + return null; + }; + + /** + * Creates a SubmitConfigSourceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.SubmitConfigSourceResponse} SubmitConfigSourceResponse + */ + SubmitConfigSourceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.SubmitConfigSourceResponse) + return object; + var message = new $root.google.api.servicemanagement.v1.SubmitConfigSourceResponse(); + if (object.serviceConfig != null) { + if (typeof object.serviceConfig !== "object") + throw TypeError(".google.api.servicemanagement.v1.SubmitConfigSourceResponse.serviceConfig: object expected"); + message.serviceConfig = $root.google.api.Service.fromObject(object.serviceConfig); + } + return message; + }; + + /** + * Creates a plain object from a SubmitConfigSourceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceResponse + * @static + * @param {google.api.servicemanagement.v1.SubmitConfigSourceResponse} message SubmitConfigSourceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubmitConfigSourceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.serviceConfig = null; + if (message.serviceConfig != null && message.hasOwnProperty("serviceConfig")) + object.serviceConfig = $root.google.api.Service.toObject(message.serviceConfig, options); + return object; + }; + + /** + * Converts this SubmitConfigSourceResponse to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceResponse + * @instance + * @returns {Object.} JSON object + */ + SubmitConfigSourceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubmitConfigSourceResponse + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.SubmitConfigSourceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubmitConfigSourceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.SubmitConfigSourceResponse"; + }; + + return SubmitConfigSourceResponse; + })(); + + v1.CreateServiceRolloutRequest = (function() { + + /** + * Properties of a CreateServiceRolloutRequest. + * @memberof google.api.servicemanagement.v1 + * @interface ICreateServiceRolloutRequest + * @property {string|null} [serviceName] CreateServiceRolloutRequest serviceName + * @property {google.api.servicemanagement.v1.IRollout|null} [rollout] CreateServiceRolloutRequest rollout + */ + + /** + * Constructs a new CreateServiceRolloutRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a CreateServiceRolloutRequest. + * @implements ICreateServiceRolloutRequest + * @constructor + * @param {google.api.servicemanagement.v1.ICreateServiceRolloutRequest=} [properties] Properties to set + */ + function CreateServiceRolloutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateServiceRolloutRequest serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @instance + */ + CreateServiceRolloutRequest.prototype.serviceName = ""; + + /** + * CreateServiceRolloutRequest rollout. + * @member {google.api.servicemanagement.v1.IRollout|null|undefined} rollout + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @instance + */ + CreateServiceRolloutRequest.prototype.rollout = null; + + /** + * Creates a new CreateServiceRolloutRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @static + * @param {google.api.servicemanagement.v1.ICreateServiceRolloutRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.CreateServiceRolloutRequest} CreateServiceRolloutRequest instance + */ + CreateServiceRolloutRequest.create = function create(properties) { + return new CreateServiceRolloutRequest(properties); + }; + + /** + * Encodes the specified CreateServiceRolloutRequest message. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @static + * @param {google.api.servicemanagement.v1.ICreateServiceRolloutRequest} message CreateServiceRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceRolloutRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.api.servicemanagement.v1.Rollout.encode(message.rollout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateServiceRolloutRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.CreateServiceRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @static + * @param {google.api.servicemanagement.v1.ICreateServiceRolloutRequest} message CreateServiceRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateServiceRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.CreateServiceRolloutRequest} CreateServiceRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceRolloutRequest.decode = function 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.servicemanagement.v1.CreateServiceRolloutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.rollout = $root.google.api.servicemanagement.v1.Rollout.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateServiceRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.CreateServiceRolloutRequest} CreateServiceRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateServiceRolloutRequest message. + * @function verify + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateServiceRolloutRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.api.servicemanagement.v1.Rollout.verify(message.rollout); + if (error) + return "rollout." + error; + } + return null; + }; + + /** + * Creates a CreateServiceRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.CreateServiceRolloutRequest} CreateServiceRolloutRequest + */ + CreateServiceRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.CreateServiceRolloutRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.CreateServiceRolloutRequest(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.api.servicemanagement.v1.CreateServiceRolloutRequest.rollout: object expected"); + message.rollout = $root.google.api.servicemanagement.v1.Rollout.fromObject(object.rollout); + } + return message; + }; + + /** + * Creates a plain object from a CreateServiceRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @static + * @param {google.api.servicemanagement.v1.CreateServiceRolloutRequest} message CreateServiceRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateServiceRolloutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.rollout = null; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.api.servicemanagement.v1.Rollout.toObject(message.rollout, options); + return object; + }; + + /** + * Converts this CreateServiceRolloutRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + CreateServiceRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateServiceRolloutRequest + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.CreateServiceRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateServiceRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.CreateServiceRolloutRequest"; + }; + + return CreateServiceRolloutRequest; + })(); + + v1.ListServiceRolloutsRequest = (function() { + + /** + * Properties of a ListServiceRolloutsRequest. + * @memberof google.api.servicemanagement.v1 + * @interface IListServiceRolloutsRequest + * @property {string|null} [serviceName] ListServiceRolloutsRequest serviceName + * @property {string|null} [pageToken] ListServiceRolloutsRequest pageToken + * @property {number|null} [pageSize] ListServiceRolloutsRequest pageSize + * @property {string|null} [filter] ListServiceRolloutsRequest filter + */ + + /** + * Constructs a new ListServiceRolloutsRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ListServiceRolloutsRequest. + * @implements IListServiceRolloutsRequest + * @constructor + * @param {google.api.servicemanagement.v1.IListServiceRolloutsRequest=} [properties] Properties to set + */ + function ListServiceRolloutsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServiceRolloutsRequest serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @instance + */ + ListServiceRolloutsRequest.prototype.serviceName = ""; + + /** + * ListServiceRolloutsRequest pageToken. + * @member {string} pageToken + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @instance + */ + ListServiceRolloutsRequest.prototype.pageToken = ""; + + /** + * ListServiceRolloutsRequest pageSize. + * @member {number} pageSize + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @instance + */ + ListServiceRolloutsRequest.prototype.pageSize = 0; + + /** + * ListServiceRolloutsRequest filter. + * @member {string} filter + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @instance + */ + ListServiceRolloutsRequest.prototype.filter = ""; + + /** + * Creates a new ListServiceRolloutsRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @static + * @param {google.api.servicemanagement.v1.IListServiceRolloutsRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.ListServiceRolloutsRequest} ListServiceRolloutsRequest instance + */ + ListServiceRolloutsRequest.create = function create(properties) { + return new ListServiceRolloutsRequest(properties); + }; + + /** + * Encodes the specified ListServiceRolloutsRequest message. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceRolloutsRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @static + * @param {google.api.servicemanagement.v1.IListServiceRolloutsRequest} message ListServiceRolloutsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceRolloutsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListServiceRolloutsRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceRolloutsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @static + * @param {google.api.servicemanagement.v1.IListServiceRolloutsRequest} message ListServiceRolloutsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceRolloutsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServiceRolloutsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.ListServiceRolloutsRequest} ListServiceRolloutsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceRolloutsRequest.decode = function 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.servicemanagement.v1.ListServiceRolloutsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServiceRolloutsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.ListServiceRolloutsRequest} ListServiceRolloutsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceRolloutsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServiceRolloutsRequest message. + * @function verify + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServiceRolloutsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListServiceRolloutsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.ListServiceRolloutsRequest} ListServiceRolloutsRequest + */ + ListServiceRolloutsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.ListServiceRolloutsRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.ListServiceRolloutsRequest(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListServiceRolloutsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @static + * @param {google.api.servicemanagement.v1.ListServiceRolloutsRequest} message ListServiceRolloutsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServiceRolloutsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.pageToken = ""; + object.pageSize = 0; + object.filter = ""; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListServiceRolloutsRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @instance + * @returns {Object.} JSON object + */ + ListServiceRolloutsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServiceRolloutsRequest + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServiceRolloutsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.ListServiceRolloutsRequest"; + }; + + return ListServiceRolloutsRequest; + })(); + + v1.ListServiceRolloutsResponse = (function() { + + /** + * Properties of a ListServiceRolloutsResponse. + * @memberof google.api.servicemanagement.v1 + * @interface IListServiceRolloutsResponse + * @property {Array.|null} [rollouts] ListServiceRolloutsResponse rollouts + * @property {string|null} [nextPageToken] ListServiceRolloutsResponse nextPageToken + */ + + /** + * Constructs a new ListServiceRolloutsResponse. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a ListServiceRolloutsResponse. + * @implements IListServiceRolloutsResponse + * @constructor + * @param {google.api.servicemanagement.v1.IListServiceRolloutsResponse=} [properties] Properties to set + */ + function ListServiceRolloutsResponse(properties) { + this.rollouts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServiceRolloutsResponse rollouts. + * @member {Array.} rollouts + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @instance + */ + ListServiceRolloutsResponse.prototype.rollouts = $util.emptyArray; + + /** + * ListServiceRolloutsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @instance + */ + ListServiceRolloutsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListServiceRolloutsResponse instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @static + * @param {google.api.servicemanagement.v1.IListServiceRolloutsResponse=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.ListServiceRolloutsResponse} ListServiceRolloutsResponse instance + */ + ListServiceRolloutsResponse.create = function create(properties) { + return new ListServiceRolloutsResponse(properties); + }; + + /** + * Encodes the specified ListServiceRolloutsResponse message. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceRolloutsResponse.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @static + * @param {google.api.servicemanagement.v1.IListServiceRolloutsResponse} message ListServiceRolloutsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceRolloutsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rollouts != null && message.rollouts.length) + for (var i = 0; i < message.rollouts.length; ++i) + $root.google.api.servicemanagement.v1.Rollout.encode(message.rollouts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListServiceRolloutsResponse message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.ListServiceRolloutsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @static + * @param {google.api.servicemanagement.v1.IListServiceRolloutsResponse} message ListServiceRolloutsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceRolloutsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServiceRolloutsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.ListServiceRolloutsResponse} ListServiceRolloutsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceRolloutsResponse.decode = function 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.servicemanagement.v1.ListServiceRolloutsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rollouts && message.rollouts.length)) + message.rollouts = []; + message.rollouts.push($root.google.api.servicemanagement.v1.Rollout.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServiceRolloutsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.ListServiceRolloutsResponse} ListServiceRolloutsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceRolloutsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServiceRolloutsResponse message. + * @function verify + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServiceRolloutsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rollouts != null && message.hasOwnProperty("rollouts")) { + if (!Array.isArray(message.rollouts)) + return "rollouts: array expected"; + for (var i = 0; i < message.rollouts.length; ++i) { + var error = $root.google.api.servicemanagement.v1.Rollout.verify(message.rollouts[i]); + if (error) + return "rollouts." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListServiceRolloutsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.ListServiceRolloutsResponse} ListServiceRolloutsResponse + */ + ListServiceRolloutsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.ListServiceRolloutsResponse) + return object; + var message = new $root.google.api.servicemanagement.v1.ListServiceRolloutsResponse(); + if (object.rollouts) { + if (!Array.isArray(object.rollouts)) + throw TypeError(".google.api.servicemanagement.v1.ListServiceRolloutsResponse.rollouts: array expected"); + message.rollouts = []; + for (var i = 0; i < object.rollouts.length; ++i) { + if (typeof object.rollouts[i] !== "object") + throw TypeError(".google.api.servicemanagement.v1.ListServiceRolloutsResponse.rollouts: object expected"); + message.rollouts[i] = $root.google.api.servicemanagement.v1.Rollout.fromObject(object.rollouts[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListServiceRolloutsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @static + * @param {google.api.servicemanagement.v1.ListServiceRolloutsResponse} message ListServiceRolloutsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServiceRolloutsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rollouts = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.rollouts && message.rollouts.length) { + object.rollouts = []; + for (var j = 0; j < message.rollouts.length; ++j) + object.rollouts[j] = $root.google.api.servicemanagement.v1.Rollout.toObject(message.rollouts[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListServiceRolloutsResponse to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @instance + * @returns {Object.} JSON object + */ + ListServiceRolloutsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServiceRolloutsResponse + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.ListServiceRolloutsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServiceRolloutsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.ListServiceRolloutsResponse"; + }; + + return ListServiceRolloutsResponse; + })(); + + v1.GetServiceRolloutRequest = (function() { + + /** + * Properties of a GetServiceRolloutRequest. + * @memberof google.api.servicemanagement.v1 + * @interface IGetServiceRolloutRequest + * @property {string|null} [serviceName] GetServiceRolloutRequest serviceName + * @property {string|null} [rolloutId] GetServiceRolloutRequest rolloutId + */ + + /** + * Constructs a new GetServiceRolloutRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a GetServiceRolloutRequest. + * @implements IGetServiceRolloutRequest + * @constructor + * @param {google.api.servicemanagement.v1.IGetServiceRolloutRequest=} [properties] Properties to set + */ + function GetServiceRolloutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetServiceRolloutRequest serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @instance + */ + GetServiceRolloutRequest.prototype.serviceName = ""; + + /** + * GetServiceRolloutRequest rolloutId. + * @member {string} rolloutId + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @instance + */ + GetServiceRolloutRequest.prototype.rolloutId = ""; + + /** + * Creates a new GetServiceRolloutRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @static + * @param {google.api.servicemanagement.v1.IGetServiceRolloutRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.GetServiceRolloutRequest} GetServiceRolloutRequest instance + */ + GetServiceRolloutRequest.create = function create(properties) { + return new GetServiceRolloutRequest(properties); + }; + + /** + * Encodes the specified GetServiceRolloutRequest message. Does not implicitly {@link google.api.servicemanagement.v1.GetServiceRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @static + * @param {google.api.servicemanagement.v1.IGetServiceRolloutRequest} message GetServiceRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceRolloutRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.rolloutId != null && Object.hasOwnProperty.call(message, "rolloutId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rolloutId); + return writer; + }; + + /** + * Encodes the specified GetServiceRolloutRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.GetServiceRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @static + * @param {google.api.servicemanagement.v1.IGetServiceRolloutRequest} message GetServiceRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetServiceRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.GetServiceRolloutRequest} GetServiceRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceRolloutRequest.decode = function 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.servicemanagement.v1.GetServiceRolloutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.rolloutId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetServiceRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.GetServiceRolloutRequest} GetServiceRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetServiceRolloutRequest message. + * @function verify + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetServiceRolloutRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.rolloutId != null && message.hasOwnProperty("rolloutId")) + if (!$util.isString(message.rolloutId)) + return "rolloutId: string expected"; + return null; + }; + + /** + * Creates a GetServiceRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.GetServiceRolloutRequest} GetServiceRolloutRequest + */ + GetServiceRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.GetServiceRolloutRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.GetServiceRolloutRequest(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.rolloutId != null) + message.rolloutId = String(object.rolloutId); + return message; + }; + + /** + * Creates a plain object from a GetServiceRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @static + * @param {google.api.servicemanagement.v1.GetServiceRolloutRequest} message GetServiceRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetServiceRolloutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.rolloutId = ""; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.rolloutId != null && message.hasOwnProperty("rolloutId")) + object.rolloutId = message.rolloutId; + return object; + }; + + /** + * Converts this GetServiceRolloutRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + GetServiceRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetServiceRolloutRequest + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.GetServiceRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetServiceRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.GetServiceRolloutRequest"; + }; + + return GetServiceRolloutRequest; + })(); + + v1.GenerateConfigReportRequest = (function() { + + /** + * Properties of a GenerateConfigReportRequest. + * @memberof google.api.servicemanagement.v1 + * @interface IGenerateConfigReportRequest + * @property {google.protobuf.IAny|null} [newConfig] GenerateConfigReportRequest newConfig + * @property {google.protobuf.IAny|null} [oldConfig] GenerateConfigReportRequest oldConfig + */ + + /** + * Constructs a new GenerateConfigReportRequest. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a GenerateConfigReportRequest. + * @implements IGenerateConfigReportRequest + * @constructor + * @param {google.api.servicemanagement.v1.IGenerateConfigReportRequest=} [properties] Properties to set + */ + function GenerateConfigReportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateConfigReportRequest newConfig. + * @member {google.protobuf.IAny|null|undefined} newConfig + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @instance + */ + GenerateConfigReportRequest.prototype.newConfig = null; + + /** + * GenerateConfigReportRequest oldConfig. + * @member {google.protobuf.IAny|null|undefined} oldConfig + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @instance + */ + GenerateConfigReportRequest.prototype.oldConfig = null; + + /** + * Creates a new GenerateConfigReportRequest instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @static + * @param {google.api.servicemanagement.v1.IGenerateConfigReportRequest=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.GenerateConfigReportRequest} GenerateConfigReportRequest instance + */ + GenerateConfigReportRequest.create = function create(properties) { + return new GenerateConfigReportRequest(properties); + }; + + /** + * Encodes the specified GenerateConfigReportRequest message. Does not implicitly {@link google.api.servicemanagement.v1.GenerateConfigReportRequest.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @static + * @param {google.api.servicemanagement.v1.IGenerateConfigReportRequest} message GenerateConfigReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConfigReportRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.newConfig != null && Object.hasOwnProperty.call(message, "newConfig")) + $root.google.protobuf.Any.encode(message.newConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.oldConfig != null && Object.hasOwnProperty.call(message, "oldConfig")) + $root.google.protobuf.Any.encode(message.oldConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateConfigReportRequest message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.GenerateConfigReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @static + * @param {google.api.servicemanagement.v1.IGenerateConfigReportRequest} message GenerateConfigReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConfigReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateConfigReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.GenerateConfigReportRequest} GenerateConfigReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConfigReportRequest.decode = function 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.servicemanagement.v1.GenerateConfigReportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.newConfig = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 2: { + message.oldConfig = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateConfigReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.GenerateConfigReportRequest} GenerateConfigReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConfigReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateConfigReportRequest message. + * @function verify + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateConfigReportRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.newConfig != null && message.hasOwnProperty("newConfig")) { + var error = $root.google.protobuf.Any.verify(message.newConfig); + if (error) + return "newConfig." + error; + } + if (message.oldConfig != null && message.hasOwnProperty("oldConfig")) { + var error = $root.google.protobuf.Any.verify(message.oldConfig); + if (error) + return "oldConfig." + error; + } + return null; + }; + + /** + * Creates a GenerateConfigReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.GenerateConfigReportRequest} GenerateConfigReportRequest + */ + GenerateConfigReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.GenerateConfigReportRequest) + return object; + var message = new $root.google.api.servicemanagement.v1.GenerateConfigReportRequest(); + if (object.newConfig != null) { + if (typeof object.newConfig !== "object") + throw TypeError(".google.api.servicemanagement.v1.GenerateConfigReportRequest.newConfig: object expected"); + message.newConfig = $root.google.protobuf.Any.fromObject(object.newConfig); + } + if (object.oldConfig != null) { + if (typeof object.oldConfig !== "object") + throw TypeError(".google.api.servicemanagement.v1.GenerateConfigReportRequest.oldConfig: object expected"); + message.oldConfig = $root.google.protobuf.Any.fromObject(object.oldConfig); + } + return message; + }; + + /** + * Creates a plain object from a GenerateConfigReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @static + * @param {google.api.servicemanagement.v1.GenerateConfigReportRequest} message GenerateConfigReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateConfigReportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.newConfig = null; + object.oldConfig = null; + } + if (message.newConfig != null && message.hasOwnProperty("newConfig")) + object.newConfig = $root.google.protobuf.Any.toObject(message.newConfig, options); + if (message.oldConfig != null && message.hasOwnProperty("oldConfig")) + object.oldConfig = $root.google.protobuf.Any.toObject(message.oldConfig, options); + return object; + }; + + /** + * Converts this GenerateConfigReportRequest to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateConfigReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateConfigReportRequest + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.GenerateConfigReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateConfigReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.GenerateConfigReportRequest"; + }; + + return GenerateConfigReportRequest; + })(); + + v1.GenerateConfigReportResponse = (function() { + + /** + * Properties of a GenerateConfigReportResponse. + * @memberof google.api.servicemanagement.v1 + * @interface IGenerateConfigReportResponse + * @property {string|null} [serviceName] GenerateConfigReportResponse serviceName + * @property {string|null} [id] GenerateConfigReportResponse id + * @property {Array.|null} [changeReports] GenerateConfigReportResponse changeReports + * @property {Array.|null} [diagnostics] GenerateConfigReportResponse diagnostics + */ + + /** + * Constructs a new GenerateConfigReportResponse. + * @memberof google.api.servicemanagement.v1 + * @classdesc Represents a GenerateConfigReportResponse. + * @implements IGenerateConfigReportResponse + * @constructor + * @param {google.api.servicemanagement.v1.IGenerateConfigReportResponse=} [properties] Properties to set + */ + function GenerateConfigReportResponse(properties) { + this.changeReports = []; + this.diagnostics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateConfigReportResponse serviceName. + * @member {string} serviceName + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @instance + */ + GenerateConfigReportResponse.prototype.serviceName = ""; + + /** + * GenerateConfigReportResponse id. + * @member {string} id + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @instance + */ + GenerateConfigReportResponse.prototype.id = ""; + + /** + * GenerateConfigReportResponse changeReports. + * @member {Array.} changeReports + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @instance + */ + GenerateConfigReportResponse.prototype.changeReports = $util.emptyArray; + + /** + * GenerateConfigReportResponse diagnostics. + * @member {Array.} diagnostics + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @instance + */ + GenerateConfigReportResponse.prototype.diagnostics = $util.emptyArray; + + /** + * Creates a new GenerateConfigReportResponse instance using the specified properties. + * @function create + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @static + * @param {google.api.servicemanagement.v1.IGenerateConfigReportResponse=} [properties] Properties to set + * @returns {google.api.servicemanagement.v1.GenerateConfigReportResponse} GenerateConfigReportResponse instance + */ + GenerateConfigReportResponse.create = function create(properties) { + return new GenerateConfigReportResponse(properties); + }; + + /** + * Encodes the specified GenerateConfigReportResponse message. Does not implicitly {@link google.api.servicemanagement.v1.GenerateConfigReportResponse.verify|verify} messages. + * @function encode + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @static + * @param {google.api.servicemanagement.v1.IGenerateConfigReportResponse} message GenerateConfigReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConfigReportResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.changeReports != null && message.changeReports.length) + for (var i = 0; i < message.changeReports.length; ++i) + $root.google.api.servicemanagement.v1.ChangeReport.encode(message.changeReports[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.diagnostics != null && message.diagnostics.length) + for (var i = 0; i < message.diagnostics.length; ++i) + $root.google.api.servicemanagement.v1.Diagnostic.encode(message.diagnostics[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateConfigReportResponse message, length delimited. Does not implicitly {@link google.api.servicemanagement.v1.GenerateConfigReportResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @static + * @param {google.api.servicemanagement.v1.IGenerateConfigReportResponse} message GenerateConfigReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateConfigReportResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateConfigReportResponse message from the specified reader or buffer. + * @function decode + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.servicemanagement.v1.GenerateConfigReportResponse} GenerateConfigReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConfigReportResponse.decode = function 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.servicemanagement.v1.GenerateConfigReportResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + if (!(message.changeReports && message.changeReports.length)) + message.changeReports = []; + message.changeReports.push($root.google.api.servicemanagement.v1.ChangeReport.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.diagnostics && message.diagnostics.length)) + message.diagnostics = []; + message.diagnostics.push($root.google.api.servicemanagement.v1.Diagnostic.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateConfigReportResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.servicemanagement.v1.GenerateConfigReportResponse} GenerateConfigReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateConfigReportResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateConfigReportResponse message. + * @function verify + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateConfigReportResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.changeReports != null && message.hasOwnProperty("changeReports")) { + if (!Array.isArray(message.changeReports)) + return "changeReports: array expected"; + for (var i = 0; i < message.changeReports.length; ++i) { + var error = $root.google.api.servicemanagement.v1.ChangeReport.verify(message.changeReports[i]); + if (error) + return "changeReports." + error; + } + } + if (message.diagnostics != null && message.hasOwnProperty("diagnostics")) { + if (!Array.isArray(message.diagnostics)) + return "diagnostics: array expected"; + for (var i = 0; i < message.diagnostics.length; ++i) { + var error = $root.google.api.servicemanagement.v1.Diagnostic.verify(message.diagnostics[i]); + if (error) + return "diagnostics." + error; + } + } + return null; + }; + + /** + * Creates a GenerateConfigReportResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @static + * @param {Object.} object Plain object + * @returns {google.api.servicemanagement.v1.GenerateConfigReportResponse} GenerateConfigReportResponse + */ + GenerateConfigReportResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.servicemanagement.v1.GenerateConfigReportResponse) + return object; + var message = new $root.google.api.servicemanagement.v1.GenerateConfigReportResponse(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.id != null) + message.id = String(object.id); + if (object.changeReports) { + if (!Array.isArray(object.changeReports)) + throw TypeError(".google.api.servicemanagement.v1.GenerateConfigReportResponse.changeReports: array expected"); + message.changeReports = []; + for (var i = 0; i < object.changeReports.length; ++i) { + if (typeof object.changeReports[i] !== "object") + throw TypeError(".google.api.servicemanagement.v1.GenerateConfigReportResponse.changeReports: object expected"); + message.changeReports[i] = $root.google.api.servicemanagement.v1.ChangeReport.fromObject(object.changeReports[i]); + } + } + if (object.diagnostics) { + if (!Array.isArray(object.diagnostics)) + throw TypeError(".google.api.servicemanagement.v1.GenerateConfigReportResponse.diagnostics: array expected"); + message.diagnostics = []; + for (var i = 0; i < object.diagnostics.length; ++i) { + if (typeof object.diagnostics[i] !== "object") + throw TypeError(".google.api.servicemanagement.v1.GenerateConfigReportResponse.diagnostics: object expected"); + message.diagnostics[i] = $root.google.api.servicemanagement.v1.Diagnostic.fromObject(object.diagnostics[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenerateConfigReportResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @static + * @param {google.api.servicemanagement.v1.GenerateConfigReportResponse} message GenerateConfigReportResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateConfigReportResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.changeReports = []; + object.diagnostics = []; + } + if (options.defaults) { + object.serviceName = ""; + object.id = ""; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.changeReports && message.changeReports.length) { + object.changeReports = []; + for (var j = 0; j < message.changeReports.length; ++j) + object.changeReports[j] = $root.google.api.servicemanagement.v1.ChangeReport.toObject(message.changeReports[j], options); + } + if (message.diagnostics && message.diagnostics.length) { + object.diagnostics = []; + for (var j = 0; j < message.diagnostics.length; ++j) + object.diagnostics[j] = $root.google.api.servicemanagement.v1.Diagnostic.toObject(message.diagnostics[j], options); + } + return object; + }; + + /** + * Converts this GenerateConfigReportResponse to JSON. + * @function toJSON + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateConfigReportResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateConfigReportResponse + * @function getTypeUrl + * @memberof google.api.servicemanagement.v1.GenerateConfigReportResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateConfigReportResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.servicemanagement.v1.GenerateConfigReportResponse"; + }; + + return GenerateConfigReportResponse; + })(); + + return v1; + })(); + + return servicemanagement; + })(); + + api.ConfigChange = (function() { + + /** + * Properties of a ConfigChange. + * @memberof google.api + * @interface IConfigChange + * @property {string|null} [element] ConfigChange element + * @property {string|null} [oldValue] ConfigChange oldValue + * @property {string|null} [newValue] ConfigChange newValue + * @property {google.api.ChangeType|null} [changeType] ConfigChange changeType + * @property {Array.|null} [advices] ConfigChange advices + */ + + /** + * Constructs a new ConfigChange. + * @memberof google.api + * @classdesc Represents a ConfigChange. + * @implements IConfigChange + * @constructor + * @param {google.api.IConfigChange=} [properties] Properties to set + */ + function ConfigChange(properties) { + this.advices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfigChange element. + * @member {string} element + * @memberof google.api.ConfigChange + * @instance + */ + ConfigChange.prototype.element = ""; + + /** + * ConfigChange oldValue. + * @member {string} oldValue + * @memberof google.api.ConfigChange + * @instance + */ + ConfigChange.prototype.oldValue = ""; + + /** + * ConfigChange newValue. + * @member {string} newValue + * @memberof google.api.ConfigChange + * @instance + */ + ConfigChange.prototype.newValue = ""; + + /** + * ConfigChange changeType. + * @member {google.api.ChangeType} changeType + * @memberof google.api.ConfigChange + * @instance + */ + ConfigChange.prototype.changeType = 0; + + /** + * ConfigChange advices. + * @member {Array.} advices + * @memberof google.api.ConfigChange + * @instance + */ + ConfigChange.prototype.advices = $util.emptyArray; + + /** + * Creates a new ConfigChange instance using the specified properties. + * @function create + * @memberof google.api.ConfigChange + * @static + * @param {google.api.IConfigChange=} [properties] Properties to set + * @returns {google.api.ConfigChange} ConfigChange instance + */ + ConfigChange.create = function create(properties) { + return new ConfigChange(properties); + }; + + /** + * Encodes the specified ConfigChange message. Does not implicitly {@link google.api.ConfigChange.verify|verify} messages. + * @function encode + * @memberof google.api.ConfigChange + * @static + * @param {google.api.IConfigChange} message ConfigChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigChange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.element != null && Object.hasOwnProperty.call(message, "element")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.element); + if (message.oldValue != null && Object.hasOwnProperty.call(message, "oldValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.oldValue); + if (message.newValue != null && Object.hasOwnProperty.call(message, "newValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.newValue); + if (message.changeType != null && Object.hasOwnProperty.call(message, "changeType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.changeType); + if (message.advices != null && message.advices.length) + for (var i = 0; i < message.advices.length; ++i) + $root.google.api.Advice.encode(message.advices[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConfigChange message, length delimited. Does not implicitly {@link google.api.ConfigChange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ConfigChange + * @static + * @param {google.api.IConfigChange} message ConfigChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigChange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfigChange message from the specified reader or buffer. + * @function decode + * @memberof google.api.ConfigChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ConfigChange} ConfigChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigChange.decode = function 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.ConfigChange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.element = reader.string(); + break; + } + case 2: { + message.oldValue = reader.string(); + break; + } + case 3: { + message.newValue = reader.string(); + break; + } + case 4: { + message.changeType = reader.int32(); + break; + } + case 5: { + if (!(message.advices && message.advices.length)) + message.advices = []; + message.advices.push($root.google.api.Advice.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfigChange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ConfigChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ConfigChange} ConfigChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigChange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfigChange message. + * @function verify + * @memberof google.api.ConfigChange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfigChange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.element != null && message.hasOwnProperty("element")) + if (!$util.isString(message.element)) + return "element: string expected"; + if (message.oldValue != null && message.hasOwnProperty("oldValue")) + if (!$util.isString(message.oldValue)) + return "oldValue: string expected"; + if (message.newValue != null && message.hasOwnProperty("newValue")) + if (!$util.isString(message.newValue)) + return "newValue: string expected"; + if (message.changeType != null && message.hasOwnProperty("changeType")) + switch (message.changeType) { + default: + return "changeType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.advices != null && message.hasOwnProperty("advices")) { + if (!Array.isArray(message.advices)) + return "advices: array expected"; + for (var i = 0; i < message.advices.length; ++i) { + var error = $root.google.api.Advice.verify(message.advices[i]); + if (error) + return "advices." + error; + } + } + return null; + }; + + /** + * Creates a ConfigChange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ConfigChange + * @static + * @param {Object.} object Plain object + * @returns {google.api.ConfigChange} ConfigChange + */ + ConfigChange.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ConfigChange) + return object; + var message = new $root.google.api.ConfigChange(); + if (object.element != null) + message.element = String(object.element); + if (object.oldValue != null) + message.oldValue = String(object.oldValue); + if (object.newValue != null) + message.newValue = String(object.newValue); + switch (object.changeType) { + default: + if (typeof object.changeType === "number") { + message.changeType = object.changeType; + break; + } + break; + case "CHANGE_TYPE_UNSPECIFIED": + case 0: + message.changeType = 0; + break; + case "ADDED": + case 1: + message.changeType = 1; + break; + case "REMOVED": + case 2: + message.changeType = 2; + break; + case "MODIFIED": + case 3: + message.changeType = 3; + break; + } + if (object.advices) { + if (!Array.isArray(object.advices)) + throw TypeError(".google.api.ConfigChange.advices: array expected"); + message.advices = []; + for (var i = 0; i < object.advices.length; ++i) { + if (typeof object.advices[i] !== "object") + throw TypeError(".google.api.ConfigChange.advices: object expected"); + message.advices[i] = $root.google.api.Advice.fromObject(object.advices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConfigChange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ConfigChange + * @static + * @param {google.api.ConfigChange} message ConfigChange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfigChange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.advices = []; + if (options.defaults) { + object.element = ""; + object.oldValue = ""; + object.newValue = ""; + object.changeType = options.enums === String ? "CHANGE_TYPE_UNSPECIFIED" : 0; + } + if (message.element != null && message.hasOwnProperty("element")) + object.element = message.element; + if (message.oldValue != null && message.hasOwnProperty("oldValue")) + object.oldValue = message.oldValue; + if (message.newValue != null && message.hasOwnProperty("newValue")) + object.newValue = message.newValue; + if (message.changeType != null && message.hasOwnProperty("changeType")) + object.changeType = options.enums === String ? $root.google.api.ChangeType[message.changeType] === undefined ? message.changeType : $root.google.api.ChangeType[message.changeType] : message.changeType; + if (message.advices && message.advices.length) { + object.advices = []; + for (var j = 0; j < message.advices.length; ++j) + object.advices[j] = $root.google.api.Advice.toObject(message.advices[j], options); + } + return object; + }; + + /** + * Converts this ConfigChange to JSON. + * @function toJSON + * @memberof google.api.ConfigChange + * @instance + * @returns {Object.} JSON object + */ + ConfigChange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfigChange + * @function getTypeUrl + * @memberof google.api.ConfigChange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfigChange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ConfigChange"; + }; + + return ConfigChange; + })(); + + api.Advice = (function() { + + /** + * Properties of an Advice. + * @memberof google.api + * @interface IAdvice + * @property {string|null} [description] Advice description + */ + + /** + * Constructs a new Advice. + * @memberof google.api + * @classdesc Represents an Advice. + * @implements IAdvice + * @constructor + * @param {google.api.IAdvice=} [properties] Properties to set + */ + function Advice(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Advice description. + * @member {string} description + * @memberof google.api.Advice + * @instance + */ + Advice.prototype.description = ""; + + /** + * Creates a new Advice instance using the specified properties. + * @function create + * @memberof google.api.Advice + * @static + * @param {google.api.IAdvice=} [properties] Properties to set + * @returns {google.api.Advice} Advice instance + */ + Advice.create = function create(properties) { + return new Advice(properties); + }; + + /** + * Encodes the specified Advice message. Does not implicitly {@link google.api.Advice.verify|verify} messages. + * @function encode + * @memberof google.api.Advice + * @static + * @param {google.api.IAdvice} message Advice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Advice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified Advice message, length delimited. Does not implicitly {@link google.api.Advice.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Advice + * @static + * @param {google.api.IAdvice} message Advice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Advice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Advice message from the specified reader or buffer. + * @function decode + * @memberof google.api.Advice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Advice} Advice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Advice.decode = function 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.Advice(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Advice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Advice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Advice} Advice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Advice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Advice message. + * @function verify + * @memberof google.api.Advice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Advice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an Advice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Advice + * @static + * @param {Object.} object Plain object + * @returns {google.api.Advice} Advice + */ + Advice.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Advice) + return object; + var message = new $root.google.api.Advice(); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an Advice message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Advice + * @static + * @param {google.api.Advice} message Advice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Advice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.description = ""; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Advice to JSON. + * @function toJSON + * @memberof google.api.Advice + * @instance + * @returns {Object.} JSON object + */ + Advice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Advice + * @function getTypeUrl + * @memberof google.api.Advice + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Advice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Advice"; + }; + + return Advice; + })(); + + /** + * ChangeType enum. + * @name google.api.ChangeType + * @enum {number} + * @property {number} CHANGE_TYPE_UNSPECIFIED=0 CHANGE_TYPE_UNSPECIFIED value + * @property {number} ADDED=1 ADDED value + * @property {number} REMOVED=2 REMOVED value + * @property {number} MODIFIED=3 MODIFIED value + */ + api.ChangeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADDED"] = 1; + values[valuesById[2] = "REMOVED"] = 2; + values[valuesById[3] = "MODIFIED"] = 3; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + 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.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; + })(); + + api.Service = (function() { + + /** + * Properties of a Service. + * @memberof google.api + * @interface IService + * @property {string|null} [name] Service name + * @property {string|null} [title] Service title + * @property {string|null} [producerProjectId] Service producerProjectId + * @property {string|null} [id] Service id + * @property {Array.|null} [apis] Service apis + * @property {Array.|null} [types] Service types + * @property {Array.|null} [enums] Service enums + * @property {google.api.IDocumentation|null} [documentation] Service documentation + * @property {google.api.IBackend|null} [backend] Service backend + * @property {google.api.IHttp|null} [http] Service http + * @property {google.api.IQuota|null} [quota] Service quota + * @property {google.api.IAuthentication|null} [authentication] Service authentication + * @property {google.api.IContext|null} [context] Service context + * @property {google.api.IUsage|null} [usage] Service usage + * @property {Array.|null} [endpoints] Service endpoints + * @property {google.api.IControl|null} [control] Service control + * @property {Array.|null} [logs] Service logs + * @property {Array.|null} [metrics] Service metrics + * @property {Array.|null} [monitoredResources] Service monitoredResources + * @property {google.api.IBilling|null} [billing] Service billing + * @property {google.api.ILogging|null} [logging] Service logging + * @property {google.api.IMonitoring|null} [monitoring] Service monitoring + * @property {google.api.ISystemParameters|null} [systemParameters] Service systemParameters + * @property {google.api.ISourceInfo|null} [sourceInfo] Service sourceInfo + * @property {google.protobuf.IUInt32Value|null} [configVersion] Service configVersion + */ + + /** + * Constructs a new Service. + * @memberof google.api + * @classdesc Represents a Service. + * @implements IService + * @constructor + * @param {google.api.IService=} [properties] Properties to set + */ + function Service(properties) { + this.apis = []; + this.types = []; + this.enums = []; + this.endpoints = []; + this.logs = []; + this.metrics = []; + this.monitoredResources = []; + if (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.api.Service + * @instance + */ + Service.prototype.name = ""; + + /** + * Service title. + * @member {string} title + * @memberof google.api.Service + * @instance + */ + Service.prototype.title = ""; + + /** + * Service producerProjectId. + * @member {string} producerProjectId + * @memberof google.api.Service + * @instance + */ + Service.prototype.producerProjectId = ""; + + /** + * Service id. + * @member {string} id + * @memberof google.api.Service + * @instance + */ + Service.prototype.id = ""; + + /** + * Service apis. + * @member {Array.} apis + * @memberof google.api.Service + * @instance + */ + Service.prototype.apis = $util.emptyArray; + + /** + * Service types. + * @member {Array.} types + * @memberof google.api.Service + * @instance + */ + Service.prototype.types = $util.emptyArray; + + /** + * Service enums. + * @member {Array.} enums + * @memberof google.api.Service + * @instance + */ + Service.prototype.enums = $util.emptyArray; + + /** + * Service documentation. + * @member {google.api.IDocumentation|null|undefined} documentation + * @memberof google.api.Service + * @instance + */ + Service.prototype.documentation = null; + + /** + * Service backend. + * @member {google.api.IBackend|null|undefined} backend + * @memberof google.api.Service + * @instance + */ + Service.prototype.backend = null; + + /** + * Service http. + * @member {google.api.IHttp|null|undefined} http + * @memberof google.api.Service + * @instance + */ + Service.prototype.http = null; + + /** + * Service quota. + * @member {google.api.IQuota|null|undefined} quota + * @memberof google.api.Service + * @instance + */ + Service.prototype.quota = null; + + /** + * Service authentication. + * @member {google.api.IAuthentication|null|undefined} authentication + * @memberof google.api.Service + * @instance + */ + Service.prototype.authentication = null; + + /** + * Service context. + * @member {google.api.IContext|null|undefined} context + * @memberof google.api.Service + * @instance + */ + Service.prototype.context = null; + + /** + * Service usage. + * @member {google.api.IUsage|null|undefined} usage + * @memberof google.api.Service + * @instance + */ + Service.prototype.usage = null; + + /** + * Service endpoints. + * @member {Array.} endpoints + * @memberof google.api.Service + * @instance + */ + Service.prototype.endpoints = $util.emptyArray; + + /** + * Service control. + * @member {google.api.IControl|null|undefined} control + * @memberof google.api.Service + * @instance + */ + Service.prototype.control = null; + + /** + * Service logs. + * @member {Array.} logs + * @memberof google.api.Service + * @instance + */ + Service.prototype.logs = $util.emptyArray; + + /** + * Service metrics. + * @member {Array.} metrics + * @memberof google.api.Service + * @instance + */ + Service.prototype.metrics = $util.emptyArray; + + /** + * Service monitoredResources. + * @member {Array.} monitoredResources + * @memberof google.api.Service + * @instance + */ + Service.prototype.monitoredResources = $util.emptyArray; + + /** + * Service billing. + * @member {google.api.IBilling|null|undefined} billing + * @memberof google.api.Service + * @instance + */ + Service.prototype.billing = null; + + /** + * Service logging. + * @member {google.api.ILogging|null|undefined} logging + * @memberof google.api.Service + * @instance + */ + Service.prototype.logging = null; + + /** + * Service monitoring. + * @member {google.api.IMonitoring|null|undefined} monitoring + * @memberof google.api.Service + * @instance + */ + Service.prototype.monitoring = null; + + /** + * Service systemParameters. + * @member {google.api.ISystemParameters|null|undefined} systemParameters + * @memberof google.api.Service + * @instance + */ + Service.prototype.systemParameters = null; + + /** + * Service sourceInfo. + * @member {google.api.ISourceInfo|null|undefined} sourceInfo + * @memberof google.api.Service + * @instance + */ + Service.prototype.sourceInfo = null; + + /** + * Service configVersion. + * @member {google.protobuf.IUInt32Value|null|undefined} configVersion + * @memberof google.api.Service + * @instance + */ + Service.prototype.configVersion = null; + + /** + * Creates a new Service instance using the specified properties. + * @function create + * @memberof google.api.Service + * @static + * @param {google.api.IService=} [properties] Properties to set + * @returns {google.api.Service} Service instance + */ + Service.create = function create(properties) { + return new Service(properties); + }; + + /** + * Encodes the specified Service message. Does not implicitly {@link google.api.Service.verify|verify} messages. + * @function encode + * @memberof google.api.Service + * @static + * @param {google.api.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.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.apis != null && message.apis.length) + for (var i = 0; i < message.apis.length; ++i) + $root.google.protobuf.Api.encode(message.apis[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.types != null && message.types.length) + for (var i = 0; i < message.types.length; ++i) + $root.google.protobuf.Type.encode(message.types[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enums != null && message.enums.length) + for (var i = 0; i < message.enums.length; ++i) + $root.google.protobuf.Enum.encode(message.enums[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.api.Documentation.encode(message.documentation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.backend != null && Object.hasOwnProperty.call(message, "backend")) + $root.google.api.Backend.encode(message.backend, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.http != null && Object.hasOwnProperty.call(message, "http")) + $root.google.api.Http.encode(message.http, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.quota != null && Object.hasOwnProperty.call(message, "quota")) + $root.google.api.Quota.encode(message.quota, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.authentication != null && Object.hasOwnProperty.call(message, "authentication")) + $root.google.api.Authentication.encode(message.authentication, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.google.api.Context.encode(message.context, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.usage != null && Object.hasOwnProperty.call(message, "usage")) + $root.google.api.Usage.encode(message.usage, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.endpoints != null && message.endpoints.length) + for (var i = 0; i < message.endpoints.length; ++i) + $root.google.api.Endpoint.encode(message.endpoints[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.configVersion != null && Object.hasOwnProperty.call(message, "configVersion")) + $root.google.protobuf.UInt32Value.encode(message.configVersion, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.control != null && Object.hasOwnProperty.call(message, "control")) + $root.google.api.Control.encode(message.control, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.producerProjectId != null && Object.hasOwnProperty.call(message, "producerProjectId")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.producerProjectId); + if (message.logs != null && message.logs.length) + for (var i = 0; i < message.logs.length; ++i) + $root.google.api.LogDescriptor.encode(message.logs[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.api.MetricDescriptor.encode(message.metrics[i], writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.monitoredResources != null && message.monitoredResources.length) + for (var i = 0; i < message.monitoredResources.length; ++i) + $root.google.api.MonitoredResourceDescriptor.encode(message.monitoredResources[i], writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.billing != null && Object.hasOwnProperty.call(message, "billing")) + $root.google.api.Billing.encode(message.billing, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.logging != null && Object.hasOwnProperty.call(message, "logging")) + $root.google.api.Logging.encode(message.logging, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.monitoring != null && Object.hasOwnProperty.call(message, "monitoring")) + $root.google.api.Monitoring.encode(message.monitoring, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.systemParameters != null && Object.hasOwnProperty.call(message, "systemParameters")) + $root.google.api.SystemParameters.encode(message.systemParameters, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 33, wireType 2 =*/266).string(message.id); + if (message.sourceInfo != null && Object.hasOwnProperty.call(message, "sourceInfo")) + $root.google.api.SourceInfo.encode(message.sourceInfo, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.api.Service.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Service + * @static + * @param {google.api.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.api.Service + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.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.api.Service(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 22: { + message.producerProjectId = reader.string(); + break; + } + case 33: { + message.id = reader.string(); + break; + } + case 3: { + if (!(message.apis && message.apis.length)) + message.apis = []; + message.apis.push($root.google.protobuf.Api.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.types && message.types.length)) + message.types = []; + message.types.push($root.google.protobuf.Type.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enums && message.enums.length)) + message.enums = []; + message.enums.push($root.google.protobuf.Enum.decode(reader, reader.uint32())); + break; + } + case 6: { + message.documentation = $root.google.api.Documentation.decode(reader, reader.uint32()); + break; + } + case 8: { + message.backend = $root.google.api.Backend.decode(reader, reader.uint32()); + break; + } + case 9: { + message.http = $root.google.api.Http.decode(reader, reader.uint32()); + break; + } + case 10: { + message.quota = $root.google.api.Quota.decode(reader, reader.uint32()); + break; + } + case 11: { + message.authentication = $root.google.api.Authentication.decode(reader, reader.uint32()); + break; + } + case 12: { + message.context = $root.google.api.Context.decode(reader, reader.uint32()); + break; + } + case 15: { + message.usage = $root.google.api.Usage.decode(reader, reader.uint32()); + break; + } + case 18: { + if (!(message.endpoints && message.endpoints.length)) + message.endpoints = []; + message.endpoints.push($root.google.api.Endpoint.decode(reader, reader.uint32())); + break; + } + case 21: { + message.control = $root.google.api.Control.decode(reader, reader.uint32()); + break; + } + case 23: { + if (!(message.logs && message.logs.length)) + message.logs = []; + message.logs.push($root.google.api.LogDescriptor.decode(reader, reader.uint32())); + break; + } + case 24: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.api.MetricDescriptor.decode(reader, reader.uint32())); + break; + } + case 25: { + if (!(message.monitoredResources && message.monitoredResources.length)) + message.monitoredResources = []; + message.monitoredResources.push($root.google.api.MonitoredResourceDescriptor.decode(reader, reader.uint32())); + break; + } + case 26: { + message.billing = $root.google.api.Billing.decode(reader, reader.uint32()); + break; + } + case 27: { + message.logging = $root.google.api.Logging.decode(reader, reader.uint32()); + break; + } + case 28: { + message.monitoring = $root.google.api.Monitoring.decode(reader, reader.uint32()); + break; + } + case 29: { + message.systemParameters = $root.google.api.SystemParameters.decode(reader, reader.uint32()); + break; + } + case 37: { + message.sourceInfo = $root.google.api.SourceInfo.decode(reader, reader.uint32()); + break; + } + case 20: { + message.configVersion = $root.google.protobuf.UInt32Value.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.api.Service + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.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.api.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.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.producerProjectId != null && message.hasOwnProperty("producerProjectId")) + if (!$util.isString(message.producerProjectId)) + return "producerProjectId: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.apis != null && message.hasOwnProperty("apis")) { + if (!Array.isArray(message.apis)) + return "apis: array expected"; + for (var i = 0; i < message.apis.length; ++i) { + var error = $root.google.protobuf.Api.verify(message.apis[i]); + if (error) + return "apis." + error; + } + } + if (message.types != null && message.hasOwnProperty("types")) { + if (!Array.isArray(message.types)) + return "types: array expected"; + for (var i = 0; i < message.types.length; ++i) { + var error = $root.google.protobuf.Type.verify(message.types[i]); + if (error) + return "types." + error; + } + } + if (message.enums != null && message.hasOwnProperty("enums")) { + if (!Array.isArray(message.enums)) + return "enums: array expected"; + for (var i = 0; i < message.enums.length; ++i) { + var error = $root.google.protobuf.Enum.verify(message.enums[i]); + if (error) + return "enums." + error; + } + } + if (message.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.api.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.backend != null && message.hasOwnProperty("backend")) { + var error = $root.google.api.Backend.verify(message.backend); + if (error) + return "backend." + error; + } + if (message.http != null && message.hasOwnProperty("http")) { + var error = $root.google.api.Http.verify(message.http); + if (error) + return "http." + error; + } + if (message.quota != null && message.hasOwnProperty("quota")) { + var error = $root.google.api.Quota.verify(message.quota); + if (error) + return "quota." + error; + } + if (message.authentication != null && message.hasOwnProperty("authentication")) { + var error = $root.google.api.Authentication.verify(message.authentication); + if (error) + return "authentication." + error; + } + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.api.Context.verify(message.context); + if (error) + return "context." + error; + } + if (message.usage != null && message.hasOwnProperty("usage")) { + var error = $root.google.api.Usage.verify(message.usage); + if (error) + return "usage." + error; + } + if (message.endpoints != null && message.hasOwnProperty("endpoints")) { + if (!Array.isArray(message.endpoints)) + return "endpoints: array expected"; + for (var i = 0; i < message.endpoints.length; ++i) { + var error = $root.google.api.Endpoint.verify(message.endpoints[i]); + if (error) + return "endpoints." + error; + } + } + if (message.control != null && message.hasOwnProperty("control")) { + var error = $root.google.api.Control.verify(message.control); + if (error) + return "control." + error; + } + if (message.logs != null && message.hasOwnProperty("logs")) { + if (!Array.isArray(message.logs)) + return "logs: array expected"; + for (var i = 0; i < message.logs.length; ++i) { + var error = $root.google.api.LogDescriptor.verify(message.logs[i]); + if (error) + return "logs." + error; + } + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.api.MetricDescriptor.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + if (message.monitoredResources != null && message.hasOwnProperty("monitoredResources")) { + if (!Array.isArray(message.monitoredResources)) + return "monitoredResources: array expected"; + for (var i = 0; i < message.monitoredResources.length; ++i) { + var error = $root.google.api.MonitoredResourceDescriptor.verify(message.monitoredResources[i]); + if (error) + return "monitoredResources." + error; + } + } + if (message.billing != null && message.hasOwnProperty("billing")) { + var error = $root.google.api.Billing.verify(message.billing); + if (error) + return "billing." + error; + } + if (message.logging != null && message.hasOwnProperty("logging")) { + var error = $root.google.api.Logging.verify(message.logging); + if (error) + return "logging." + error; + } + if (message.monitoring != null && message.hasOwnProperty("monitoring")) { + var error = $root.google.api.Monitoring.verify(message.monitoring); + if (error) + return "monitoring." + error; + } + if (message.systemParameters != null && message.hasOwnProperty("systemParameters")) { + var error = $root.google.api.SystemParameters.verify(message.systemParameters); + if (error) + return "systemParameters." + error; + } + if (message.sourceInfo != null && message.hasOwnProperty("sourceInfo")) { + var error = $root.google.api.SourceInfo.verify(message.sourceInfo); + if (error) + return "sourceInfo." + error; + } + if (message.configVersion != null && message.hasOwnProperty("configVersion")) { + var error = $root.google.protobuf.UInt32Value.verify(message.configVersion); + if (error) + return "configVersion." + error; + } + return null; + }; + + /** + * Creates a Service message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Service + * @static + * @param {Object.} object Plain object + * @returns {google.api.Service} Service + */ + Service.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Service) + return object; + var message = new $root.google.api.Service(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + if (object.producerProjectId != null) + message.producerProjectId = String(object.producerProjectId); + if (object.id != null) + message.id = String(object.id); + if (object.apis) { + if (!Array.isArray(object.apis)) + throw TypeError(".google.api.Service.apis: array expected"); + message.apis = []; + for (var i = 0; i < object.apis.length; ++i) { + if (typeof object.apis[i] !== "object") + throw TypeError(".google.api.Service.apis: object expected"); + message.apis[i] = $root.google.protobuf.Api.fromObject(object.apis[i]); + } + } + if (object.types) { + if (!Array.isArray(object.types)) + throw TypeError(".google.api.Service.types: array expected"); + message.types = []; + for (var i = 0; i < object.types.length; ++i) { + if (typeof object.types[i] !== "object") + throw TypeError(".google.api.Service.types: object expected"); + message.types[i] = $root.google.protobuf.Type.fromObject(object.types[i]); + } + } + if (object.enums) { + if (!Array.isArray(object.enums)) + throw TypeError(".google.api.Service.enums: array expected"); + message.enums = []; + for (var i = 0; i < object.enums.length; ++i) { + if (typeof object.enums[i] !== "object") + throw TypeError(".google.api.Service.enums: object expected"); + message.enums[i] = $root.google.protobuf.Enum.fromObject(object.enums[i]); + } + } + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.api.Service.documentation: object expected"); + message.documentation = $root.google.api.Documentation.fromObject(object.documentation); + } + if (object.backend != null) { + if (typeof object.backend !== "object") + throw TypeError(".google.api.Service.backend: object expected"); + message.backend = $root.google.api.Backend.fromObject(object.backend); + } + if (object.http != null) { + if (typeof object.http !== "object") + throw TypeError(".google.api.Service.http: object expected"); + message.http = $root.google.api.Http.fromObject(object.http); + } + if (object.quota != null) { + if (typeof object.quota !== "object") + throw TypeError(".google.api.Service.quota: object expected"); + message.quota = $root.google.api.Quota.fromObject(object.quota); + } + if (object.authentication != null) { + if (typeof object.authentication !== "object") + throw TypeError(".google.api.Service.authentication: object expected"); + message.authentication = $root.google.api.Authentication.fromObject(object.authentication); + } + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.api.Service.context: object expected"); + message.context = $root.google.api.Context.fromObject(object.context); + } + if (object.usage != null) { + if (typeof object.usage !== "object") + throw TypeError(".google.api.Service.usage: object expected"); + message.usage = $root.google.api.Usage.fromObject(object.usage); + } + if (object.endpoints) { + if (!Array.isArray(object.endpoints)) + throw TypeError(".google.api.Service.endpoints: array expected"); + message.endpoints = []; + for (var i = 0; i < object.endpoints.length; ++i) { + if (typeof object.endpoints[i] !== "object") + throw TypeError(".google.api.Service.endpoints: object expected"); + message.endpoints[i] = $root.google.api.Endpoint.fromObject(object.endpoints[i]); + } + } + if (object.control != null) { + if (typeof object.control !== "object") + throw TypeError(".google.api.Service.control: object expected"); + message.control = $root.google.api.Control.fromObject(object.control); + } + if (object.logs) { + if (!Array.isArray(object.logs)) + throw TypeError(".google.api.Service.logs: array expected"); + message.logs = []; + for (var i = 0; i < object.logs.length; ++i) { + if (typeof object.logs[i] !== "object") + throw TypeError(".google.api.Service.logs: object expected"); + message.logs[i] = $root.google.api.LogDescriptor.fromObject(object.logs[i]); + } + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.api.Service.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.api.Service.metrics: object expected"); + message.metrics[i] = $root.google.api.MetricDescriptor.fromObject(object.metrics[i]); + } + } + if (object.monitoredResources) { + if (!Array.isArray(object.monitoredResources)) + throw TypeError(".google.api.Service.monitoredResources: array expected"); + message.monitoredResources = []; + for (var i = 0; i < object.monitoredResources.length; ++i) { + if (typeof object.monitoredResources[i] !== "object") + throw TypeError(".google.api.Service.monitoredResources: object expected"); + message.monitoredResources[i] = $root.google.api.MonitoredResourceDescriptor.fromObject(object.monitoredResources[i]); + } + } + if (object.billing != null) { + if (typeof object.billing !== "object") + throw TypeError(".google.api.Service.billing: object expected"); + message.billing = $root.google.api.Billing.fromObject(object.billing); + } + if (object.logging != null) { + if (typeof object.logging !== "object") + throw TypeError(".google.api.Service.logging: object expected"); + message.logging = $root.google.api.Logging.fromObject(object.logging); + } + if (object.monitoring != null) { + if (typeof object.monitoring !== "object") + throw TypeError(".google.api.Service.monitoring: object expected"); + message.monitoring = $root.google.api.Monitoring.fromObject(object.monitoring); + } + if (object.systemParameters != null) { + if (typeof object.systemParameters !== "object") + throw TypeError(".google.api.Service.systemParameters: object expected"); + message.systemParameters = $root.google.api.SystemParameters.fromObject(object.systemParameters); + } + if (object.sourceInfo != null) { + if (typeof object.sourceInfo !== "object") + throw TypeError(".google.api.Service.sourceInfo: object expected"); + message.sourceInfo = $root.google.api.SourceInfo.fromObject(object.sourceInfo); + } + if (object.configVersion != null) { + if (typeof object.configVersion !== "object") + throw TypeError(".google.api.Service.configVersion: object expected"); + message.configVersion = $root.google.protobuf.UInt32Value.fromObject(object.configVersion); + } + return message; + }; + + /** + * Creates a plain object from a Service message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Service + * @static + * @param {google.api.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.arrays || options.defaults) { + object.apis = []; + object.types = []; + object.enums = []; + object.endpoints = []; + object.logs = []; + object.metrics = []; + object.monitoredResources = []; + } + if (options.defaults) { + object.name = ""; + object.title = ""; + object.documentation = null; + object.backend = null; + object.http = null; + object.quota = null; + object.authentication = null; + object.context = null; + object.usage = null; + object.configVersion = null; + object.control = null; + object.producerProjectId = ""; + object.billing = null; + object.logging = null; + object.monitoring = null; + object.systemParameters = null; + object.id = ""; + object.sourceInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.apis && message.apis.length) { + object.apis = []; + for (var j = 0; j < message.apis.length; ++j) + object.apis[j] = $root.google.protobuf.Api.toObject(message.apis[j], options); + } + if (message.types && message.types.length) { + object.types = []; + for (var j = 0; j < message.types.length; ++j) + object.types[j] = $root.google.protobuf.Type.toObject(message.types[j], options); + } + if (message.enums && message.enums.length) { + object.enums = []; + for (var j = 0; j < message.enums.length; ++j) + object.enums[j] = $root.google.protobuf.Enum.toObject(message.enums[j], options); + } + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.api.Documentation.toObject(message.documentation, options); + if (message.backend != null && message.hasOwnProperty("backend")) + object.backend = $root.google.api.Backend.toObject(message.backend, options); + if (message.http != null && message.hasOwnProperty("http")) + object.http = $root.google.api.Http.toObject(message.http, options); + if (message.quota != null && message.hasOwnProperty("quota")) + object.quota = $root.google.api.Quota.toObject(message.quota, options); + if (message.authentication != null && message.hasOwnProperty("authentication")) + object.authentication = $root.google.api.Authentication.toObject(message.authentication, options); + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.api.Context.toObject(message.context, options); + if (message.usage != null && message.hasOwnProperty("usage")) + object.usage = $root.google.api.Usage.toObject(message.usage, options); + if (message.endpoints && message.endpoints.length) { + object.endpoints = []; + for (var j = 0; j < message.endpoints.length; ++j) + object.endpoints[j] = $root.google.api.Endpoint.toObject(message.endpoints[j], options); + } + if (message.configVersion != null && message.hasOwnProperty("configVersion")) + object.configVersion = $root.google.protobuf.UInt32Value.toObject(message.configVersion, options); + if (message.control != null && message.hasOwnProperty("control")) + object.control = $root.google.api.Control.toObject(message.control, options); + if (message.producerProjectId != null && message.hasOwnProperty("producerProjectId")) + object.producerProjectId = message.producerProjectId; + if (message.logs && message.logs.length) { + object.logs = []; + for (var j = 0; j < message.logs.length; ++j) + object.logs[j] = $root.google.api.LogDescriptor.toObject(message.logs[j], options); + } + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.api.MetricDescriptor.toObject(message.metrics[j], options); + } + if (message.monitoredResources && message.monitoredResources.length) { + object.monitoredResources = []; + for (var j = 0; j < message.monitoredResources.length; ++j) + object.monitoredResources[j] = $root.google.api.MonitoredResourceDescriptor.toObject(message.monitoredResources[j], options); + } + if (message.billing != null && message.hasOwnProperty("billing")) + object.billing = $root.google.api.Billing.toObject(message.billing, options); + if (message.logging != null && message.hasOwnProperty("logging")) + object.logging = $root.google.api.Logging.toObject(message.logging, options); + if (message.monitoring != null && message.hasOwnProperty("monitoring")) + object.monitoring = $root.google.api.Monitoring.toObject(message.monitoring, options); + if (message.systemParameters != null && message.hasOwnProperty("systemParameters")) + object.systemParameters = $root.google.api.SystemParameters.toObject(message.systemParameters, options); + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.sourceInfo != null && message.hasOwnProperty("sourceInfo")) + object.sourceInfo = $root.google.api.SourceInfo.toObject(message.sourceInfo, options); + return object; + }; + + /** + * Converts this Service to JSON. + * @function toJSON + * @memberof google.api.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.api.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.api.Service"; + }; + + return Service; + })(); + + api.Authentication = (function() { + + /** + * Properties of an Authentication. + * @memberof google.api + * @interface IAuthentication + * @property {Array.|null} [rules] Authentication rules + * @property {Array.|null} [providers] Authentication providers + */ + + /** + * Constructs a new Authentication. + * @memberof google.api + * @classdesc Represents an Authentication. + * @implements IAuthentication + * @constructor + * @param {google.api.IAuthentication=} [properties] Properties to set + */ + function Authentication(properties) { + this.rules = []; + this.providers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Authentication rules. + * @member {Array.} rules + * @memberof google.api.Authentication + * @instance + */ + Authentication.prototype.rules = $util.emptyArray; + + /** + * Authentication providers. + * @member {Array.} providers + * @memberof google.api.Authentication + * @instance + */ + Authentication.prototype.providers = $util.emptyArray; + + /** + * Creates a new Authentication instance using the specified properties. + * @function create + * @memberof google.api.Authentication + * @static + * @param {google.api.IAuthentication=} [properties] Properties to set + * @returns {google.api.Authentication} Authentication instance + */ + Authentication.create = function create(properties) { + return new Authentication(properties); + }; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.api.Authentication.verify|verify} messages. + * @function encode + * @memberof google.api.Authentication + * @static + * @param {google.api.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.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.AuthenticationRule.encode(message.rules[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.providers != null && message.providers.length) + for (var i = 0; i < message.providers.length; ++i) + $root.google.api.AuthProvider.encode(message.providers[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.api.Authentication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Authentication + * @static + * @param {google.api.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @function decode + * @memberof google.api.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decode = function 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.Authentication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.AuthenticationRule.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.providers && message.providers.length)) + message.providers = []; + message.providers.push($root.google.api.AuthProvider.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Authentication message. + * @function verify + * @memberof google.api.Authentication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Authentication.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.AuthenticationRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.providers != null && message.hasOwnProperty("providers")) { + if (!Array.isArray(message.providers)) + return "providers: array expected"; + for (var i = 0; i < message.providers.length; ++i) { + var error = $root.google.api.AuthProvider.verify(message.providers[i]); + if (error) + return "providers." + error; + } + } + return null; + }; + + /** + * Creates an Authentication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Authentication + * @static + * @param {Object.} object Plain object + * @returns {google.api.Authentication} Authentication + */ + Authentication.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Authentication) + return object; + var message = new $root.google.api.Authentication(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Authentication.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Authentication.rules: object expected"); + message.rules[i] = $root.google.api.AuthenticationRule.fromObject(object.rules[i]); + } + } + if (object.providers) { + if (!Array.isArray(object.providers)) + throw TypeError(".google.api.Authentication.providers: array expected"); + message.providers = []; + for (var i = 0; i < object.providers.length; ++i) { + if (typeof object.providers[i] !== "object") + throw TypeError(".google.api.Authentication.providers: object expected"); + message.providers[i] = $root.google.api.AuthProvider.fromObject(object.providers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Authentication + * @static + * @param {google.api.Authentication} message Authentication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Authentication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.rules = []; + object.providers = []; + } + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.AuthenticationRule.toObject(message.rules[j], options); + } + if (message.providers && message.providers.length) { + object.providers = []; + for (var j = 0; j < message.providers.length; ++j) + object.providers[j] = $root.google.api.AuthProvider.toObject(message.providers[j], options); + } + return object; + }; + + /** + * Converts this Authentication to JSON. + * @function toJSON + * @memberof google.api.Authentication + * @instance + * @returns {Object.} JSON object + */ + Authentication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Authentication + * @function getTypeUrl + * @memberof google.api.Authentication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Authentication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Authentication"; + }; + + return Authentication; + })(); + + api.AuthenticationRule = (function() { + + /** + * Properties of an AuthenticationRule. + * @memberof google.api + * @interface IAuthenticationRule + * @property {string|null} [selector] AuthenticationRule selector + * @property {google.api.IOAuthRequirements|null} [oauth] AuthenticationRule oauth + * @property {boolean|null} [allowWithoutCredential] AuthenticationRule allowWithoutCredential + * @property {Array.|null} [requirements] AuthenticationRule requirements + */ + + /** + * Constructs a new AuthenticationRule. + * @memberof google.api + * @classdesc Represents an AuthenticationRule. + * @implements IAuthenticationRule + * @constructor + * @param {google.api.IAuthenticationRule=} [properties] Properties to set + */ + function AuthenticationRule(properties) { + this.requirements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthenticationRule selector. + * @member {string} selector + * @memberof google.api.AuthenticationRule + * @instance + */ + AuthenticationRule.prototype.selector = ""; + + /** + * AuthenticationRule oauth. + * @member {google.api.IOAuthRequirements|null|undefined} oauth + * @memberof google.api.AuthenticationRule + * @instance + */ + AuthenticationRule.prototype.oauth = null; + + /** + * AuthenticationRule allowWithoutCredential. + * @member {boolean} allowWithoutCredential + * @memberof google.api.AuthenticationRule + * @instance + */ + AuthenticationRule.prototype.allowWithoutCredential = false; + + /** + * AuthenticationRule requirements. + * @member {Array.} requirements + * @memberof google.api.AuthenticationRule + * @instance + */ + AuthenticationRule.prototype.requirements = $util.emptyArray; + + /** + * Creates a new AuthenticationRule instance using the specified properties. + * @function create + * @memberof google.api.AuthenticationRule + * @static + * @param {google.api.IAuthenticationRule=} [properties] Properties to set + * @returns {google.api.AuthenticationRule} AuthenticationRule instance + */ + AuthenticationRule.create = function create(properties) { + return new AuthenticationRule(properties); + }; + + /** + * Encodes the specified AuthenticationRule message. Does not implicitly {@link google.api.AuthenticationRule.verify|verify} messages. + * @function encode + * @memberof google.api.AuthenticationRule + * @static + * @param {google.api.IAuthenticationRule} message AuthenticationRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthenticationRule.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.oauth != null && Object.hasOwnProperty.call(message, "oauth")) + $root.google.api.OAuthRequirements.encode(message.oauth, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allowWithoutCredential != null && Object.hasOwnProperty.call(message, "allowWithoutCredential")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowWithoutCredential); + if (message.requirements != null && message.requirements.length) + for (var i = 0; i < message.requirements.length; ++i) + $root.google.api.AuthRequirement.encode(message.requirements[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuthenticationRule message, length delimited. Does not implicitly {@link google.api.AuthenticationRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.AuthenticationRule + * @static + * @param {google.api.IAuthenticationRule} message AuthenticationRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthenticationRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthenticationRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.AuthenticationRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.AuthenticationRule} AuthenticationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthenticationRule.decode = function 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.AuthenticationRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.oauth = $root.google.api.OAuthRequirements.decode(reader, reader.uint32()); + break; + } + case 5: { + message.allowWithoutCredential = reader.bool(); + break; + } + case 7: { + if (!(message.requirements && message.requirements.length)) + message.requirements = []; + message.requirements.push($root.google.api.AuthRequirement.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthenticationRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.AuthenticationRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.AuthenticationRule} AuthenticationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthenticationRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthenticationRule message. + * @function verify + * @memberof google.api.AuthenticationRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthenticationRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.oauth != null && message.hasOwnProperty("oauth")) { + var error = $root.google.api.OAuthRequirements.verify(message.oauth); + if (error) + return "oauth." + error; + } + if (message.allowWithoutCredential != null && message.hasOwnProperty("allowWithoutCredential")) + if (typeof message.allowWithoutCredential !== "boolean") + return "allowWithoutCredential: boolean expected"; + if (message.requirements != null && message.hasOwnProperty("requirements")) { + if (!Array.isArray(message.requirements)) + return "requirements: array expected"; + for (var i = 0; i < message.requirements.length; ++i) { + var error = $root.google.api.AuthRequirement.verify(message.requirements[i]); + if (error) + return "requirements." + error; + } + } + return null; + }; + + /** + * Creates an AuthenticationRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.AuthenticationRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.AuthenticationRule} AuthenticationRule + */ + AuthenticationRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.AuthenticationRule) + return object; + var message = new $root.google.api.AuthenticationRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.oauth != null) { + if (typeof object.oauth !== "object") + throw TypeError(".google.api.AuthenticationRule.oauth: object expected"); + message.oauth = $root.google.api.OAuthRequirements.fromObject(object.oauth); + } + if (object.allowWithoutCredential != null) + message.allowWithoutCredential = Boolean(object.allowWithoutCredential); + if (object.requirements) { + if (!Array.isArray(object.requirements)) + throw TypeError(".google.api.AuthenticationRule.requirements: array expected"); + message.requirements = []; + for (var i = 0; i < object.requirements.length; ++i) { + if (typeof object.requirements[i] !== "object") + throw TypeError(".google.api.AuthenticationRule.requirements: object expected"); + message.requirements[i] = $root.google.api.AuthRequirement.fromObject(object.requirements[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuthenticationRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.AuthenticationRule + * @static + * @param {google.api.AuthenticationRule} message AuthenticationRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthenticationRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requirements = []; + if (options.defaults) { + object.selector = ""; + object.oauth = null; + object.allowWithoutCredential = false; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.oauth != null && message.hasOwnProperty("oauth")) + object.oauth = $root.google.api.OAuthRequirements.toObject(message.oauth, options); + if (message.allowWithoutCredential != null && message.hasOwnProperty("allowWithoutCredential")) + object.allowWithoutCredential = message.allowWithoutCredential; + if (message.requirements && message.requirements.length) { + object.requirements = []; + for (var j = 0; j < message.requirements.length; ++j) + object.requirements[j] = $root.google.api.AuthRequirement.toObject(message.requirements[j], options); + } + return object; + }; + + /** + * Converts this AuthenticationRule to JSON. + * @function toJSON + * @memberof google.api.AuthenticationRule + * @instance + * @returns {Object.} JSON object + */ + AuthenticationRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthenticationRule + * @function getTypeUrl + * @memberof google.api.AuthenticationRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthenticationRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.AuthenticationRule"; + }; + + return AuthenticationRule; + })(); + + api.JwtLocation = (function() { + + /** + * Properties of a JwtLocation. + * @memberof google.api + * @interface IJwtLocation + * @property {string|null} [header] JwtLocation header + * @property {string|null} [query] JwtLocation query + * @property {string|null} [valuePrefix] JwtLocation valuePrefix + */ + + /** + * Constructs a new JwtLocation. + * @memberof google.api + * @classdesc Represents a JwtLocation. + * @implements IJwtLocation + * @constructor + * @param {google.api.IJwtLocation=} [properties] Properties to set + */ + function JwtLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JwtLocation header. + * @member {string|null|undefined} header + * @memberof google.api.JwtLocation + * @instance + */ + JwtLocation.prototype.header = null; + + /** + * JwtLocation query. + * @member {string|null|undefined} query + * @memberof google.api.JwtLocation + * @instance + */ + JwtLocation.prototype.query = null; + + /** + * JwtLocation valuePrefix. + * @member {string} valuePrefix + * @memberof google.api.JwtLocation + * @instance + */ + JwtLocation.prototype.valuePrefix = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * JwtLocation in. + * @member {"header"|"query"|undefined} in_ + * @memberof google.api.JwtLocation + * @instance + */ + Object.defineProperty(JwtLocation.prototype, "in", { + get: $util.oneOfGetter($oneOfFields = ["header", "query"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new JwtLocation instance using the specified properties. + * @function create + * @memberof google.api.JwtLocation + * @static + * @param {google.api.IJwtLocation=} [properties] Properties to set + * @returns {google.api.JwtLocation} JwtLocation instance + */ + JwtLocation.create = function create(properties) { + return new JwtLocation(properties); + }; + + /** + * Encodes the specified JwtLocation message. Does not implicitly {@link google.api.JwtLocation.verify|verify} messages. + * @function encode + * @memberof google.api.JwtLocation + * @static + * @param {google.api.IJwtLocation} message JwtLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JwtLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.header); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.valuePrefix != null && Object.hasOwnProperty.call(message, "valuePrefix")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.valuePrefix); + return writer; + }; + + /** + * Encodes the specified JwtLocation message, length delimited. Does not implicitly {@link google.api.JwtLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JwtLocation + * @static + * @param {google.api.IJwtLocation} message JwtLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JwtLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JwtLocation message from the specified reader or buffer. + * @function decode + * @memberof google.api.JwtLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JwtLocation} JwtLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JwtLocation.decode = function 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.JwtLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.header = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.valuePrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JwtLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JwtLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JwtLocation} JwtLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JwtLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JwtLocation message. + * @function verify + * @memberof google.api.JwtLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JwtLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.header != null && message.hasOwnProperty("header")) { + properties["in"] = 1; + if (!$util.isString(message.header)) + return "header: string expected"; + } + if (message.query != null && message.hasOwnProperty("query")) { + if (properties["in"] === 1) + return "in: multiple values"; + properties["in"] = 1; + if (!$util.isString(message.query)) + return "query: string expected"; + } + if (message.valuePrefix != null && message.hasOwnProperty("valuePrefix")) + if (!$util.isString(message.valuePrefix)) + return "valuePrefix: string expected"; + return null; + }; + + /** + * Creates a JwtLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JwtLocation + * @static + * @param {Object.} object Plain object + * @returns {google.api.JwtLocation} JwtLocation + */ + JwtLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JwtLocation) + return object; + var message = new $root.google.api.JwtLocation(); + if (object.header != null) + message.header = String(object.header); + if (object.query != null) + message.query = String(object.query); + if (object.valuePrefix != null) + message.valuePrefix = String(object.valuePrefix); + return message; + }; + + /** + * Creates a plain object from a JwtLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JwtLocation + * @static + * @param {google.api.JwtLocation} message JwtLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JwtLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.valuePrefix = ""; + if (message.header != null && message.hasOwnProperty("header")) { + object.header = message.header; + if (options.oneofs) + object["in"] = "header"; + } + if (message.query != null && message.hasOwnProperty("query")) { + object.query = message.query; + if (options.oneofs) + object["in"] = "query"; + } + if (message.valuePrefix != null && message.hasOwnProperty("valuePrefix")) + object.valuePrefix = message.valuePrefix; + return object; + }; + + /** + * Converts this JwtLocation to JSON. + * @function toJSON + * @memberof google.api.JwtLocation + * @instance + * @returns {Object.} JSON object + */ + JwtLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JwtLocation + * @function getTypeUrl + * @memberof google.api.JwtLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JwtLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JwtLocation"; + }; + + return JwtLocation; + })(); + + api.AuthProvider = (function() { + + /** + * Properties of an AuthProvider. + * @memberof google.api + * @interface IAuthProvider + * @property {string|null} [id] AuthProvider id + * @property {string|null} [issuer] AuthProvider issuer + * @property {string|null} [jwksUri] AuthProvider jwksUri + * @property {string|null} [audiences] AuthProvider audiences + * @property {string|null} [authorizationUrl] AuthProvider authorizationUrl + * @property {Array.|null} [jwtLocations] AuthProvider jwtLocations + */ + + /** + * Constructs a new AuthProvider. + * @memberof google.api + * @classdesc Represents an AuthProvider. + * @implements IAuthProvider + * @constructor + * @param {google.api.IAuthProvider=} [properties] Properties to set + */ + function AuthProvider(properties) { + this.jwtLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthProvider id. + * @member {string} id + * @memberof google.api.AuthProvider + * @instance + */ + AuthProvider.prototype.id = ""; + + /** + * AuthProvider issuer. + * @member {string} issuer + * @memberof google.api.AuthProvider + * @instance + */ + AuthProvider.prototype.issuer = ""; + + /** + * AuthProvider jwksUri. + * @member {string} jwksUri + * @memberof google.api.AuthProvider + * @instance + */ + AuthProvider.prototype.jwksUri = ""; + + /** + * AuthProvider audiences. + * @member {string} audiences + * @memberof google.api.AuthProvider + * @instance + */ + AuthProvider.prototype.audiences = ""; + + /** + * AuthProvider authorizationUrl. + * @member {string} authorizationUrl + * @memberof google.api.AuthProvider + * @instance + */ + AuthProvider.prototype.authorizationUrl = ""; + + /** + * AuthProvider jwtLocations. + * @member {Array.} jwtLocations + * @memberof google.api.AuthProvider + * @instance + */ + AuthProvider.prototype.jwtLocations = $util.emptyArray; + + /** + * Creates a new AuthProvider instance using the specified properties. + * @function create + * @memberof google.api.AuthProvider + * @static + * @param {google.api.IAuthProvider=} [properties] Properties to set + * @returns {google.api.AuthProvider} AuthProvider instance + */ + AuthProvider.create = function create(properties) { + return new AuthProvider(properties); + }; + + /** + * Encodes the specified AuthProvider message. Does not implicitly {@link google.api.AuthProvider.verify|verify} messages. + * @function encode + * @memberof google.api.AuthProvider + * @static + * @param {google.api.IAuthProvider} message AuthProvider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthProvider.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.issuer); + if (message.jwksUri != null && Object.hasOwnProperty.call(message, "jwksUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jwksUri); + if (message.audiences != null && Object.hasOwnProperty.call(message, "audiences")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.audiences); + if (message.authorizationUrl != null && Object.hasOwnProperty.call(message, "authorizationUrl")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.authorizationUrl); + if (message.jwtLocations != null && message.jwtLocations.length) + for (var i = 0; i < message.jwtLocations.length; ++i) + $root.google.api.JwtLocation.encode(message.jwtLocations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuthProvider message, length delimited. Does not implicitly {@link google.api.AuthProvider.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.AuthProvider + * @static + * @param {google.api.IAuthProvider} message AuthProvider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthProvider.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthProvider message from the specified reader or buffer. + * @function decode + * @memberof google.api.AuthProvider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.AuthProvider} AuthProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthProvider.decode = function 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.AuthProvider(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.issuer = reader.string(); + break; + } + case 3: { + message.jwksUri = reader.string(); + break; + } + case 4: { + message.audiences = reader.string(); + break; + } + case 5: { + message.authorizationUrl = reader.string(); + break; + } + case 6: { + if (!(message.jwtLocations && message.jwtLocations.length)) + message.jwtLocations = []; + message.jwtLocations.push($root.google.api.JwtLocation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthProvider message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.AuthProvider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.AuthProvider} AuthProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthProvider.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthProvider message. + * @function verify + * @memberof google.api.AuthProvider + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthProvider.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.issuer != null && message.hasOwnProperty("issuer")) + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + if (message.jwksUri != null && message.hasOwnProperty("jwksUri")) + if (!$util.isString(message.jwksUri)) + return "jwksUri: string expected"; + if (message.audiences != null && message.hasOwnProperty("audiences")) + if (!$util.isString(message.audiences)) + return "audiences: string expected"; + if (message.authorizationUrl != null && message.hasOwnProperty("authorizationUrl")) + if (!$util.isString(message.authorizationUrl)) + return "authorizationUrl: string expected"; + if (message.jwtLocations != null && message.hasOwnProperty("jwtLocations")) { + if (!Array.isArray(message.jwtLocations)) + return "jwtLocations: array expected"; + for (var i = 0; i < message.jwtLocations.length; ++i) { + var error = $root.google.api.JwtLocation.verify(message.jwtLocations[i]); + if (error) + return "jwtLocations." + error; + } + } + return null; + }; + + /** + * Creates an AuthProvider message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.AuthProvider + * @static + * @param {Object.} object Plain object + * @returns {google.api.AuthProvider} AuthProvider + */ + AuthProvider.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.AuthProvider) + return object; + var message = new $root.google.api.AuthProvider(); + if (object.id != null) + message.id = String(object.id); + if (object.issuer != null) + message.issuer = String(object.issuer); + if (object.jwksUri != null) + message.jwksUri = String(object.jwksUri); + if (object.audiences != null) + message.audiences = String(object.audiences); + if (object.authorizationUrl != null) + message.authorizationUrl = String(object.authorizationUrl); + if (object.jwtLocations) { + if (!Array.isArray(object.jwtLocations)) + throw TypeError(".google.api.AuthProvider.jwtLocations: array expected"); + message.jwtLocations = []; + for (var i = 0; i < object.jwtLocations.length; ++i) { + if (typeof object.jwtLocations[i] !== "object") + throw TypeError(".google.api.AuthProvider.jwtLocations: object expected"); + message.jwtLocations[i] = $root.google.api.JwtLocation.fromObject(object.jwtLocations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuthProvider message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.AuthProvider + * @static + * @param {google.api.AuthProvider} message AuthProvider + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthProvider.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jwtLocations = []; + if (options.defaults) { + object.id = ""; + object.issuer = ""; + object.jwksUri = ""; + object.audiences = ""; + object.authorizationUrl = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.issuer != null && message.hasOwnProperty("issuer")) + object.issuer = message.issuer; + if (message.jwksUri != null && message.hasOwnProperty("jwksUri")) + object.jwksUri = message.jwksUri; + if (message.audiences != null && message.hasOwnProperty("audiences")) + object.audiences = message.audiences; + if (message.authorizationUrl != null && message.hasOwnProperty("authorizationUrl")) + object.authorizationUrl = message.authorizationUrl; + if (message.jwtLocations && message.jwtLocations.length) { + object.jwtLocations = []; + for (var j = 0; j < message.jwtLocations.length; ++j) + object.jwtLocations[j] = $root.google.api.JwtLocation.toObject(message.jwtLocations[j], options); + } + return object; + }; + + /** + * Converts this AuthProvider to JSON. + * @function toJSON + * @memberof google.api.AuthProvider + * @instance + * @returns {Object.} JSON object + */ + AuthProvider.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthProvider + * @function getTypeUrl + * @memberof google.api.AuthProvider + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthProvider.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.AuthProvider"; + }; + + return AuthProvider; + })(); + + api.OAuthRequirements = (function() { + + /** + * Properties of a OAuthRequirements. + * @memberof google.api + * @interface IOAuthRequirements + * @property {string|null} [canonicalScopes] OAuthRequirements canonicalScopes + */ + + /** + * Constructs a new OAuthRequirements. + * @memberof google.api + * @classdesc Represents a OAuthRequirements. + * @implements IOAuthRequirements + * @constructor + * @param {google.api.IOAuthRequirements=} [properties] Properties to set + */ + function OAuthRequirements(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OAuthRequirements canonicalScopes. + * @member {string} canonicalScopes + * @memberof google.api.OAuthRequirements + * @instance + */ + OAuthRequirements.prototype.canonicalScopes = ""; + + /** + * Creates a new OAuthRequirements instance using the specified properties. + * @function create + * @memberof google.api.OAuthRequirements + * @static + * @param {google.api.IOAuthRequirements=} [properties] Properties to set + * @returns {google.api.OAuthRequirements} OAuthRequirements instance + */ + OAuthRequirements.create = function create(properties) { + return new OAuthRequirements(properties); + }; + + /** + * Encodes the specified OAuthRequirements message. Does not implicitly {@link google.api.OAuthRequirements.verify|verify} messages. + * @function encode + * @memberof google.api.OAuthRequirements + * @static + * @param {google.api.IOAuthRequirements} message OAuthRequirements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthRequirements.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.canonicalScopes != null && Object.hasOwnProperty.call(message, "canonicalScopes")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.canonicalScopes); + return writer; + }; + + /** + * Encodes the specified OAuthRequirements message, length delimited. Does not implicitly {@link google.api.OAuthRequirements.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.OAuthRequirements + * @static + * @param {google.api.IOAuthRequirements} message OAuthRequirements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthRequirements.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OAuthRequirements message from the specified reader or buffer. + * @function decode + * @memberof google.api.OAuthRequirements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.OAuthRequirements} OAuthRequirements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthRequirements.decode = function 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.OAuthRequirements(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.canonicalScopes = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OAuthRequirements message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.OAuthRequirements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.OAuthRequirements} OAuthRequirements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthRequirements.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OAuthRequirements message. + * @function verify + * @memberof google.api.OAuthRequirements + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OAuthRequirements.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.canonicalScopes != null && message.hasOwnProperty("canonicalScopes")) + if (!$util.isString(message.canonicalScopes)) + return "canonicalScopes: string expected"; + return null; + }; + + /** + * Creates a OAuthRequirements message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.OAuthRequirements + * @static + * @param {Object.} object Plain object + * @returns {google.api.OAuthRequirements} OAuthRequirements + */ + OAuthRequirements.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.OAuthRequirements) + return object; + var message = new $root.google.api.OAuthRequirements(); + if (object.canonicalScopes != null) + message.canonicalScopes = String(object.canonicalScopes); + return message; + }; + + /** + * Creates a plain object from a OAuthRequirements message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.OAuthRequirements + * @static + * @param {google.api.OAuthRequirements} message OAuthRequirements + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OAuthRequirements.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.canonicalScopes = ""; + if (message.canonicalScopes != null && message.hasOwnProperty("canonicalScopes")) + object.canonicalScopes = message.canonicalScopes; + return object; + }; + + /** + * Converts this OAuthRequirements to JSON. + * @function toJSON + * @memberof google.api.OAuthRequirements + * @instance + * @returns {Object.} JSON object + */ + OAuthRequirements.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OAuthRequirements + * @function getTypeUrl + * @memberof google.api.OAuthRequirements + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OAuthRequirements.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.OAuthRequirements"; + }; + + return OAuthRequirements; + })(); + + api.AuthRequirement = (function() { + + /** + * Properties of an AuthRequirement. + * @memberof google.api + * @interface IAuthRequirement + * @property {string|null} [providerId] AuthRequirement providerId + * @property {string|null} [audiences] AuthRequirement audiences + */ + + /** + * Constructs a new AuthRequirement. + * @memberof google.api + * @classdesc Represents an AuthRequirement. + * @implements IAuthRequirement + * @constructor + * @param {google.api.IAuthRequirement=} [properties] Properties to set + */ + function AuthRequirement(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthRequirement providerId. + * @member {string} providerId + * @memberof google.api.AuthRequirement + * @instance + */ + AuthRequirement.prototype.providerId = ""; + + /** + * AuthRequirement audiences. + * @member {string} audiences + * @memberof google.api.AuthRequirement + * @instance + */ + AuthRequirement.prototype.audiences = ""; + + /** + * Creates a new AuthRequirement instance using the specified properties. + * @function create + * @memberof google.api.AuthRequirement + * @static + * @param {google.api.IAuthRequirement=} [properties] Properties to set + * @returns {google.api.AuthRequirement} AuthRequirement instance + */ + AuthRequirement.create = function create(properties) { + return new AuthRequirement(properties); + }; + + /** + * Encodes the specified AuthRequirement message. Does not implicitly {@link google.api.AuthRequirement.verify|verify} messages. + * @function encode + * @memberof google.api.AuthRequirement + * @static + * @param {google.api.IAuthRequirement} message AuthRequirement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthRequirement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.providerId != null && Object.hasOwnProperty.call(message, "providerId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.providerId); + if (message.audiences != null && Object.hasOwnProperty.call(message, "audiences")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.audiences); + return writer; + }; + + /** + * Encodes the specified AuthRequirement message, length delimited. Does not implicitly {@link google.api.AuthRequirement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.AuthRequirement + * @static + * @param {google.api.IAuthRequirement} message AuthRequirement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthRequirement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthRequirement message from the specified reader or buffer. + * @function decode + * @memberof google.api.AuthRequirement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.AuthRequirement} AuthRequirement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthRequirement.decode = function 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.AuthRequirement(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.providerId = reader.string(); + break; + } + case 2: { + message.audiences = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthRequirement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.AuthRequirement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.AuthRequirement} AuthRequirement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthRequirement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthRequirement message. + * @function verify + * @memberof google.api.AuthRequirement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthRequirement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.providerId != null && message.hasOwnProperty("providerId")) + if (!$util.isString(message.providerId)) + return "providerId: string expected"; + if (message.audiences != null && message.hasOwnProperty("audiences")) + if (!$util.isString(message.audiences)) + return "audiences: string expected"; + return null; + }; + + /** + * Creates an AuthRequirement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.AuthRequirement + * @static + * @param {Object.} object Plain object + * @returns {google.api.AuthRequirement} AuthRequirement + */ + AuthRequirement.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.AuthRequirement) + return object; + var message = new $root.google.api.AuthRequirement(); + if (object.providerId != null) + message.providerId = String(object.providerId); + if (object.audiences != null) + message.audiences = String(object.audiences); + return message; + }; + + /** + * Creates a plain object from an AuthRequirement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.AuthRequirement + * @static + * @param {google.api.AuthRequirement} message AuthRequirement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthRequirement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.providerId = ""; + object.audiences = ""; + } + if (message.providerId != null && message.hasOwnProperty("providerId")) + object.providerId = message.providerId; + if (message.audiences != null && message.hasOwnProperty("audiences")) + object.audiences = message.audiences; + return object; + }; + + /** + * Converts this AuthRequirement to JSON. + * @function toJSON + * @memberof google.api.AuthRequirement + * @instance + * @returns {Object.} JSON object + */ + AuthRequirement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthRequirement + * @function getTypeUrl + * @memberof google.api.AuthRequirement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthRequirement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.AuthRequirement"; + }; + + return AuthRequirement; + })(); + + api.Backend = (function() { + + /** + * Properties of a Backend. + * @memberof google.api + * @interface IBackend + * @property {Array.|null} [rules] Backend rules + */ + + /** + * Constructs a new Backend. + * @memberof google.api + * @classdesc Represents a Backend. + * @implements IBackend + * @constructor + * @param {google.api.IBackend=} [properties] Properties to set + */ + function Backend(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]]; + } + + /** + * Backend rules. + * @member {Array.} rules + * @memberof google.api.Backend + * @instance + */ + Backend.prototype.rules = $util.emptyArray; + + /** + * Creates a new Backend instance using the specified properties. + * @function create + * @memberof google.api.Backend + * @static + * @param {google.api.IBackend=} [properties] Properties to set + * @returns {google.api.Backend} Backend instance + */ + Backend.create = function create(properties) { + return new Backend(properties); + }; + + /** + * Encodes the specified Backend message. Does not implicitly {@link google.api.Backend.verify|verify} messages. + * @function encode + * @memberof google.api.Backend + * @static + * @param {google.api.IBackend} message Backend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backend.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.BackendRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Backend message, length delimited. Does not implicitly {@link google.api.Backend.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Backend + * @static + * @param {google.api.IBackend} message Backend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backend.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backend message from the specified reader or buffer. + * @function decode + * @memberof google.api.Backend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Backend} Backend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backend.decode = function 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.Backend(); + 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.BackendRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backend message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Backend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Backend} Backend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backend.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backend message. + * @function verify + * @memberof google.api.Backend + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backend.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.BackendRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates a Backend message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Backend + * @static + * @param {Object.} object Plain object + * @returns {google.api.Backend} Backend + */ + Backend.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Backend) + return object; + var message = new $root.google.api.Backend(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Backend.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Backend.rules: object expected"); + message.rules[i] = $root.google.api.BackendRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Backend message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Backend + * @static + * @param {google.api.Backend} message Backend + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backend.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.BackendRule.toObject(message.rules[j], options); + } + return object; + }; + + /** + * Converts this Backend to JSON. + * @function toJSON + * @memberof google.api.Backend + * @instance + * @returns {Object.} JSON object + */ + Backend.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backend + * @function getTypeUrl + * @memberof google.api.Backend + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backend.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Backend"; + }; + + return Backend; + })(); + + api.BackendRule = (function() { + + /** + * Properties of a BackendRule. + * @memberof google.api + * @interface IBackendRule + * @property {string|null} [selector] BackendRule selector + * @property {string|null} [address] BackendRule address + * @property {number|null} [deadline] BackendRule deadline + * @property {number|null} [minDeadline] BackendRule minDeadline + * @property {number|null} [operationDeadline] BackendRule operationDeadline + * @property {google.api.BackendRule.PathTranslation|null} [pathTranslation] BackendRule pathTranslation + * @property {string|null} [jwtAudience] BackendRule jwtAudience + * @property {boolean|null} [disableAuth] BackendRule disableAuth + * @property {string|null} [protocol] BackendRule protocol + */ + + /** + * Constructs a new BackendRule. + * @memberof google.api + * @classdesc Represents a BackendRule. + * @implements IBackendRule + * @constructor + * @param {google.api.IBackendRule=} [properties] Properties to set + */ + function BackendRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendRule selector. + * @member {string} selector + * @memberof google.api.BackendRule + * @instance + */ + BackendRule.prototype.selector = ""; + + /** + * BackendRule address. + * @member {string} address + * @memberof google.api.BackendRule + * @instance + */ + BackendRule.prototype.address = ""; + + /** + * BackendRule deadline. + * @member {number} deadline + * @memberof google.api.BackendRule + * @instance + */ + BackendRule.prototype.deadline = 0; + + /** + * BackendRule minDeadline. + * @member {number} minDeadline + * @memberof google.api.BackendRule + * @instance + */ + BackendRule.prototype.minDeadline = 0; + + /** + * BackendRule operationDeadline. + * @member {number} operationDeadline + * @memberof google.api.BackendRule + * @instance + */ + BackendRule.prototype.operationDeadline = 0; + + /** + * BackendRule pathTranslation. + * @member {google.api.BackendRule.PathTranslation} pathTranslation + * @memberof google.api.BackendRule + * @instance + */ + BackendRule.prototype.pathTranslation = 0; + + /** + * BackendRule jwtAudience. + * @member {string|null|undefined} jwtAudience + * @memberof google.api.BackendRule + * @instance + */ + BackendRule.prototype.jwtAudience = null; + + /** + * BackendRule disableAuth. + * @member {boolean|null|undefined} disableAuth + * @memberof google.api.BackendRule + * @instance + */ + BackendRule.prototype.disableAuth = null; + + /** + * BackendRule protocol. + * @member {string} protocol + * @memberof google.api.BackendRule + * @instance + */ + BackendRule.prototype.protocol = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendRule authentication. + * @member {"jwtAudience"|"disableAuth"|undefined} authentication + * @memberof google.api.BackendRule + * @instance + */ + Object.defineProperty(BackendRule.prototype, "authentication", { + get: $util.oneOfGetter($oneOfFields = ["jwtAudience", "disableAuth"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendRule instance using the specified properties. + * @function create + * @memberof google.api.BackendRule + * @static + * @param {google.api.IBackendRule=} [properties] Properties to set + * @returns {google.api.BackendRule} BackendRule instance + */ + BackendRule.create = function create(properties) { + return new BackendRule(properties); + }; + + /** + * Encodes the specified BackendRule message. Does not implicitly {@link google.api.BackendRule.verify|verify} messages. + * @function encode + * @memberof google.api.BackendRule + * @static + * @param {google.api.IBackendRule} message BackendRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendRule.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.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.address); + if (message.deadline != null && Object.hasOwnProperty.call(message, "deadline")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.deadline); + if (message.minDeadline != null && Object.hasOwnProperty.call(message, "minDeadline")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.minDeadline); + if (message.operationDeadline != null && Object.hasOwnProperty.call(message, "operationDeadline")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.operationDeadline); + if (message.pathTranslation != null && Object.hasOwnProperty.call(message, "pathTranslation")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.pathTranslation); + if (message.jwtAudience != null && Object.hasOwnProperty.call(message, "jwtAudience")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.jwtAudience); + if (message.disableAuth != null && Object.hasOwnProperty.call(message, "disableAuth")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.disableAuth); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.protocol); + return writer; + }; + + /** + * Encodes the specified BackendRule message, length delimited. Does not implicitly {@link google.api.BackendRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.BackendRule + * @static + * @param {google.api.IBackendRule} message BackendRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.BackendRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.BackendRule} BackendRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendRule.decode = function 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.BackendRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.address = reader.string(); + break; + } + case 3: { + message.deadline = reader.double(); + break; + } + case 4: { + message.minDeadline = reader.double(); + break; + } + case 5: { + message.operationDeadline = reader.double(); + break; + } + case 6: { + message.pathTranslation = reader.int32(); + break; + } + case 7: { + message.jwtAudience = reader.string(); + break; + } + case 8: { + message.disableAuth = reader.bool(); + break; + } + case 9: { + message.protocol = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.BackendRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.BackendRule} BackendRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendRule message. + * @function verify + * @memberof google.api.BackendRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendRule.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.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.deadline != null && message.hasOwnProperty("deadline")) + if (typeof message.deadline !== "number") + return "deadline: number expected"; + if (message.minDeadline != null && message.hasOwnProperty("minDeadline")) + if (typeof message.minDeadline !== "number") + return "minDeadline: number expected"; + if (message.operationDeadline != null && message.hasOwnProperty("operationDeadline")) + if (typeof message.operationDeadline !== "number") + return "operationDeadline: number expected"; + if (message.pathTranslation != null && message.hasOwnProperty("pathTranslation")) + switch (message.pathTranslation) { + default: + return "pathTranslation: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jwtAudience != null && message.hasOwnProperty("jwtAudience")) { + properties.authentication = 1; + if (!$util.isString(message.jwtAudience)) + return "jwtAudience: string expected"; + } + if (message.disableAuth != null && message.hasOwnProperty("disableAuth")) { + if (properties.authentication === 1) + return "authentication: multiple values"; + properties.authentication = 1; + if (typeof message.disableAuth !== "boolean") + return "disableAuth: boolean expected"; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) + if (!$util.isString(message.protocol)) + return "protocol: string expected"; + return null; + }; + + /** + * Creates a BackendRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.BackendRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.BackendRule} BackendRule + */ + BackendRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.BackendRule) + return object; + var message = new $root.google.api.BackendRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.address != null) + message.address = String(object.address); + if (object.deadline != null) + message.deadline = Number(object.deadline); + if (object.minDeadline != null) + message.minDeadline = Number(object.minDeadline); + if (object.operationDeadline != null) + message.operationDeadline = Number(object.operationDeadline); + switch (object.pathTranslation) { + default: + if (typeof object.pathTranslation === "number") { + message.pathTranslation = object.pathTranslation; + break; + } + break; + case "PATH_TRANSLATION_UNSPECIFIED": + case 0: + message.pathTranslation = 0; + break; + case "CONSTANT_ADDRESS": + case 1: + message.pathTranslation = 1; + break; + case "APPEND_PATH_TO_ADDRESS": + case 2: + message.pathTranslation = 2; + break; + } + if (object.jwtAudience != null) + message.jwtAudience = String(object.jwtAudience); + if (object.disableAuth != null) + message.disableAuth = Boolean(object.disableAuth); + if (object.protocol != null) + message.protocol = String(object.protocol); + return message; + }; + + /** + * Creates a plain object from a BackendRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.BackendRule + * @static + * @param {google.api.BackendRule} message BackendRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selector = ""; + object.address = ""; + object.deadline = 0; + object.minDeadline = 0; + object.operationDeadline = 0; + object.pathTranslation = options.enums === String ? "PATH_TRANSLATION_UNSPECIFIED" : 0; + object.protocol = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.deadline != null && message.hasOwnProperty("deadline")) + object.deadline = options.json && !isFinite(message.deadline) ? String(message.deadline) : message.deadline; + if (message.minDeadline != null && message.hasOwnProperty("minDeadline")) + object.minDeadline = options.json && !isFinite(message.minDeadline) ? String(message.minDeadline) : message.minDeadline; + if (message.operationDeadline != null && message.hasOwnProperty("operationDeadline")) + object.operationDeadline = options.json && !isFinite(message.operationDeadline) ? String(message.operationDeadline) : message.operationDeadline; + if (message.pathTranslation != null && message.hasOwnProperty("pathTranslation")) + object.pathTranslation = options.enums === String ? $root.google.api.BackendRule.PathTranslation[message.pathTranslation] === undefined ? message.pathTranslation : $root.google.api.BackendRule.PathTranslation[message.pathTranslation] : message.pathTranslation; + if (message.jwtAudience != null && message.hasOwnProperty("jwtAudience")) { + object.jwtAudience = message.jwtAudience; + if (options.oneofs) + object.authentication = "jwtAudience"; + } + if (message.disableAuth != null && message.hasOwnProperty("disableAuth")) { + object.disableAuth = message.disableAuth; + if (options.oneofs) + object.authentication = "disableAuth"; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) + object.protocol = message.protocol; + return object; + }; + + /** + * Converts this BackendRule to JSON. + * @function toJSON + * @memberof google.api.BackendRule + * @instance + * @returns {Object.} JSON object + */ + BackendRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackendRule + * @function getTypeUrl + * @memberof google.api.BackendRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackendRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.BackendRule"; + }; + + /** + * PathTranslation enum. + * @name google.api.BackendRule.PathTranslation + * @enum {number} + * @property {number} PATH_TRANSLATION_UNSPECIFIED=0 PATH_TRANSLATION_UNSPECIFIED value + * @property {number} CONSTANT_ADDRESS=1 CONSTANT_ADDRESS value + * @property {number} APPEND_PATH_TO_ADDRESS=2 APPEND_PATH_TO_ADDRESS value + */ + BackendRule.PathTranslation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PATH_TRANSLATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONSTANT_ADDRESS"] = 1; + values[valuesById[2] = "APPEND_PATH_TO_ADDRESS"] = 2; + return values; + })(); + + return BackendRule; + })(); + + api.Billing = (function() { + + /** + * Properties of a Billing. + * @memberof google.api + * @interface IBilling + * @property {Array.|null} [consumerDestinations] Billing consumerDestinations + */ + + /** + * Constructs a new Billing. + * @memberof google.api + * @classdesc Represents a Billing. + * @implements IBilling + * @constructor + * @param {google.api.IBilling=} [properties] Properties to set + */ + function Billing(properties) { + this.consumerDestinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Billing consumerDestinations. + * @member {Array.} consumerDestinations + * @memberof google.api.Billing + * @instance + */ + Billing.prototype.consumerDestinations = $util.emptyArray; + + /** + * Creates a new Billing instance using the specified properties. + * @function create + * @memberof google.api.Billing + * @static + * @param {google.api.IBilling=} [properties] Properties to set + * @returns {google.api.Billing} Billing instance + */ + Billing.create = function create(properties) { + return new Billing(properties); + }; + + /** + * Encodes the specified Billing message. Does not implicitly {@link google.api.Billing.verify|verify} messages. + * @function encode + * @memberof google.api.Billing + * @static + * @param {google.api.IBilling} message Billing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Billing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumerDestinations != null && message.consumerDestinations.length) + for (var i = 0; i < message.consumerDestinations.length; ++i) + $root.google.api.Billing.BillingDestination.encode(message.consumerDestinations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Billing message, length delimited. Does not implicitly {@link google.api.Billing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Billing + * @static + * @param {google.api.IBilling} message Billing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Billing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Billing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Billing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Billing} Billing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Billing.decode = function 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.Billing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + if (!(message.consumerDestinations && message.consumerDestinations.length)) + message.consumerDestinations = []; + message.consumerDestinations.push($root.google.api.Billing.BillingDestination.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Billing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Billing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Billing} Billing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Billing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Billing message. + * @function verify + * @memberof google.api.Billing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Billing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consumerDestinations != null && message.hasOwnProperty("consumerDestinations")) { + if (!Array.isArray(message.consumerDestinations)) + return "consumerDestinations: array expected"; + for (var i = 0; i < message.consumerDestinations.length; ++i) { + var error = $root.google.api.Billing.BillingDestination.verify(message.consumerDestinations[i]); + if (error) + return "consumerDestinations." + error; + } + } + return null; + }; + + /** + * Creates a Billing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Billing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Billing} Billing + */ + Billing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Billing) + return object; + var message = new $root.google.api.Billing(); + if (object.consumerDestinations) { + if (!Array.isArray(object.consumerDestinations)) + throw TypeError(".google.api.Billing.consumerDestinations: array expected"); + message.consumerDestinations = []; + for (var i = 0; i < object.consumerDestinations.length; ++i) { + if (typeof object.consumerDestinations[i] !== "object") + throw TypeError(".google.api.Billing.consumerDestinations: object expected"); + message.consumerDestinations[i] = $root.google.api.Billing.BillingDestination.fromObject(object.consumerDestinations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Billing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Billing + * @static + * @param {google.api.Billing} message Billing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Billing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.consumerDestinations = []; + if (message.consumerDestinations && message.consumerDestinations.length) { + object.consumerDestinations = []; + for (var j = 0; j < message.consumerDestinations.length; ++j) + object.consumerDestinations[j] = $root.google.api.Billing.BillingDestination.toObject(message.consumerDestinations[j], options); + } + return object; + }; + + /** + * Converts this Billing to JSON. + * @function toJSON + * @memberof google.api.Billing + * @instance + * @returns {Object.} JSON object + */ + Billing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Billing + * @function getTypeUrl + * @memberof google.api.Billing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Billing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Billing"; + }; + + Billing.BillingDestination = (function() { + + /** + * Properties of a BillingDestination. + * @memberof google.api.Billing + * @interface IBillingDestination + * @property {string|null} [monitoredResource] BillingDestination monitoredResource + * @property {Array.|null} [metrics] BillingDestination metrics + */ + + /** + * Constructs a new BillingDestination. + * @memberof google.api.Billing + * @classdesc Represents a BillingDestination. + * @implements IBillingDestination + * @constructor + * @param {google.api.Billing.IBillingDestination=} [properties] Properties to set + */ + function BillingDestination(properties) { + this.metrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BillingDestination monitoredResource. + * @member {string} monitoredResource + * @memberof google.api.Billing.BillingDestination + * @instance + */ + BillingDestination.prototype.monitoredResource = ""; + + /** + * BillingDestination metrics. + * @member {Array.} metrics + * @memberof google.api.Billing.BillingDestination + * @instance + */ + BillingDestination.prototype.metrics = $util.emptyArray; + + /** + * Creates a new BillingDestination instance using the specified properties. + * @function create + * @memberof google.api.Billing.BillingDestination + * @static + * @param {google.api.Billing.IBillingDestination=} [properties] Properties to set + * @returns {google.api.Billing.BillingDestination} BillingDestination instance + */ + BillingDestination.create = function create(properties) { + return new BillingDestination(properties); + }; + + /** + * Encodes the specified BillingDestination message. Does not implicitly {@link google.api.Billing.BillingDestination.verify|verify} messages. + * @function encode + * @memberof google.api.Billing.BillingDestination + * @static + * @param {google.api.Billing.IBillingDestination} message BillingDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BillingDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.monitoredResource != null && Object.hasOwnProperty.call(message, "monitoredResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.monitoredResource); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metrics[i]); + return writer; + }; + + /** + * Encodes the specified BillingDestination message, length delimited. Does not implicitly {@link google.api.Billing.BillingDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Billing.BillingDestination + * @static + * @param {google.api.Billing.IBillingDestination} message BillingDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BillingDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BillingDestination message from the specified reader or buffer. + * @function decode + * @memberof google.api.Billing.BillingDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Billing.BillingDestination} BillingDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BillingDestination.decode = function 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.Billing.BillingDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.monitoredResource = reader.string(); + break; + } + case 2: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BillingDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Billing.BillingDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Billing.BillingDestination} BillingDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BillingDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BillingDestination message. + * @function verify + * @memberof google.api.Billing.BillingDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BillingDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.monitoredResource != null && message.hasOwnProperty("monitoredResource")) + if (!$util.isString(message.monitoredResource)) + return "monitoredResource: string expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) + if (!$util.isString(message.metrics[i])) + return "metrics: string[] expected"; + } + return null; + }; + + /** + * Creates a BillingDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Billing.BillingDestination + * @static + * @param {Object.} object Plain object + * @returns {google.api.Billing.BillingDestination} BillingDestination + */ + BillingDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Billing.BillingDestination) + return object; + var message = new $root.google.api.Billing.BillingDestination(); + if (object.monitoredResource != null) + message.monitoredResource = String(object.monitoredResource); + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.api.Billing.BillingDestination.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) + message.metrics[i] = String(object.metrics[i]); + } + return message; + }; + + /** + * Creates a plain object from a BillingDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Billing.BillingDestination + * @static + * @param {google.api.Billing.BillingDestination} message BillingDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BillingDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metrics = []; + if (options.defaults) + object.monitoredResource = ""; + if (message.monitoredResource != null && message.hasOwnProperty("monitoredResource")) + object.monitoredResource = message.monitoredResource; + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = message.metrics[j]; + } + return object; + }; + + /** + * Converts this BillingDestination to JSON. + * @function toJSON + * @memberof google.api.Billing.BillingDestination + * @instance + * @returns {Object.} JSON object + */ + BillingDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BillingDestination + * @function getTypeUrl + * @memberof google.api.Billing.BillingDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BillingDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Billing.BillingDestination"; + }; + + return BillingDestination; + })(); + + return Billing; + })(); + + api.Context = (function() { + + /** + * Properties of a Context. + * @memberof google.api + * @interface IContext + * @property {Array.|null} [rules] Context rules + */ + + /** + * Constructs a new Context. + * @memberof google.api + * @classdesc Represents a Context. + * @implements IContext + * @constructor + * @param {google.api.IContext=} [properties] Properties to set + */ + function Context(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]]; + } + + /** + * Context rules. + * @member {Array.} rules + * @memberof google.api.Context + * @instance + */ + Context.prototype.rules = $util.emptyArray; + + /** + * Creates a new Context instance using the specified properties. + * @function create + * @memberof google.api.Context + * @static + * @param {google.api.IContext=} [properties] Properties to set + * @returns {google.api.Context} Context instance + */ + Context.create = function create(properties) { + return new Context(properties); + }; + + /** + * Encodes the specified Context message. Does not implicitly {@link google.api.Context.verify|verify} messages. + * @function encode + * @memberof google.api.Context + * @static + * @param {google.api.IContext} message Context message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Context.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.ContextRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Context message, length delimited. Does not implicitly {@link google.api.Context.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Context + * @static + * @param {google.api.IContext} message Context message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Context.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Context message from the specified reader or buffer. + * @function decode + * @memberof google.api.Context + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Context} Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Context.decode = function 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.Context(); + 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.ContextRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Context message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Context + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Context} Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Context.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Context message. + * @function verify + * @memberof google.api.Context + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Context.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.ContextRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates a Context message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Context + * @static + * @param {Object.} object Plain object + * @returns {google.api.Context} Context + */ + Context.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Context) + return object; + var message = new $root.google.api.Context(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Context.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Context.rules: object expected"); + message.rules[i] = $root.google.api.ContextRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Context message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Context + * @static + * @param {google.api.Context} message Context + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Context.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.ContextRule.toObject(message.rules[j], options); + } + return object; + }; + + /** + * Converts this Context to JSON. + * @function toJSON + * @memberof google.api.Context + * @instance + * @returns {Object.} JSON object + */ + Context.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Context + * @function getTypeUrl + * @memberof google.api.Context + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Context.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Context"; + }; + + return Context; + })(); + + api.ContextRule = (function() { + + /** + * Properties of a ContextRule. + * @memberof google.api + * @interface IContextRule + * @property {string|null} [selector] ContextRule selector + * @property {Array.|null} [requested] ContextRule requested + * @property {Array.|null} [provided] ContextRule provided + * @property {Array.|null} [allowedRequestExtensions] ContextRule allowedRequestExtensions + * @property {Array.|null} [allowedResponseExtensions] ContextRule allowedResponseExtensions + */ + + /** + * Constructs a new ContextRule. + * @memberof google.api + * @classdesc Represents a ContextRule. + * @implements IContextRule + * @constructor + * @param {google.api.IContextRule=} [properties] Properties to set + */ + function ContextRule(properties) { + this.requested = []; + this.provided = []; + this.allowedRequestExtensions = []; + this.allowedResponseExtensions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContextRule selector. + * @member {string} selector + * @memberof google.api.ContextRule + * @instance + */ + ContextRule.prototype.selector = ""; + + /** + * ContextRule requested. + * @member {Array.} requested + * @memberof google.api.ContextRule + * @instance + */ + ContextRule.prototype.requested = $util.emptyArray; + + /** + * ContextRule provided. + * @member {Array.} provided + * @memberof google.api.ContextRule + * @instance + */ + ContextRule.prototype.provided = $util.emptyArray; + + /** + * ContextRule allowedRequestExtensions. + * @member {Array.} allowedRequestExtensions + * @memberof google.api.ContextRule + * @instance + */ + ContextRule.prototype.allowedRequestExtensions = $util.emptyArray; + + /** + * ContextRule allowedResponseExtensions. + * @member {Array.} allowedResponseExtensions + * @memberof google.api.ContextRule + * @instance + */ + ContextRule.prototype.allowedResponseExtensions = $util.emptyArray; + + /** + * Creates a new ContextRule instance using the specified properties. + * @function create + * @memberof google.api.ContextRule + * @static + * @param {google.api.IContextRule=} [properties] Properties to set + * @returns {google.api.ContextRule} ContextRule instance + */ + ContextRule.create = function create(properties) { + return new ContextRule(properties); + }; + + /** + * Encodes the specified ContextRule message. Does not implicitly {@link google.api.ContextRule.verify|verify} messages. + * @function encode + * @memberof google.api.ContextRule + * @static + * @param {google.api.IContextRule} message ContextRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextRule.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.requested != null && message.requested.length) + for (var i = 0; i < message.requested.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requested[i]); + if (message.provided != null && message.provided.length) + for (var i = 0; i < message.provided.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.provided[i]); + if (message.allowedRequestExtensions != null && message.allowedRequestExtensions.length) + for (var i = 0; i < message.allowedRequestExtensions.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.allowedRequestExtensions[i]); + if (message.allowedResponseExtensions != null && message.allowedResponseExtensions.length) + for (var i = 0; i < message.allowedResponseExtensions.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.allowedResponseExtensions[i]); + return writer; + }; + + /** + * Encodes the specified ContextRule message, length delimited. Does not implicitly {@link google.api.ContextRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ContextRule + * @static + * @param {google.api.IContextRule} message ContextRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContextRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.ContextRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ContextRule} ContextRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextRule.decode = function 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.ContextRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + if (!(message.requested && message.requested.length)) + message.requested = []; + message.requested.push(reader.string()); + break; + } + case 3: { + if (!(message.provided && message.provided.length)) + message.provided = []; + message.provided.push(reader.string()); + break; + } + case 4: { + if (!(message.allowedRequestExtensions && message.allowedRequestExtensions.length)) + message.allowedRequestExtensions = []; + message.allowedRequestExtensions.push(reader.string()); + break; + } + case 5: { + if (!(message.allowedResponseExtensions && message.allowedResponseExtensions.length)) + message.allowedResponseExtensions = []; + message.allowedResponseExtensions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContextRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ContextRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ContextRule} ContextRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContextRule message. + * @function verify + * @memberof google.api.ContextRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.requested != null && message.hasOwnProperty("requested")) { + if (!Array.isArray(message.requested)) + return "requested: array expected"; + for (var i = 0; i < message.requested.length; ++i) + if (!$util.isString(message.requested[i])) + return "requested: string[] expected"; + } + if (message.provided != null && message.hasOwnProperty("provided")) { + if (!Array.isArray(message.provided)) + return "provided: array expected"; + for (var i = 0; i < message.provided.length; ++i) + if (!$util.isString(message.provided[i])) + return "provided: string[] expected"; + } + if (message.allowedRequestExtensions != null && message.hasOwnProperty("allowedRequestExtensions")) { + if (!Array.isArray(message.allowedRequestExtensions)) + return "allowedRequestExtensions: array expected"; + for (var i = 0; i < message.allowedRequestExtensions.length; ++i) + if (!$util.isString(message.allowedRequestExtensions[i])) + return "allowedRequestExtensions: string[] expected"; + } + if (message.allowedResponseExtensions != null && message.hasOwnProperty("allowedResponseExtensions")) { + if (!Array.isArray(message.allowedResponseExtensions)) + return "allowedResponseExtensions: array expected"; + for (var i = 0; i < message.allowedResponseExtensions.length; ++i) + if (!$util.isString(message.allowedResponseExtensions[i])) + return "allowedResponseExtensions: string[] expected"; + } + return null; + }; + + /** + * Creates a ContextRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ContextRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.ContextRule} ContextRule + */ + ContextRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ContextRule) + return object; + var message = new $root.google.api.ContextRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.requested) { + if (!Array.isArray(object.requested)) + throw TypeError(".google.api.ContextRule.requested: array expected"); + message.requested = []; + for (var i = 0; i < object.requested.length; ++i) + message.requested[i] = String(object.requested[i]); + } + if (object.provided) { + if (!Array.isArray(object.provided)) + throw TypeError(".google.api.ContextRule.provided: array expected"); + message.provided = []; + for (var i = 0; i < object.provided.length; ++i) + message.provided[i] = String(object.provided[i]); + } + if (object.allowedRequestExtensions) { + if (!Array.isArray(object.allowedRequestExtensions)) + throw TypeError(".google.api.ContextRule.allowedRequestExtensions: array expected"); + message.allowedRequestExtensions = []; + for (var i = 0; i < object.allowedRequestExtensions.length; ++i) + message.allowedRequestExtensions[i] = String(object.allowedRequestExtensions[i]); + } + if (object.allowedResponseExtensions) { + if (!Array.isArray(object.allowedResponseExtensions)) + throw TypeError(".google.api.ContextRule.allowedResponseExtensions: array expected"); + message.allowedResponseExtensions = []; + for (var i = 0; i < object.allowedResponseExtensions.length; ++i) + message.allowedResponseExtensions[i] = String(object.allowedResponseExtensions[i]); + } + return message; + }; + + /** + * Creates a plain object from a ContextRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ContextRule + * @static + * @param {google.api.ContextRule} message ContextRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.requested = []; + object.provided = []; + object.allowedRequestExtensions = []; + object.allowedResponseExtensions = []; + } + if (options.defaults) + object.selector = ""; + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.requested && message.requested.length) { + object.requested = []; + for (var j = 0; j < message.requested.length; ++j) + object.requested[j] = message.requested[j]; + } + if (message.provided && message.provided.length) { + object.provided = []; + for (var j = 0; j < message.provided.length; ++j) + object.provided[j] = message.provided[j]; + } + if (message.allowedRequestExtensions && message.allowedRequestExtensions.length) { + object.allowedRequestExtensions = []; + for (var j = 0; j < message.allowedRequestExtensions.length; ++j) + object.allowedRequestExtensions[j] = message.allowedRequestExtensions[j]; + } + if (message.allowedResponseExtensions && message.allowedResponseExtensions.length) { + object.allowedResponseExtensions = []; + for (var j = 0; j < message.allowedResponseExtensions.length; ++j) + object.allowedResponseExtensions[j] = message.allowedResponseExtensions[j]; + } + return object; + }; + + /** + * Converts this ContextRule to JSON. + * @function toJSON + * @memberof google.api.ContextRule + * @instance + * @returns {Object.} JSON object + */ + ContextRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContextRule + * @function getTypeUrl + * @memberof google.api.ContextRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContextRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ContextRule"; + }; + + return ContextRule; + })(); + + api.Control = (function() { + + /** + * Properties of a Control. + * @memberof google.api + * @interface IControl + * @property {string|null} [environment] Control environment + */ + + /** + * Constructs a new Control. + * @memberof google.api + * @classdesc Represents a Control. + * @implements IControl + * @constructor + * @param {google.api.IControl=} [properties] Properties to set + */ + function Control(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Control environment. + * @member {string} environment + * @memberof google.api.Control + * @instance + */ + Control.prototype.environment = ""; + + /** + * Creates a new Control instance using the specified properties. + * @function create + * @memberof google.api.Control + * @static + * @param {google.api.IControl=} [properties] Properties to set + * @returns {google.api.Control} Control instance + */ + Control.create = function create(properties) { + return new Control(properties); + }; + + /** + * Encodes the specified Control message. Does not implicitly {@link google.api.Control.verify|verify} messages. + * @function encode + * @memberof google.api.Control + * @static + * @param {google.api.IControl} message Control message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Control.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + return writer; + }; + + /** + * Encodes the specified Control message, length delimited. Does not implicitly {@link google.api.Control.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Control + * @static + * @param {google.api.IControl} message Control message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Control.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Control message from the specified reader or buffer. + * @function decode + * @memberof google.api.Control + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Control} Control + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Control.decode = function 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.Control(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.environment = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Control message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Control + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Control} Control + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Control.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Control message. + * @function verify + * @memberof google.api.Control + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Control.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + return null; + }; + + /** + * Creates a Control message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Control + * @static + * @param {Object.} object Plain object + * @returns {google.api.Control} Control + */ + Control.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Control) + return object; + var message = new $root.google.api.Control(); + if (object.environment != null) + message.environment = String(object.environment); + return message; + }; + + /** + * Creates a plain object from a Control message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Control + * @static + * @param {google.api.Control} message Control + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Control.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.environment = ""; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + return object; + }; + + /** + * Converts this Control to JSON. + * @function toJSON + * @memberof google.api.Control + * @instance + * @returns {Object.} JSON object + */ + Control.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Control + * @function getTypeUrl + * @memberof google.api.Control + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Control.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Control"; + }; + + return Control; + })(); + + api.Documentation = (function() { + + /** + * Properties of a Documentation. + * @memberof google.api + * @interface IDocumentation + * @property {string|null} [summary] Documentation summary + * @property {Array.|null} [pages] Documentation pages + * @property {Array.|null} [rules] Documentation rules + * @property {string|null} [documentationRootUrl] Documentation documentationRootUrl + * @property {string|null} [serviceRootUrl] Documentation serviceRootUrl + * @property {string|null} [overview] Documentation overview + */ + + /** + * Constructs a new Documentation. + * @memberof google.api + * @classdesc Represents a Documentation. + * @implements IDocumentation + * @constructor + * @param {google.api.IDocumentation=} [properties] Properties to set + */ + function Documentation(properties) { + this.pages = []; + 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]]; + } + + /** + * Documentation summary. + * @member {string} summary + * @memberof google.api.Documentation + * @instance + */ + Documentation.prototype.summary = ""; + + /** + * Documentation pages. + * @member {Array.} pages + * @memberof google.api.Documentation + * @instance + */ + Documentation.prototype.pages = $util.emptyArray; + + /** + * Documentation rules. + * @member {Array.} rules + * @memberof google.api.Documentation + * @instance + */ + Documentation.prototype.rules = $util.emptyArray; + + /** + * Documentation documentationRootUrl. + * @member {string} documentationRootUrl + * @memberof google.api.Documentation + * @instance + */ + Documentation.prototype.documentationRootUrl = ""; + + /** + * Documentation serviceRootUrl. + * @member {string} serviceRootUrl + * @memberof google.api.Documentation + * @instance + */ + Documentation.prototype.serviceRootUrl = ""; + + /** + * Documentation overview. + * @member {string} overview + * @memberof google.api.Documentation + * @instance + */ + Documentation.prototype.overview = ""; + + /** + * Creates a new Documentation instance using the specified properties. + * @function create + * @memberof google.api.Documentation + * @static + * @param {google.api.IDocumentation=} [properties] Properties to set + * @returns {google.api.Documentation} Documentation instance + */ + Documentation.create = function create(properties) { + return new Documentation(properties); + }; + + /** + * Encodes the specified Documentation message. Does not implicitly {@link google.api.Documentation.verify|verify} messages. + * @function encode + * @memberof google.api.Documentation + * @static + * @param {google.api.IDocumentation} message Documentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documentation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.summary); + if (message.overview != null && Object.hasOwnProperty.call(message, "overview")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.overview); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.DocumentationRule.encode(message.rules[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentationRootUrl != null && Object.hasOwnProperty.call(message, "documentationRootUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.documentationRootUrl); + if (message.pages != null && message.pages.length) + for (var i = 0; i < message.pages.length; ++i) + $root.google.api.Page.encode(message.pages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.serviceRootUrl != null && Object.hasOwnProperty.call(message, "serviceRootUrl")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceRootUrl); + return writer; + }; + + /** + * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.api.Documentation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Documentation + * @static + * @param {google.api.IDocumentation} message Documentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documentation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Documentation message from the specified reader or buffer. + * @function decode + * @memberof google.api.Documentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Documentation} Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documentation.decode = function 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.Documentation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.summary = reader.string(); + break; + } + case 5: { + if (!(message.pages && message.pages.length)) + message.pages = []; + message.pages.push($root.google.api.Page.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.DocumentationRule.decode(reader, reader.uint32())); + break; + } + case 4: { + message.documentationRootUrl = reader.string(); + break; + } + case 6: { + message.serviceRootUrl = reader.string(); + break; + } + case 2: { + message.overview = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Documentation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Documentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Documentation} Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documentation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Documentation message. + * @function verify + * @memberof google.api.Documentation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documentation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.summary != null && message.hasOwnProperty("summary")) + if (!$util.isString(message.summary)) + return "summary: string expected"; + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) { + var error = $root.google.api.Page.verify(message.pages[i]); + if (error) + return "pages." + error; + } + } + 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.DocumentationRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.documentationRootUrl != null && message.hasOwnProperty("documentationRootUrl")) + if (!$util.isString(message.documentationRootUrl)) + return "documentationRootUrl: string expected"; + if (message.serviceRootUrl != null && message.hasOwnProperty("serviceRootUrl")) + if (!$util.isString(message.serviceRootUrl)) + return "serviceRootUrl: string expected"; + if (message.overview != null && message.hasOwnProperty("overview")) + if (!$util.isString(message.overview)) + return "overview: string expected"; + return null; + }; + + /** + * Creates a Documentation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Documentation + * @static + * @param {Object.} object Plain object + * @returns {google.api.Documentation} Documentation + */ + Documentation.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Documentation) + return object; + var message = new $root.google.api.Documentation(); + if (object.summary != null) + message.summary = String(object.summary); + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.api.Documentation.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) { + if (typeof object.pages[i] !== "object") + throw TypeError(".google.api.Documentation.pages: object expected"); + message.pages[i] = $root.google.api.Page.fromObject(object.pages[i]); + } + } + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Documentation.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Documentation.rules: object expected"); + message.rules[i] = $root.google.api.DocumentationRule.fromObject(object.rules[i]); + } + } + if (object.documentationRootUrl != null) + message.documentationRootUrl = String(object.documentationRootUrl); + if (object.serviceRootUrl != null) + message.serviceRootUrl = String(object.serviceRootUrl); + if (object.overview != null) + message.overview = String(object.overview); + return message; + }; + + /** + * Creates a plain object from a Documentation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Documentation + * @static + * @param {google.api.Documentation} message Documentation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documentation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.rules = []; + object.pages = []; + } + if (options.defaults) { + object.summary = ""; + object.overview = ""; + object.documentationRootUrl = ""; + object.serviceRootUrl = ""; + } + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = message.summary; + if (message.overview != null && message.hasOwnProperty("overview")) + object.overview = message.overview; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.DocumentationRule.toObject(message.rules[j], options); + } + if (message.documentationRootUrl != null && message.hasOwnProperty("documentationRootUrl")) + object.documentationRootUrl = message.documentationRootUrl; + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = $root.google.api.Page.toObject(message.pages[j], options); + } + if (message.serviceRootUrl != null && message.hasOwnProperty("serviceRootUrl")) + object.serviceRootUrl = message.serviceRootUrl; + return object; + }; + + /** + * Converts this Documentation to JSON. + * @function toJSON + * @memberof google.api.Documentation + * @instance + * @returns {Object.} JSON object + */ + Documentation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Documentation + * @function getTypeUrl + * @memberof google.api.Documentation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Documentation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Documentation"; + }; + + return Documentation; + })(); + + api.DocumentationRule = (function() { + + /** + * Properties of a DocumentationRule. + * @memberof google.api + * @interface IDocumentationRule + * @property {string|null} [selector] DocumentationRule selector + * @property {string|null} [description] DocumentationRule description + * @property {string|null} [deprecationDescription] DocumentationRule deprecationDescription + */ + + /** + * Constructs a new DocumentationRule. + * @memberof google.api + * @classdesc Represents a DocumentationRule. + * @implements IDocumentationRule + * @constructor + * @param {google.api.IDocumentationRule=} [properties] Properties to set + */ + function DocumentationRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentationRule selector. + * @member {string} selector + * @memberof google.api.DocumentationRule + * @instance + */ + DocumentationRule.prototype.selector = ""; + + /** + * DocumentationRule description. + * @member {string} description + * @memberof google.api.DocumentationRule + * @instance + */ + DocumentationRule.prototype.description = ""; + + /** + * DocumentationRule deprecationDescription. + * @member {string} deprecationDescription + * @memberof google.api.DocumentationRule + * @instance + */ + DocumentationRule.prototype.deprecationDescription = ""; + + /** + * Creates a new DocumentationRule instance using the specified properties. + * @function create + * @memberof google.api.DocumentationRule + * @static + * @param {google.api.IDocumentationRule=} [properties] Properties to set + * @returns {google.api.DocumentationRule} DocumentationRule instance + */ + DocumentationRule.create = function create(properties) { + return new DocumentationRule(properties); + }; + + /** + * Encodes the specified DocumentationRule message. Does not implicitly {@link google.api.DocumentationRule.verify|verify} messages. + * @function encode + * @memberof google.api.DocumentationRule + * @static + * @param {google.api.IDocumentationRule} message DocumentationRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentationRule.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.deprecationDescription != null && Object.hasOwnProperty.call(message, "deprecationDescription")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationDescription); + return writer; + }; + + /** + * Encodes the specified DocumentationRule message, length delimited. Does not implicitly {@link google.api.DocumentationRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DocumentationRule + * @static + * @param {google.api.IDocumentationRule} message DocumentationRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentationRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentationRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.DocumentationRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DocumentationRule} DocumentationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentationRule.decode = function 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.DocumentationRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.deprecationDescription = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentationRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DocumentationRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DocumentationRule} DocumentationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentationRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentationRule message. + * @function verify + * @memberof google.api.DocumentationRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentationRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.deprecationDescription != null && message.hasOwnProperty("deprecationDescription")) + if (!$util.isString(message.deprecationDescription)) + return "deprecationDescription: string expected"; + return null; + }; + + /** + * Creates a DocumentationRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DocumentationRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.DocumentationRule} DocumentationRule + */ + DocumentationRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DocumentationRule) + return object; + var message = new $root.google.api.DocumentationRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.description != null) + message.description = String(object.description); + if (object.deprecationDescription != null) + message.deprecationDescription = String(object.deprecationDescription); + return message; + }; + + /** + * Creates a plain object from a DocumentationRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DocumentationRule + * @static + * @param {google.api.DocumentationRule} message DocumentationRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentationRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selector = ""; + object.description = ""; + object.deprecationDescription = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.deprecationDescription != null && message.hasOwnProperty("deprecationDescription")) + object.deprecationDescription = message.deprecationDescription; + return object; + }; + + /** + * Converts this DocumentationRule to JSON. + * @function toJSON + * @memberof google.api.DocumentationRule + * @instance + * @returns {Object.} JSON object + */ + DocumentationRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentationRule + * @function getTypeUrl + * @memberof google.api.DocumentationRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentationRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DocumentationRule"; + }; + + return DocumentationRule; + })(); + + api.Page = (function() { + + /** + * Properties of a Page. + * @memberof google.api + * @interface IPage + * @property {string|null} [name] Page name + * @property {string|null} [content] Page content + * @property {Array.|null} [subpages] Page subpages + */ + + /** + * Constructs a new Page. + * @memberof google.api + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {google.api.IPage=} [properties] Properties to set + */ + function Page(properties) { + this.subpages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Page name. + * @member {string} name + * @memberof google.api.Page + * @instance + */ + Page.prototype.name = ""; + + /** + * Page content. + * @member {string} content + * @memberof google.api.Page + * @instance + */ + Page.prototype.content = ""; + + /** + * Page subpages. + * @member {Array.} subpages + * @memberof google.api.Page + * @instance + */ + Page.prototype.subpages = $util.emptyArray; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof google.api.Page + * @static + * @param {google.api.IPage=} [properties] Properties to set + * @returns {google.api.Page} Page instance + */ + Page.create = function create(properties) { + return new Page(properties); + }; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.api.Page.verify|verify} messages. + * @function encode + * @memberof google.api.Page + * @static + * @param {google.api.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encode = function encode(message, writer) { + 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.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + if (message.subpages != null && message.subpages.length) + for (var i = 0; i < message.subpages.length; ++i) + $root.google.api.Page.encode(message.subpages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.api.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Page + * @static + * @param {google.api.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Page message from the specified reader or buffer. + * @function decode + * @memberof google.api.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decode = function 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.Page(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.content = reader.string(); + break; + } + case 3: { + if (!(message.subpages && message.subpages.length)) + message.subpages = []; + message.subpages.push($root.google.api.Page.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Page message. + * @function verify + * @memberof google.api.Page + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Page.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.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.subpages != null && message.hasOwnProperty("subpages")) { + if (!Array.isArray(message.subpages)) + return "subpages: array expected"; + for (var i = 0; i < message.subpages.length; ++i) { + var error = $root.google.api.Page.verify(message.subpages[i]); + if (error) + return "subpages." + error; + } + } + return null; + }; + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Page + * @static + * @param {Object.} object Plain object + * @returns {google.api.Page} Page + */ + Page.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Page) + return object; + var message = new $root.google.api.Page(); + if (object.name != null) + message.name = String(object.name); + if (object.content != null) + message.content = String(object.content); + if (object.subpages) { + if (!Array.isArray(object.subpages)) + throw TypeError(".google.api.Page.subpages: array expected"); + message.subpages = []; + for (var i = 0; i < object.subpages.length; ++i) { + if (typeof object.subpages[i] !== "object") + throw TypeError(".google.api.Page.subpages: object expected"); + message.subpages[i] = $root.google.api.Page.fromObject(object.subpages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Page + * @static + * @param {google.api.Page} message Page + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Page.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subpages = []; + if (options.defaults) { + object.name = ""; + object.content = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.subpages && message.subpages.length) { + object.subpages = []; + for (var j = 0; j < message.subpages.length; ++j) + object.subpages[j] = $root.google.api.Page.toObject(message.subpages[j], options); + } + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof google.api.Page + * @instance + * @returns {Object.} JSON object + */ + Page.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Page + * @function getTypeUrl + * @memberof google.api.Page + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Page.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Page"; + }; + + return Page; + })(); + + api.Endpoint = (function() { + + /** + * Properties of an Endpoint. + * @memberof google.api + * @interface IEndpoint + * @property {string|null} [name] Endpoint name + * @property {Array.|null} [aliases] Endpoint aliases + * @property {string|null} [target] Endpoint target + * @property {boolean|null} [allowCors] Endpoint allowCors + */ + + /** + * Constructs a new Endpoint. + * @memberof google.api + * @classdesc Represents an Endpoint. + * @implements IEndpoint + * @constructor + * @param {google.api.IEndpoint=} [properties] Properties to set + */ + function Endpoint(properties) { + this.aliases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Endpoint name. + * @member {string} name + * @memberof google.api.Endpoint + * @instance + */ + Endpoint.prototype.name = ""; + + /** + * Endpoint aliases. + * @member {Array.} aliases + * @memberof google.api.Endpoint + * @instance + */ + Endpoint.prototype.aliases = $util.emptyArray; + + /** + * Endpoint target. + * @member {string} target + * @memberof google.api.Endpoint + * @instance + */ + Endpoint.prototype.target = ""; + + /** + * Endpoint allowCors. + * @member {boolean} allowCors + * @memberof google.api.Endpoint + * @instance + */ + Endpoint.prototype.allowCors = false; + + /** + * Creates a new Endpoint instance using the specified properties. + * @function create + * @memberof google.api.Endpoint + * @static + * @param {google.api.IEndpoint=} [properties] Properties to set + * @returns {google.api.Endpoint} Endpoint instance + */ + Endpoint.create = function create(properties) { + return new Endpoint(properties); + }; + + /** + * Encodes the specified Endpoint message. Does not implicitly {@link google.api.Endpoint.verify|verify} messages. + * @function encode + * @memberof google.api.Endpoint + * @static + * @param {google.api.IEndpoint} message Endpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Endpoint.encode = function encode(message, writer) { + 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.aliases != null && message.aliases.length) + for (var i = 0; i < message.aliases.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.aliases[i]); + if (message.allowCors != null && Object.hasOwnProperty.call(message, "allowCors")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowCors); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.target); + return writer; + }; + + /** + * Encodes the specified Endpoint message, length delimited. Does not implicitly {@link google.api.Endpoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Endpoint + * @static + * @param {google.api.IEndpoint} message Endpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Endpoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Endpoint message from the specified reader or buffer. + * @function decode + * @memberof google.api.Endpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Endpoint} Endpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Endpoint.decode = function 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.Endpoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.aliases && message.aliases.length)) + message.aliases = []; + message.aliases.push(reader.string()); + break; + } + case 101: { + message.target = reader.string(); + break; + } + case 5: { + message.allowCors = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Endpoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Endpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Endpoint} Endpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Endpoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Endpoint message. + * @function verify + * @memberof google.api.Endpoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Endpoint.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.aliases != null && message.hasOwnProperty("aliases")) { + if (!Array.isArray(message.aliases)) + return "aliases: array expected"; + for (var i = 0; i < message.aliases.length; ++i) + if (!$util.isString(message.aliases[i])) + return "aliases: string[] expected"; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.allowCors != null && message.hasOwnProperty("allowCors")) + if (typeof message.allowCors !== "boolean") + return "allowCors: boolean expected"; + return null; + }; + + /** + * Creates an Endpoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Endpoint + * @static + * @param {Object.} object Plain object + * @returns {google.api.Endpoint} Endpoint + */ + Endpoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Endpoint) + return object; + var message = new $root.google.api.Endpoint(); + if (object.name != null) + message.name = String(object.name); + if (object.aliases) { + if (!Array.isArray(object.aliases)) + throw TypeError(".google.api.Endpoint.aliases: array expected"); + message.aliases = []; + for (var i = 0; i < object.aliases.length; ++i) + message.aliases[i] = String(object.aliases[i]); + } + if (object.target != null) + message.target = String(object.target); + if (object.allowCors != null) + message.allowCors = Boolean(object.allowCors); + return message; + }; + + /** + * Creates a plain object from an Endpoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Endpoint + * @static + * @param {google.api.Endpoint} message Endpoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Endpoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aliases = []; + if (options.defaults) { + object.name = ""; + object.allowCors = false; + object.target = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.aliases && message.aliases.length) { + object.aliases = []; + for (var j = 0; j < message.aliases.length; ++j) + object.aliases[j] = message.aliases[j]; + } + if (message.allowCors != null && message.hasOwnProperty("allowCors")) + object.allowCors = message.allowCors; + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + return object; + }; + + /** + * Converts this Endpoint to JSON. + * @function toJSON + * @memberof google.api.Endpoint + * @instance + * @returns {Object.} JSON object + */ + Endpoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Endpoint + * @function getTypeUrl + * @memberof google.api.Endpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Endpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Endpoint"; + }; + + return Endpoint; + })(); + + api.LogDescriptor = (function() { + + /** + * Properties of a LogDescriptor. + * @memberof google.api + * @interface ILogDescriptor + * @property {string|null} [name] LogDescriptor name + * @property {Array.|null} [labels] LogDescriptor labels + * @property {string|null} [description] LogDescriptor description + * @property {string|null} [displayName] LogDescriptor displayName + */ + + /** + * Constructs a new LogDescriptor. + * @memberof google.api + * @classdesc Represents a LogDescriptor. + * @implements ILogDescriptor + * @constructor + * @param {google.api.ILogDescriptor=} [properties] Properties to set + */ + function LogDescriptor(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]]; + } + + /** + * LogDescriptor name. + * @member {string} name + * @memberof google.api.LogDescriptor + * @instance + */ + LogDescriptor.prototype.name = ""; + + /** + * LogDescriptor labels. + * @member {Array.} labels + * @memberof google.api.LogDescriptor + * @instance + */ + LogDescriptor.prototype.labels = $util.emptyArray; + + /** + * LogDescriptor description. + * @member {string} description + * @memberof google.api.LogDescriptor + * @instance + */ + LogDescriptor.prototype.description = ""; + + /** + * LogDescriptor displayName. + * @member {string} displayName + * @memberof google.api.LogDescriptor + * @instance + */ + LogDescriptor.prototype.displayName = ""; + + /** + * Creates a new LogDescriptor instance using the specified properties. + * @function create + * @memberof google.api.LogDescriptor + * @static + * @param {google.api.ILogDescriptor=} [properties] Properties to set + * @returns {google.api.LogDescriptor} LogDescriptor instance + */ + LogDescriptor.create = function create(properties) { + return new LogDescriptor(properties); + }; + + /** + * Encodes the specified LogDescriptor message. Does not implicitly {@link google.api.LogDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.LogDescriptor + * @static + * @param {google.api.ILogDescriptor} message LogDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + $root.google.api.LabelDescriptor.encode(message.labels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified LogDescriptor message, length delimited. Does not implicitly {@link google.api.LogDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.LogDescriptor + * @static + * @param {google.api.ILogDescriptor} message LogDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.LogDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.LogDescriptor} LogDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogDescriptor.decode = function 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.LogDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.api.LabelDescriptor.decode(reader, reader.uint32())); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.LogDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.LogDescriptor} LogDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogDescriptor message. + * @function verify + * @memberof google.api.LogDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogDescriptor.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.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) { + var error = $root.google.api.LabelDescriptor.verify(message.labels[i]); + if (error) + return "labels." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a LogDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.LogDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.LogDescriptor} LogDescriptor + */ + LogDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.LogDescriptor) + return object; + var message = new $root.google.api.LogDescriptor(); + if (object.name != null) + message.name = String(object.name); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.api.LogDescriptor.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) { + if (typeof object.labels[i] !== "object") + throw TypeError(".google.api.LogDescriptor.labels: object expected"); + message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i]); + } + } + if (object.description != null) + message.description = String(object.description); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a LogDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.LogDescriptor + * @static + * @param {google.api.LogDescriptor} message LogDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.labels = []; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = $root.google.api.LabelDescriptor.toObject(message.labels[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this LogDescriptor to JSON. + * @function toJSON + * @memberof google.api.LogDescriptor + * @instance + * @returns {Object.} JSON object + */ + LogDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogDescriptor + * @function getTypeUrl + * @memberof google.api.LogDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.LogDescriptor"; + }; + + return LogDescriptor; + })(); + + api.LabelDescriptor = (function() { + + /** + * Properties of a LabelDescriptor. + * @memberof google.api + * @interface ILabelDescriptor + * @property {string|null} [key] LabelDescriptor key + * @property {google.api.LabelDescriptor.ValueType|null} [valueType] LabelDescriptor valueType + * @property {string|null} [description] LabelDescriptor description + */ + + /** + * Constructs a new LabelDescriptor. + * @memberof google.api + * @classdesc Represents a LabelDescriptor. + * @implements ILabelDescriptor + * @constructor + * @param {google.api.ILabelDescriptor=} [properties] Properties to set + */ + function LabelDescriptor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelDescriptor key. + * @member {string} key + * @memberof google.api.LabelDescriptor + * @instance + */ + LabelDescriptor.prototype.key = ""; + + /** + * LabelDescriptor valueType. + * @member {google.api.LabelDescriptor.ValueType} valueType + * @memberof google.api.LabelDescriptor + * @instance + */ + LabelDescriptor.prototype.valueType = 0; + + /** + * LabelDescriptor description. + * @member {string} description + * @memberof google.api.LabelDescriptor + * @instance + */ + LabelDescriptor.prototype.description = ""; + + /** + * Creates a new LabelDescriptor instance using the specified properties. + * @function create + * @memberof google.api.LabelDescriptor + * @static + * @param {google.api.ILabelDescriptor=} [properties] Properties to set + * @returns {google.api.LabelDescriptor} LabelDescriptor instance + */ + LabelDescriptor.create = function create(properties) { + return new LabelDescriptor(properties); + }; + + /** + * Encodes the specified LabelDescriptor message. Does not implicitly {@link google.api.LabelDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.LabelDescriptor + * @static + * @param {google.api.ILabelDescriptor} message LabelDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.valueType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified LabelDescriptor message, length delimited. Does not implicitly {@link google.api.LabelDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.LabelDescriptor + * @static + * @param {google.api.ILabelDescriptor} message LabelDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.LabelDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.LabelDescriptor} LabelDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDescriptor.decode = function 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.LabelDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.valueType = reader.int32(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.LabelDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.LabelDescriptor} LabelDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelDescriptor message. + * @function verify + * @memberof google.api.LabelDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a LabelDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.LabelDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.LabelDescriptor} LabelDescriptor + */ + LabelDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.LabelDescriptor) + return object; + var message = new $root.google.api.LabelDescriptor(); + if (object.key != null) + message.key = String(object.key); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + case "STRING": + case 0: + message.valueType = 0; + break; + case "BOOL": + case 1: + message.valueType = 1; + break; + case "INT64": + case 2: + message.valueType = 2; + break; + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a LabelDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.LabelDescriptor + * @static + * @param {google.api.LabelDescriptor} message LabelDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.valueType = options.enums === String ? "STRING" : 0; + object.description = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.api.LabelDescriptor.ValueType[message.valueType] === undefined ? message.valueType : $root.google.api.LabelDescriptor.ValueType[message.valueType] : message.valueType; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this LabelDescriptor to JSON. + * @function toJSON + * @memberof google.api.LabelDescriptor + * @instance + * @returns {Object.} JSON object + */ + LabelDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelDescriptor + * @function getTypeUrl + * @memberof google.api.LabelDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.LabelDescriptor"; + }; + + /** + * ValueType enum. + * @name google.api.LabelDescriptor.ValueType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} BOOL=1 BOOL value + * @property {number} INT64=2 INT64 value + */ + LabelDescriptor.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "BOOL"] = 1; + values[valuesById[2] = "INT64"] = 2; + return values; + })(); + + return LabelDescriptor; + })(); + + api.Logging = (function() { + + /** + * Properties of a Logging. + * @memberof google.api + * @interface ILogging + * @property {Array.|null} [producerDestinations] Logging producerDestinations + * @property {Array.|null} [consumerDestinations] Logging consumerDestinations + */ + + /** + * Constructs a new Logging. + * @memberof google.api + * @classdesc Represents a Logging. + * @implements ILogging + * @constructor + * @param {google.api.ILogging=} [properties] Properties to set + */ + function Logging(properties) { + this.producerDestinations = []; + this.consumerDestinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Logging producerDestinations. + * @member {Array.} producerDestinations + * @memberof google.api.Logging + * @instance + */ + Logging.prototype.producerDestinations = $util.emptyArray; + + /** + * Logging consumerDestinations. + * @member {Array.} consumerDestinations + * @memberof google.api.Logging + * @instance + */ + Logging.prototype.consumerDestinations = $util.emptyArray; + + /** + * Creates a new Logging instance using the specified properties. + * @function create + * @memberof google.api.Logging + * @static + * @param {google.api.ILogging=} [properties] Properties to set + * @returns {google.api.Logging} Logging instance + */ + Logging.create = function create(properties) { + return new Logging(properties); + }; + + /** + * Encodes the specified Logging message. Does not implicitly {@link google.api.Logging.verify|verify} messages. + * @function encode + * @memberof google.api.Logging + * @static + * @param {google.api.ILogging} message Logging message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Logging.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.producerDestinations != null && message.producerDestinations.length) + for (var i = 0; i < message.producerDestinations.length; ++i) + $root.google.api.Logging.LoggingDestination.encode(message.producerDestinations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consumerDestinations != null && message.consumerDestinations.length) + for (var i = 0; i < message.consumerDestinations.length; ++i) + $root.google.api.Logging.LoggingDestination.encode(message.consumerDestinations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Logging message, length delimited. Does not implicitly {@link google.api.Logging.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Logging + * @static + * @param {google.api.ILogging} message Logging message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Logging.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Logging message from the specified reader or buffer. + * @function decode + * @memberof google.api.Logging + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Logging} Logging + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Logging.decode = function 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.Logging(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.producerDestinations && message.producerDestinations.length)) + message.producerDestinations = []; + message.producerDestinations.push($root.google.api.Logging.LoggingDestination.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.consumerDestinations && message.consumerDestinations.length)) + message.consumerDestinations = []; + message.consumerDestinations.push($root.google.api.Logging.LoggingDestination.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Logging message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Logging + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Logging} Logging + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Logging.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Logging message. + * @function verify + * @memberof google.api.Logging + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Logging.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.producerDestinations != null && message.hasOwnProperty("producerDestinations")) { + if (!Array.isArray(message.producerDestinations)) + return "producerDestinations: array expected"; + for (var i = 0; i < message.producerDestinations.length; ++i) { + var error = $root.google.api.Logging.LoggingDestination.verify(message.producerDestinations[i]); + if (error) + return "producerDestinations." + error; + } + } + if (message.consumerDestinations != null && message.hasOwnProperty("consumerDestinations")) { + if (!Array.isArray(message.consumerDestinations)) + return "consumerDestinations: array expected"; + for (var i = 0; i < message.consumerDestinations.length; ++i) { + var error = $root.google.api.Logging.LoggingDestination.verify(message.consumerDestinations[i]); + if (error) + return "consumerDestinations." + error; + } + } + return null; + }; + + /** + * Creates a Logging message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Logging + * @static + * @param {Object.} object Plain object + * @returns {google.api.Logging} Logging + */ + Logging.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Logging) + return object; + var message = new $root.google.api.Logging(); + if (object.producerDestinations) { + if (!Array.isArray(object.producerDestinations)) + throw TypeError(".google.api.Logging.producerDestinations: array expected"); + message.producerDestinations = []; + for (var i = 0; i < object.producerDestinations.length; ++i) { + if (typeof object.producerDestinations[i] !== "object") + throw TypeError(".google.api.Logging.producerDestinations: object expected"); + message.producerDestinations[i] = $root.google.api.Logging.LoggingDestination.fromObject(object.producerDestinations[i]); + } + } + if (object.consumerDestinations) { + if (!Array.isArray(object.consumerDestinations)) + throw TypeError(".google.api.Logging.consumerDestinations: array expected"); + message.consumerDestinations = []; + for (var i = 0; i < object.consumerDestinations.length; ++i) { + if (typeof object.consumerDestinations[i] !== "object") + throw TypeError(".google.api.Logging.consumerDestinations: object expected"); + message.consumerDestinations[i] = $root.google.api.Logging.LoggingDestination.fromObject(object.consumerDestinations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Logging message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Logging + * @static + * @param {google.api.Logging} message Logging + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Logging.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.producerDestinations = []; + object.consumerDestinations = []; + } + if (message.producerDestinations && message.producerDestinations.length) { + object.producerDestinations = []; + for (var j = 0; j < message.producerDestinations.length; ++j) + object.producerDestinations[j] = $root.google.api.Logging.LoggingDestination.toObject(message.producerDestinations[j], options); + } + if (message.consumerDestinations && message.consumerDestinations.length) { + object.consumerDestinations = []; + for (var j = 0; j < message.consumerDestinations.length; ++j) + object.consumerDestinations[j] = $root.google.api.Logging.LoggingDestination.toObject(message.consumerDestinations[j], options); + } + return object; + }; + + /** + * Converts this Logging to JSON. + * @function toJSON + * @memberof google.api.Logging + * @instance + * @returns {Object.} JSON object + */ + Logging.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Logging + * @function getTypeUrl + * @memberof google.api.Logging + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Logging.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Logging"; + }; + + Logging.LoggingDestination = (function() { + + /** + * Properties of a LoggingDestination. + * @memberof google.api.Logging + * @interface ILoggingDestination + * @property {string|null} [monitoredResource] LoggingDestination monitoredResource + * @property {Array.|null} [logs] LoggingDestination logs + */ + + /** + * Constructs a new LoggingDestination. + * @memberof google.api.Logging + * @classdesc Represents a LoggingDestination. + * @implements ILoggingDestination + * @constructor + * @param {google.api.Logging.ILoggingDestination=} [properties] Properties to set + */ + function LoggingDestination(properties) { + this.logs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoggingDestination monitoredResource. + * @member {string} monitoredResource + * @memberof google.api.Logging.LoggingDestination + * @instance + */ + LoggingDestination.prototype.monitoredResource = ""; + + /** + * LoggingDestination logs. + * @member {Array.} logs + * @memberof google.api.Logging.LoggingDestination + * @instance + */ + LoggingDestination.prototype.logs = $util.emptyArray; + + /** + * Creates a new LoggingDestination instance using the specified properties. + * @function create + * @memberof google.api.Logging.LoggingDestination + * @static + * @param {google.api.Logging.ILoggingDestination=} [properties] Properties to set + * @returns {google.api.Logging.LoggingDestination} LoggingDestination instance + */ + LoggingDestination.create = function create(properties) { + return new LoggingDestination(properties); + }; + + /** + * Encodes the specified LoggingDestination message. Does not implicitly {@link google.api.Logging.LoggingDestination.verify|verify} messages. + * @function encode + * @memberof google.api.Logging.LoggingDestination + * @static + * @param {google.api.Logging.ILoggingDestination} message LoggingDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logs != null && message.logs.length) + for (var i = 0; i < message.logs.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.logs[i]); + if (message.monitoredResource != null && Object.hasOwnProperty.call(message, "monitoredResource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.monitoredResource); + return writer; + }; + + /** + * Encodes the specified LoggingDestination message, length delimited. Does not implicitly {@link google.api.Logging.LoggingDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Logging.LoggingDestination + * @static + * @param {google.api.Logging.ILoggingDestination} message LoggingDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoggingDestination message from the specified reader or buffer. + * @function decode + * @memberof google.api.Logging.LoggingDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Logging.LoggingDestination} LoggingDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingDestination.decode = function 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.Logging.LoggingDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.monitoredResource = reader.string(); + break; + } + case 1: { + if (!(message.logs && message.logs.length)) + message.logs = []; + message.logs.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoggingDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Logging.LoggingDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Logging.LoggingDestination} LoggingDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoggingDestination message. + * @function verify + * @memberof google.api.Logging.LoggingDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoggingDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.monitoredResource != null && message.hasOwnProperty("monitoredResource")) + if (!$util.isString(message.monitoredResource)) + return "monitoredResource: string expected"; + if (message.logs != null && message.hasOwnProperty("logs")) { + if (!Array.isArray(message.logs)) + return "logs: array expected"; + for (var i = 0; i < message.logs.length; ++i) + if (!$util.isString(message.logs[i])) + return "logs: string[] expected"; + } + return null; + }; + + /** + * Creates a LoggingDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Logging.LoggingDestination + * @static + * @param {Object.} object Plain object + * @returns {google.api.Logging.LoggingDestination} LoggingDestination + */ + LoggingDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Logging.LoggingDestination) + return object; + var message = new $root.google.api.Logging.LoggingDestination(); + if (object.monitoredResource != null) + message.monitoredResource = String(object.monitoredResource); + if (object.logs) { + if (!Array.isArray(object.logs)) + throw TypeError(".google.api.Logging.LoggingDestination.logs: array expected"); + message.logs = []; + for (var i = 0; i < object.logs.length; ++i) + message.logs[i] = String(object.logs[i]); + } + return message; + }; + + /** + * Creates a plain object from a LoggingDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Logging.LoggingDestination + * @static + * @param {google.api.Logging.LoggingDestination} message LoggingDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoggingDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.logs = []; + if (options.defaults) + object.monitoredResource = ""; + if (message.logs && message.logs.length) { + object.logs = []; + for (var j = 0; j < message.logs.length; ++j) + object.logs[j] = message.logs[j]; + } + if (message.monitoredResource != null && message.hasOwnProperty("monitoredResource")) + object.monitoredResource = message.monitoredResource; + return object; + }; + + /** + * Converts this LoggingDestination to JSON. + * @function toJSON + * @memberof google.api.Logging.LoggingDestination + * @instance + * @returns {Object.} JSON object + */ + LoggingDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoggingDestination + * @function getTypeUrl + * @memberof google.api.Logging.LoggingDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoggingDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Logging.LoggingDestination"; + }; + + return LoggingDestination; + })(); + + return Logging; + })(); + + api.MetricDescriptor = (function() { + + /** + * Properties of a MetricDescriptor. + * @memberof google.api + * @interface IMetricDescriptor + * @property {string|null} [name] MetricDescriptor name + * @property {string|null} [type] MetricDescriptor type + * @property {Array.|null} [labels] MetricDescriptor labels + * @property {google.api.MetricDescriptor.MetricKind|null} [metricKind] MetricDescriptor metricKind + * @property {google.api.MetricDescriptor.ValueType|null} [valueType] MetricDescriptor valueType + * @property {string|null} [unit] MetricDescriptor unit + * @property {string|null} [description] MetricDescriptor description + * @property {string|null} [displayName] MetricDescriptor displayName + * @property {google.api.MetricDescriptor.IMetricDescriptorMetadata|null} [metadata] MetricDescriptor metadata + * @property {google.api.LaunchStage|null} [launchStage] MetricDescriptor launchStage + * @property {Array.|null} [monitoredResourceTypes] MetricDescriptor monitoredResourceTypes + */ + + /** + * Constructs a new MetricDescriptor. + * @memberof google.api + * @classdesc Represents a MetricDescriptor. + * @implements IMetricDescriptor + * @constructor + * @param {google.api.IMetricDescriptor=} [properties] Properties to set + */ + function MetricDescriptor(properties) { + this.labels = []; + this.monitoredResourceTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricDescriptor name. + * @member {string} name + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.name = ""; + + /** + * MetricDescriptor type. + * @member {string} type + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.type = ""; + + /** + * MetricDescriptor labels. + * @member {Array.} labels + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.labels = $util.emptyArray; + + /** + * MetricDescriptor metricKind. + * @member {google.api.MetricDescriptor.MetricKind} metricKind + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.metricKind = 0; + + /** + * MetricDescriptor valueType. + * @member {google.api.MetricDescriptor.ValueType} valueType + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.valueType = 0; + + /** + * MetricDescriptor unit. + * @member {string} unit + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.unit = ""; + + /** + * MetricDescriptor description. + * @member {string} description + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.description = ""; + + /** + * MetricDescriptor displayName. + * @member {string} displayName + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.displayName = ""; + + /** + * MetricDescriptor metadata. + * @member {google.api.MetricDescriptor.IMetricDescriptorMetadata|null|undefined} metadata + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.metadata = null; + + /** + * MetricDescriptor launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.launchStage = 0; + + /** + * MetricDescriptor monitoredResourceTypes. + * @member {Array.} monitoredResourceTypes + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.monitoredResourceTypes = $util.emptyArray; + + /** + * Creates a new MetricDescriptor instance using the specified properties. + * @function create + * @memberof google.api.MetricDescriptor + * @static + * @param {google.api.IMetricDescriptor=} [properties] Properties to set + * @returns {google.api.MetricDescriptor} MetricDescriptor instance + */ + MetricDescriptor.create = function create(properties) { + return new MetricDescriptor(properties); + }; + + /** + * Encodes the specified MetricDescriptor message. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.MetricDescriptor + * @static + * @param {google.api.IMetricDescriptor} message MetricDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + $root.google.api.LabelDescriptor.encode(message.labels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metricKind != null && Object.hasOwnProperty.call(message, "metricKind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.metricKind); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.valueType); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.unit); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.displayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.type); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.api.MetricDescriptor.MetricDescriptorMetadata.encode(message.metadata, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.launchStage); + if (message.monitoredResourceTypes != null && message.monitoredResourceTypes.length) + for (var i = 0; i < message.monitoredResourceTypes.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.monitoredResourceTypes[i]); + return writer; + }; + + /** + * Encodes the specified MetricDescriptor message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MetricDescriptor + * @static + * @param {google.api.IMetricDescriptor} message MetricDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.MetricDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MetricDescriptor} MetricDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricDescriptor.decode = function 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.MetricDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 8: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.api.LabelDescriptor.decode(reader, reader.uint32())); + break; + } + case 3: { + message.metricKind = reader.int32(); + break; + } + case 4: { + message.valueType = reader.int32(); + break; + } + case 5: { + message.unit = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.displayName = reader.string(); + break; + } + case 10: { + message.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.decode(reader, reader.uint32()); + break; + } + case 12: { + message.launchStage = reader.int32(); + break; + } + case 13: { + if (!(message.monitoredResourceTypes && message.monitoredResourceTypes.length)) + message.monitoredResourceTypes = []; + message.monitoredResourceTypes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MetricDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MetricDescriptor} MetricDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricDescriptor message. + * @function verify + * @memberof google.api.MetricDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricDescriptor.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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) { + var error = $root.google.api.LabelDescriptor.verify(message.labels[i]); + if (error) + return "labels." + error; + } + } + if (message.metricKind != null && message.hasOwnProperty("metricKind")) + switch (message.metricKind) { + default: + return "metricKind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.unit != null && message.hasOwnProperty("unit")) + if (!$util.isString(message.unit)) + return "unit: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.monitoredResourceTypes != null && message.hasOwnProperty("monitoredResourceTypes")) { + if (!Array.isArray(message.monitoredResourceTypes)) + return "monitoredResourceTypes: array expected"; + for (var i = 0; i < message.monitoredResourceTypes.length; ++i) + if (!$util.isString(message.monitoredResourceTypes[i])) + return "monitoredResourceTypes: string[] expected"; + } + return null; + }; + + /** + * Creates a MetricDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MetricDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.MetricDescriptor} MetricDescriptor + */ + MetricDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MetricDescriptor) + return object; + var message = new $root.google.api.MetricDescriptor(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.api.MetricDescriptor.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) { + if (typeof object.labels[i] !== "object") + throw TypeError(".google.api.MetricDescriptor.labels: object expected"); + message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i]); + } + } + switch (object.metricKind) { + default: + if (typeof object.metricKind === "number") { + message.metricKind = object.metricKind; + break; + } + break; + case "METRIC_KIND_UNSPECIFIED": + case 0: + message.metricKind = 0; + break; + case "GAUGE": + case 1: + message.metricKind = 1; + break; + case "DELTA": + case 2: + message.metricKind = 2; + break; + case "CUMULATIVE": + case 3: + message.metricKind = 3; + break; + } + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "BOOL": + case 1: + message.valueType = 1; + break; + case "INT64": + case 2: + message.valueType = 2; + break; + case "DOUBLE": + case 3: + message.valueType = 3; + break; + case "STRING": + case 4: + message.valueType = 4; + break; + case "DISTRIBUTION": + case 5: + message.valueType = 5; + break; + case "MONEY": + case 6: + message.valueType = 6; + break; + } + if (object.unit != null) + message.unit = String(object.unit); + if (object.description != null) + message.description = String(object.description); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.api.MetricDescriptor.metadata: object expected"); + message.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.fromObject(object.metadata); + } + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.monitoredResourceTypes) { + if (!Array.isArray(object.monitoredResourceTypes)) + throw TypeError(".google.api.MetricDescriptor.monitoredResourceTypes: array expected"); + message.monitoredResourceTypes = []; + for (var i = 0; i < object.monitoredResourceTypes.length; ++i) + message.monitoredResourceTypes[i] = String(object.monitoredResourceTypes[i]); + } + return message; + }; + + /** + * Creates a plain object from a MetricDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MetricDescriptor + * @static + * @param {google.api.MetricDescriptor} message MetricDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.labels = []; + object.monitoredResourceTypes = []; + } + if (options.defaults) { + object.name = ""; + object.metricKind = options.enums === String ? "METRIC_KIND_UNSPECIFIED" : 0; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.unit = ""; + object.description = ""; + object.displayName = ""; + object.type = ""; + object.metadata = null; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = $root.google.api.LabelDescriptor.toObject(message.labels[j], options); + } + if (message.metricKind != null && message.hasOwnProperty("metricKind")) + object.metricKind = options.enums === String ? $root.google.api.MetricDescriptor.MetricKind[message.metricKind] === undefined ? message.metricKind : $root.google.api.MetricDescriptor.MetricKind[message.metricKind] : message.metricKind; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.api.MetricDescriptor.ValueType[message.valueType] === undefined ? message.valueType : $root.google.api.MetricDescriptor.ValueType[message.valueType] : message.valueType; + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = message.unit; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.toObject(message.metadata, options); + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.monitoredResourceTypes && message.monitoredResourceTypes.length) { + object.monitoredResourceTypes = []; + for (var j = 0; j < message.monitoredResourceTypes.length; ++j) + object.monitoredResourceTypes[j] = message.monitoredResourceTypes[j]; + } + return object; + }; + + /** + * Converts this MetricDescriptor to JSON. + * @function toJSON + * @memberof google.api.MetricDescriptor + * @instance + * @returns {Object.} JSON object + */ + MetricDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricDescriptor + * @function getTypeUrl + * @memberof google.api.MetricDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MetricDescriptor"; + }; + + MetricDescriptor.MetricDescriptorMetadata = (function() { + + /** + * Properties of a MetricDescriptorMetadata. + * @memberof google.api.MetricDescriptor + * @interface IMetricDescriptorMetadata + * @property {google.api.LaunchStage|null} [launchStage] MetricDescriptorMetadata launchStage + * @property {google.protobuf.IDuration|null} [samplePeriod] MetricDescriptorMetadata samplePeriod + * @property {google.protobuf.IDuration|null} [ingestDelay] MetricDescriptorMetadata ingestDelay + */ + + /** + * Constructs a new MetricDescriptorMetadata. + * @memberof google.api.MetricDescriptor + * @classdesc Represents a MetricDescriptorMetadata. + * @implements IMetricDescriptorMetadata + * @constructor + * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata=} [properties] Properties to set + */ + function MetricDescriptorMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricDescriptorMetadata launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @instance + */ + MetricDescriptorMetadata.prototype.launchStage = 0; + + /** + * MetricDescriptorMetadata samplePeriod. + * @member {google.protobuf.IDuration|null|undefined} samplePeriod + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @instance + */ + MetricDescriptorMetadata.prototype.samplePeriod = null; + + /** + * MetricDescriptorMetadata ingestDelay. + * @member {google.protobuf.IDuration|null|undefined} ingestDelay + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @instance + */ + MetricDescriptorMetadata.prototype.ingestDelay = null; + + /** + * Creates a new MetricDescriptorMetadata instance using the specified properties. + * @function create + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @static + * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata=} [properties] Properties to set + * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata instance + */ + MetricDescriptorMetadata.create = function create(properties) { + return new MetricDescriptorMetadata(properties); + }; + + /** + * Encodes the specified MetricDescriptorMetadata message. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. + * @function encode + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @static + * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata} message MetricDescriptorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricDescriptorMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.launchStage); + if (message.samplePeriod != null && Object.hasOwnProperty.call(message, "samplePeriod")) + $root.google.protobuf.Duration.encode(message.samplePeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ingestDelay != null && Object.hasOwnProperty.call(message, "ingestDelay")) + $root.google.protobuf.Duration.encode(message.ingestDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetricDescriptorMetadata message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @static + * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata} message MetricDescriptorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricDescriptorMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricDescriptorMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricDescriptorMetadata.decode = function 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.MetricDescriptor.MetricDescriptorMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.launchStage = reader.int32(); + break; + } + case 2: { + message.samplePeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ingestDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricDescriptorMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricDescriptorMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricDescriptorMetadata message. + * @function verify + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricDescriptorMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.samplePeriod != null && message.hasOwnProperty("samplePeriod")) { + var error = $root.google.protobuf.Duration.verify(message.samplePeriod); + if (error) + return "samplePeriod." + error; + } + if (message.ingestDelay != null && message.hasOwnProperty("ingestDelay")) { + var error = $root.google.protobuf.Duration.verify(message.ingestDelay); + if (error) + return "ingestDelay." + error; + } + return null; + }; + + /** + * Creates a MetricDescriptorMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata + */ + MetricDescriptorMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MetricDescriptor.MetricDescriptorMetadata) + return object; + var message = new $root.google.api.MetricDescriptor.MetricDescriptorMetadata(); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.samplePeriod != null) { + if (typeof object.samplePeriod !== "object") + throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.samplePeriod: object expected"); + message.samplePeriod = $root.google.protobuf.Duration.fromObject(object.samplePeriod); + } + if (object.ingestDelay != null) { + if (typeof object.ingestDelay !== "object") + throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.ingestDelay: object expected"); + message.ingestDelay = $root.google.protobuf.Duration.fromObject(object.ingestDelay); + } + return message; + }; + + /** + * Creates a plain object from a MetricDescriptorMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @static + * @param {google.api.MetricDescriptor.MetricDescriptorMetadata} message MetricDescriptorMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricDescriptorMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.samplePeriod = null; + object.ingestDelay = null; + } + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.samplePeriod != null && message.hasOwnProperty("samplePeriod")) + object.samplePeriod = $root.google.protobuf.Duration.toObject(message.samplePeriod, options); + if (message.ingestDelay != null && message.hasOwnProperty("ingestDelay")) + object.ingestDelay = $root.google.protobuf.Duration.toObject(message.ingestDelay, options); + return object; + }; + + /** + * Converts this MetricDescriptorMetadata to JSON. + * @function toJSON + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @instance + * @returns {Object.} JSON object + */ + MetricDescriptorMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricDescriptorMetadata + * @function getTypeUrl + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricDescriptorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MetricDescriptor.MetricDescriptorMetadata"; + }; + + return MetricDescriptorMetadata; + })(); + + /** + * MetricKind enum. + * @name google.api.MetricDescriptor.MetricKind + * @enum {number} + * @property {number} METRIC_KIND_UNSPECIFIED=0 METRIC_KIND_UNSPECIFIED value + * @property {number} GAUGE=1 GAUGE value + * @property {number} DELTA=2 DELTA value + * @property {number} CUMULATIVE=3 CUMULATIVE value + */ + MetricDescriptor.MetricKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRIC_KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "GAUGE"] = 1; + values[valuesById[2] = "DELTA"] = 2; + values[valuesById[3] = "CUMULATIVE"] = 3; + return values; + })(); + + /** + * ValueType enum. + * @name google.api.MetricDescriptor.ValueType + * @enum {number} + * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value + * @property {number} BOOL=1 BOOL value + * @property {number} INT64=2 INT64 value + * @property {number} DOUBLE=3 DOUBLE value + * @property {number} STRING=4 STRING value + * @property {number} DISTRIBUTION=5 DISTRIBUTION value + * @property {number} MONEY=6 MONEY value + */ + MetricDescriptor.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BOOL"] = 1; + values[valuesById[2] = "INT64"] = 2; + values[valuesById[3] = "DOUBLE"] = 3; + values[valuesById[4] = "STRING"] = 4; + values[valuesById[5] = "DISTRIBUTION"] = 5; + values[valuesById[6] = "MONEY"] = 6; + return values; + })(); + + return MetricDescriptor; + })(); + + api.Metric = (function() { + + /** + * Properties of a Metric. + * @memberof google.api + * @interface IMetric + * @property {string|null} [type] Metric type + * @property {Object.|null} [labels] Metric labels + */ + + /** + * Constructs a new Metric. + * @memberof google.api + * @classdesc Represents a Metric. + * @implements IMetric + * @constructor + * @param {google.api.IMetric=} [properties] Properties to set + */ + function Metric(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]]; + } + + /** + * Metric type. + * @member {string} type + * @memberof google.api.Metric + * @instance + */ + Metric.prototype.type = ""; + + /** + * Metric labels. + * @member {Object.} labels + * @memberof google.api.Metric + * @instance + */ + Metric.prototype.labels = $util.emptyObject; + + /** + * Creates a new Metric instance using the specified properties. + * @function create + * @memberof google.api.Metric + * @static + * @param {google.api.IMetric=} [properties] Properties to set + * @returns {google.api.Metric} Metric instance + */ + Metric.create = function create(properties) { + return new Metric(properties); + }; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.api.Metric.verify|verify} messages. + * @function encode + * @memberof google.api.Metric + * @static + * @param {google.api.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + return writer; + }; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.api.Metric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Metric + * @static + * @param {google.api.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @function decode + * @memberof google.api.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Metric(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.type = reader.string(); + break; + } + case 2: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metric message. + * @function verify + * @memberof google.api.Metric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metric.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Metric + * @static + * @param {Object.} object Plain object + * @returns {google.api.Metric} Metric + */ + Metric.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Metric) + return object; + var message = new $root.google.api.Metric(); + if (object.type != null) + message.type = String(object.type); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.api.Metric.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Metric + * @static + * @param {google.api.Metric} message Metric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) + object.type = ""; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this Metric to JSON. + * @function toJSON + * @memberof google.api.Metric + * @instance + * @returns {Object.} JSON object + */ + Metric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metric + * @function getTypeUrl + * @memberof google.api.Metric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Metric"; + }; + + return Metric; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + api.MonitoredResourceDescriptor = (function() { + + /** + * Properties of a MonitoredResourceDescriptor. + * @memberof google.api + * @interface IMonitoredResourceDescriptor + * @property {string|null} [name] MonitoredResourceDescriptor name + * @property {string|null} [type] MonitoredResourceDescriptor type + * @property {string|null} [displayName] MonitoredResourceDescriptor displayName + * @property {string|null} [description] MonitoredResourceDescriptor description + * @property {Array.|null} [labels] MonitoredResourceDescriptor labels + * @property {google.api.LaunchStage|null} [launchStage] MonitoredResourceDescriptor launchStage + */ + + /** + * Constructs a new MonitoredResourceDescriptor. + * @memberof google.api + * @classdesc Represents a MonitoredResourceDescriptor. + * @implements IMonitoredResourceDescriptor + * @constructor + * @param {google.api.IMonitoredResourceDescriptor=} [properties] Properties to set + */ + function MonitoredResourceDescriptor(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]]; + } + + /** + * MonitoredResourceDescriptor name. + * @member {string} name + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.name = ""; + + /** + * MonitoredResourceDescriptor type. + * @member {string} type + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.type = ""; + + /** + * MonitoredResourceDescriptor displayName. + * @member {string} displayName + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.displayName = ""; + + /** + * MonitoredResourceDescriptor description. + * @member {string} description + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.description = ""; + + /** + * MonitoredResourceDescriptor labels. + * @member {Array.} labels + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.labels = $util.emptyArray; + + /** + * MonitoredResourceDescriptor launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.MonitoredResourceDescriptor + * @instance + */ + MonitoredResourceDescriptor.prototype.launchStage = 0; + + /** + * Creates a new MonitoredResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {google.api.IMonitoredResourceDescriptor=} [properties] Properties to set + * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor instance + */ + MonitoredResourceDescriptor.create = function create(properties) { + return new MonitoredResourceDescriptor(properties); + }; + + /** + * Encodes the specified MonitoredResourceDescriptor message. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {google.api.IMonitoredResourceDescriptor} message MonitoredResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResourceDescriptor.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + $root.google.api.LabelDescriptor.encode(message.labels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.launchStage); + return writer; + }; + + /** + * Encodes the specified MonitoredResourceDescriptor message, length delimited. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {google.api.IMonitoredResourceDescriptor} message MonitoredResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResourceDescriptor.decode = function 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.MonitoredResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.name = reader.string(); + break; + } + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.api.LabelDescriptor.decode(reader, reader.uint32())); + break; + } + case 7: { + message.launchStage = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MonitoredResourceDescriptor message. + * @function verify + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MonitoredResourceDescriptor.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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) { + var error = $root.google.api.LabelDescriptor.verify(message.labels[i]); + if (error) + return "labels." + error; + } + } + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a MonitoredResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor + */ + MonitoredResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MonitoredResourceDescriptor) + return object; + var message = new $root.google.api.MonitoredResourceDescriptor(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.api.MonitoredResourceDescriptor.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) { + if (typeof object.labels[i] !== "object") + throw TypeError(".google.api.MonitoredResourceDescriptor.labels: object expected"); + message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i]); + } + } + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a MonitoredResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {google.api.MonitoredResourceDescriptor} message MonitoredResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MonitoredResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.labels = []; + if (options.defaults) { + object.type = ""; + object.displayName = ""; + object.description = ""; + object.name = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = $root.google.api.LabelDescriptor.toObject(message.labels[j], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + return object; + }; + + /** + * Converts this MonitoredResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.MonitoredResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + MonitoredResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MonitoredResourceDescriptor + * @function getTypeUrl + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MonitoredResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MonitoredResourceDescriptor"; + }; + + return MonitoredResourceDescriptor; + })(); + + api.MonitoredResource = (function() { + + /** + * Properties of a MonitoredResource. + * @memberof google.api + * @interface IMonitoredResource + * @property {string|null} [type] MonitoredResource type + * @property {Object.|null} [labels] MonitoredResource labels + */ + + /** + * Constructs a new MonitoredResource. + * @memberof google.api + * @classdesc Represents a MonitoredResource. + * @implements IMonitoredResource + * @constructor + * @param {google.api.IMonitoredResource=} [properties] Properties to set + */ + function MonitoredResource(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]]; + } + + /** + * MonitoredResource type. + * @member {string} type + * @memberof google.api.MonitoredResource + * @instance + */ + MonitoredResource.prototype.type = ""; + + /** + * MonitoredResource labels. + * @member {Object.} labels + * @memberof google.api.MonitoredResource + * @instance + */ + MonitoredResource.prototype.labels = $util.emptyObject; + + /** + * Creates a new MonitoredResource instance using the specified properties. + * @function create + * @memberof google.api.MonitoredResource + * @static + * @param {google.api.IMonitoredResource=} [properties] Properties to set + * @returns {google.api.MonitoredResource} MonitoredResource instance + */ + MonitoredResource.create = function create(properties) { + return new MonitoredResource(properties); + }; + + /** + * Encodes the specified MonitoredResource message. Does not implicitly {@link google.api.MonitoredResource.verify|verify} messages. + * @function encode + * @memberof google.api.MonitoredResource + * @static + * @param {google.api.IMonitoredResource} message MonitoredResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResource.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.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified MonitoredResource message, length delimited. Does not implicitly {@link google.api.MonitoredResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MonitoredResource + * @static + * @param {google.api.IMonitoredResource} message MonitoredResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MonitoredResource message from the specified reader or buffer. + * @function decode + * @memberof google.api.MonitoredResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MonitoredResource} MonitoredResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResource.decode = function 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.MonitoredResource(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MonitoredResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MonitoredResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MonitoredResource} MonitoredResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MonitoredResource message. + * @function verify + * @memberof google.api.MonitoredResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MonitoredResource.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a MonitoredResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MonitoredResource + * @static + * @param {Object.} object Plain object + * @returns {google.api.MonitoredResource} MonitoredResource + */ + MonitoredResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MonitoredResource) + return object; + var message = new $root.google.api.MonitoredResource(); + if (object.type != null) + message.type = String(object.type); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.api.MonitoredResource.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a MonitoredResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MonitoredResource + * @static + * @param {google.api.MonitoredResource} message MonitoredResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MonitoredResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) + object.type = ""; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this MonitoredResource to JSON. + * @function toJSON + * @memberof google.api.MonitoredResource + * @instance + * @returns {Object.} JSON object + */ + MonitoredResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MonitoredResource + * @function getTypeUrl + * @memberof google.api.MonitoredResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MonitoredResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MonitoredResource"; + }; + + return MonitoredResource; + })(); + + api.MonitoredResourceMetadata = (function() { + + /** + * Properties of a MonitoredResourceMetadata. + * @memberof google.api + * @interface IMonitoredResourceMetadata + * @property {google.protobuf.IStruct|null} [systemLabels] MonitoredResourceMetadata systemLabels + * @property {Object.|null} [userLabels] MonitoredResourceMetadata userLabels + */ + + /** + * Constructs a new MonitoredResourceMetadata. + * @memberof google.api + * @classdesc Represents a MonitoredResourceMetadata. + * @implements IMonitoredResourceMetadata + * @constructor + * @param {google.api.IMonitoredResourceMetadata=} [properties] Properties to set + */ + function MonitoredResourceMetadata(properties) { + this.userLabels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MonitoredResourceMetadata systemLabels. + * @member {google.protobuf.IStruct|null|undefined} systemLabels + * @memberof google.api.MonitoredResourceMetadata + * @instance + */ + MonitoredResourceMetadata.prototype.systemLabels = null; + + /** + * MonitoredResourceMetadata userLabels. + * @member {Object.} userLabels + * @memberof google.api.MonitoredResourceMetadata + * @instance + */ + MonitoredResourceMetadata.prototype.userLabels = $util.emptyObject; + + /** + * Creates a new MonitoredResourceMetadata instance using the specified properties. + * @function create + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {google.api.IMonitoredResourceMetadata=} [properties] Properties to set + * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata instance + */ + MonitoredResourceMetadata.create = function create(properties) { + return new MonitoredResourceMetadata(properties); + }; + + /** + * Encodes the specified MonitoredResourceMetadata message. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. + * @function encode + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {google.api.IMonitoredResourceMetadata} message MonitoredResourceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResourceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.systemLabels != null && Object.hasOwnProperty.call(message, "systemLabels")) + $root.google.protobuf.Struct.encode(message.systemLabels, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.userLabels != null && Object.hasOwnProperty.call(message, "userLabels")) + for (var keys = Object.keys(message.userLabels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.userLabels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified MonitoredResourceMetadata message, length delimited. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {google.api.IMonitoredResourceMetadata} message MonitoredResourceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoredResourceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MonitoredResourceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResourceMetadata.decode = function 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.MonitoredResourceMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.systemLabels = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.userLabels === $util.emptyObject) + message.userLabels = {}; + 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.userLabels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MonitoredResourceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoredResourceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MonitoredResourceMetadata message. + * @function verify + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MonitoredResourceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.systemLabels != null && message.hasOwnProperty("systemLabels")) { + var error = $root.google.protobuf.Struct.verify(message.systemLabels); + if (error) + return "systemLabels." + error; + } + if (message.userLabels != null && message.hasOwnProperty("userLabels")) { + if (!$util.isObject(message.userLabels)) + return "userLabels: object expected"; + var key = Object.keys(message.userLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.userLabels[key[i]])) + return "userLabels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a MonitoredResourceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata + */ + MonitoredResourceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MonitoredResourceMetadata) + return object; + var message = new $root.google.api.MonitoredResourceMetadata(); + if (object.systemLabels != null) { + if (typeof object.systemLabels !== "object") + throw TypeError(".google.api.MonitoredResourceMetadata.systemLabels: object expected"); + message.systemLabels = $root.google.protobuf.Struct.fromObject(object.systemLabels); + } + if (object.userLabels) { + if (typeof object.userLabels !== "object") + throw TypeError(".google.api.MonitoredResourceMetadata.userLabels: object expected"); + message.userLabels = {}; + for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) + message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a MonitoredResourceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {google.api.MonitoredResourceMetadata} message MonitoredResourceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MonitoredResourceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.userLabels = {}; + if (options.defaults) + object.systemLabels = null; + if (message.systemLabels != null && message.hasOwnProperty("systemLabels")) + object.systemLabels = $root.google.protobuf.Struct.toObject(message.systemLabels, options); + var keys2; + if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { + object.userLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; + } + return object; + }; + + /** + * Converts this MonitoredResourceMetadata to JSON. + * @function toJSON + * @memberof google.api.MonitoredResourceMetadata + * @instance + * @returns {Object.} JSON object + */ + MonitoredResourceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MonitoredResourceMetadata + * @function getTypeUrl + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MonitoredResourceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MonitoredResourceMetadata"; + }; + + return MonitoredResourceMetadata; + })(); + + api.Monitoring = (function() { + + /** + * Properties of a Monitoring. + * @memberof google.api + * @interface IMonitoring + * @property {Array.|null} [producerDestinations] Monitoring producerDestinations + * @property {Array.|null} [consumerDestinations] Monitoring consumerDestinations + */ + + /** + * Constructs a new Monitoring. + * @memberof google.api + * @classdesc Represents a Monitoring. + * @implements IMonitoring + * @constructor + * @param {google.api.IMonitoring=} [properties] Properties to set + */ + function Monitoring(properties) { + this.producerDestinations = []; + this.consumerDestinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Monitoring producerDestinations. + * @member {Array.} producerDestinations + * @memberof google.api.Monitoring + * @instance + */ + Monitoring.prototype.producerDestinations = $util.emptyArray; + + /** + * Monitoring consumerDestinations. + * @member {Array.} consumerDestinations + * @memberof google.api.Monitoring + * @instance + */ + Monitoring.prototype.consumerDestinations = $util.emptyArray; + + /** + * Creates a new Monitoring instance using the specified properties. + * @function create + * @memberof google.api.Monitoring + * @static + * @param {google.api.IMonitoring=} [properties] Properties to set + * @returns {google.api.Monitoring} Monitoring instance + */ + Monitoring.create = function create(properties) { + return new Monitoring(properties); + }; + + /** + * Encodes the specified Monitoring message. Does not implicitly {@link google.api.Monitoring.verify|verify} messages. + * @function encode + * @memberof google.api.Monitoring + * @static + * @param {google.api.IMonitoring} message Monitoring message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Monitoring.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.producerDestinations != null && message.producerDestinations.length) + for (var i = 0; i < message.producerDestinations.length; ++i) + $root.google.api.Monitoring.MonitoringDestination.encode(message.producerDestinations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consumerDestinations != null && message.consumerDestinations.length) + for (var i = 0; i < message.consumerDestinations.length; ++i) + $root.google.api.Monitoring.MonitoringDestination.encode(message.consumerDestinations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Monitoring message, length delimited. Does not implicitly {@link google.api.Monitoring.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Monitoring + * @static + * @param {google.api.IMonitoring} message Monitoring message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Monitoring.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Monitoring message from the specified reader or buffer. + * @function decode + * @memberof google.api.Monitoring + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Monitoring} Monitoring + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Monitoring.decode = function 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.Monitoring(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.producerDestinations && message.producerDestinations.length)) + message.producerDestinations = []; + message.producerDestinations.push($root.google.api.Monitoring.MonitoringDestination.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.consumerDestinations && message.consumerDestinations.length)) + message.consumerDestinations = []; + message.consumerDestinations.push($root.google.api.Monitoring.MonitoringDestination.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Monitoring message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Monitoring + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Monitoring} Monitoring + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Monitoring.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Monitoring message. + * @function verify + * @memberof google.api.Monitoring + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Monitoring.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.producerDestinations != null && message.hasOwnProperty("producerDestinations")) { + if (!Array.isArray(message.producerDestinations)) + return "producerDestinations: array expected"; + for (var i = 0; i < message.producerDestinations.length; ++i) { + var error = $root.google.api.Monitoring.MonitoringDestination.verify(message.producerDestinations[i]); + if (error) + return "producerDestinations." + error; + } + } + if (message.consumerDestinations != null && message.hasOwnProperty("consumerDestinations")) { + if (!Array.isArray(message.consumerDestinations)) + return "consumerDestinations: array expected"; + for (var i = 0; i < message.consumerDestinations.length; ++i) { + var error = $root.google.api.Monitoring.MonitoringDestination.verify(message.consumerDestinations[i]); + if (error) + return "consumerDestinations." + error; + } + } + return null; + }; + + /** + * Creates a Monitoring message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Monitoring + * @static + * @param {Object.} object Plain object + * @returns {google.api.Monitoring} Monitoring + */ + Monitoring.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Monitoring) + return object; + var message = new $root.google.api.Monitoring(); + if (object.producerDestinations) { + if (!Array.isArray(object.producerDestinations)) + throw TypeError(".google.api.Monitoring.producerDestinations: array expected"); + message.producerDestinations = []; + for (var i = 0; i < object.producerDestinations.length; ++i) { + if (typeof object.producerDestinations[i] !== "object") + throw TypeError(".google.api.Monitoring.producerDestinations: object expected"); + message.producerDestinations[i] = $root.google.api.Monitoring.MonitoringDestination.fromObject(object.producerDestinations[i]); + } + } + if (object.consumerDestinations) { + if (!Array.isArray(object.consumerDestinations)) + throw TypeError(".google.api.Monitoring.consumerDestinations: array expected"); + message.consumerDestinations = []; + for (var i = 0; i < object.consumerDestinations.length; ++i) { + if (typeof object.consumerDestinations[i] !== "object") + throw TypeError(".google.api.Monitoring.consumerDestinations: object expected"); + message.consumerDestinations[i] = $root.google.api.Monitoring.MonitoringDestination.fromObject(object.consumerDestinations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Monitoring message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Monitoring + * @static + * @param {google.api.Monitoring} message Monitoring + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Monitoring.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.producerDestinations = []; + object.consumerDestinations = []; + } + if (message.producerDestinations && message.producerDestinations.length) { + object.producerDestinations = []; + for (var j = 0; j < message.producerDestinations.length; ++j) + object.producerDestinations[j] = $root.google.api.Monitoring.MonitoringDestination.toObject(message.producerDestinations[j], options); + } + if (message.consumerDestinations && message.consumerDestinations.length) { + object.consumerDestinations = []; + for (var j = 0; j < message.consumerDestinations.length; ++j) + object.consumerDestinations[j] = $root.google.api.Monitoring.MonitoringDestination.toObject(message.consumerDestinations[j], options); + } + return object; + }; + + /** + * Converts this Monitoring to JSON. + * @function toJSON + * @memberof google.api.Monitoring + * @instance + * @returns {Object.} JSON object + */ + Monitoring.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Monitoring + * @function getTypeUrl + * @memberof google.api.Monitoring + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Monitoring.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Monitoring"; + }; + + Monitoring.MonitoringDestination = (function() { + + /** + * Properties of a MonitoringDestination. + * @memberof google.api.Monitoring + * @interface IMonitoringDestination + * @property {string|null} [monitoredResource] MonitoringDestination monitoredResource + * @property {Array.|null} [metrics] MonitoringDestination metrics + */ + + /** + * Constructs a new MonitoringDestination. + * @memberof google.api.Monitoring + * @classdesc Represents a MonitoringDestination. + * @implements IMonitoringDestination + * @constructor + * @param {google.api.Monitoring.IMonitoringDestination=} [properties] Properties to set + */ + function MonitoringDestination(properties) { + this.metrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MonitoringDestination monitoredResource. + * @member {string} monitoredResource + * @memberof google.api.Monitoring.MonitoringDestination + * @instance + */ + MonitoringDestination.prototype.monitoredResource = ""; + + /** + * MonitoringDestination metrics. + * @member {Array.} metrics + * @memberof google.api.Monitoring.MonitoringDestination + * @instance + */ + MonitoringDestination.prototype.metrics = $util.emptyArray; + + /** + * Creates a new MonitoringDestination instance using the specified properties. + * @function create + * @memberof google.api.Monitoring.MonitoringDestination + * @static + * @param {google.api.Monitoring.IMonitoringDestination=} [properties] Properties to set + * @returns {google.api.Monitoring.MonitoringDestination} MonitoringDestination instance + */ + MonitoringDestination.create = function create(properties) { + return new MonitoringDestination(properties); + }; + + /** + * Encodes the specified MonitoringDestination message. Does not implicitly {@link google.api.Monitoring.MonitoringDestination.verify|verify} messages. + * @function encode + * @memberof google.api.Monitoring.MonitoringDestination + * @static + * @param {google.api.Monitoring.IMonitoringDestination} message MonitoringDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoringDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.monitoredResource != null && Object.hasOwnProperty.call(message, "monitoredResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.monitoredResource); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metrics[i]); + return writer; + }; + + /** + * Encodes the specified MonitoringDestination message, length delimited. Does not implicitly {@link google.api.Monitoring.MonitoringDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Monitoring.MonitoringDestination + * @static + * @param {google.api.Monitoring.IMonitoringDestination} message MonitoringDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoringDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MonitoringDestination message from the specified reader or buffer. + * @function decode + * @memberof google.api.Monitoring.MonitoringDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Monitoring.MonitoringDestination} MonitoringDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoringDestination.decode = function 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.Monitoring.MonitoringDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.monitoredResource = reader.string(); + break; + } + case 2: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MonitoringDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Monitoring.MonitoringDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Monitoring.MonitoringDestination} MonitoringDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoringDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MonitoringDestination message. + * @function verify + * @memberof google.api.Monitoring.MonitoringDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MonitoringDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.monitoredResource != null && message.hasOwnProperty("monitoredResource")) + if (!$util.isString(message.monitoredResource)) + return "monitoredResource: string expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) + if (!$util.isString(message.metrics[i])) + return "metrics: string[] expected"; + } + return null; + }; + + /** + * Creates a MonitoringDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Monitoring.MonitoringDestination + * @static + * @param {Object.} object Plain object + * @returns {google.api.Monitoring.MonitoringDestination} MonitoringDestination + */ + MonitoringDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Monitoring.MonitoringDestination) + return object; + var message = new $root.google.api.Monitoring.MonitoringDestination(); + if (object.monitoredResource != null) + message.monitoredResource = String(object.monitoredResource); + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.api.Monitoring.MonitoringDestination.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) + message.metrics[i] = String(object.metrics[i]); + } + return message; + }; + + /** + * Creates a plain object from a MonitoringDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Monitoring.MonitoringDestination + * @static + * @param {google.api.Monitoring.MonitoringDestination} message MonitoringDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MonitoringDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metrics = []; + if (options.defaults) + object.monitoredResource = ""; + if (message.monitoredResource != null && message.hasOwnProperty("monitoredResource")) + object.monitoredResource = message.monitoredResource; + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = message.metrics[j]; + } + return object; + }; + + /** + * Converts this MonitoringDestination to JSON. + * @function toJSON + * @memberof google.api.Monitoring.MonitoringDestination + * @instance + * @returns {Object.} JSON object + */ + MonitoringDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MonitoringDestination + * @function getTypeUrl + * @memberof google.api.Monitoring.MonitoringDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MonitoringDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Monitoring.MonitoringDestination"; + }; + + return MonitoringDestination; + })(); + + return Monitoring; + })(); + + api.Quota = (function() { + + /** + * Properties of a Quota. + * @memberof google.api + * @interface IQuota + * @property {Array.|null} [limits] Quota limits + * @property {Array.|null} [metricRules] Quota metricRules + */ + + /** + * Constructs a new Quota. + * @memberof google.api + * @classdesc Represents a Quota. + * @implements IQuota + * @constructor + * @param {google.api.IQuota=} [properties] Properties to set + */ + function Quota(properties) { + this.limits = []; + this.metricRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Quota limits. + * @member {Array.} limits + * @memberof google.api.Quota + * @instance + */ + Quota.prototype.limits = $util.emptyArray; + + /** + * Quota metricRules. + * @member {Array.} metricRules + * @memberof google.api.Quota + * @instance + */ + Quota.prototype.metricRules = $util.emptyArray; + + /** + * Creates a new Quota instance using the specified properties. + * @function create + * @memberof google.api.Quota + * @static + * @param {google.api.IQuota=} [properties] Properties to set + * @returns {google.api.Quota} Quota instance + */ + Quota.create = function create(properties) { + return new Quota(properties); + }; + + /** + * Encodes the specified Quota message. Does not implicitly {@link google.api.Quota.verify|verify} messages. + * @function encode + * @memberof google.api.Quota + * @static + * @param {google.api.IQuota} message Quota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Quota.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.limits != null && message.limits.length) + for (var i = 0; i < message.limits.length; ++i) + $root.google.api.QuotaLimit.encode(message.limits[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.metricRules != null && message.metricRules.length) + for (var i = 0; i < message.metricRules.length; ++i) + $root.google.api.MetricRule.encode(message.metricRules[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Quota message, length delimited. Does not implicitly {@link google.api.Quota.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Quota + * @static + * @param {google.api.IQuota} message Quota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Quota.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Quota message from the specified reader or buffer. + * @function decode + * @memberof google.api.Quota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Quota} Quota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Quota.decode = function 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.Quota(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (!(message.limits && message.limits.length)) + message.limits = []; + message.limits.push($root.google.api.QuotaLimit.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.metricRules && message.metricRules.length)) + message.metricRules = []; + message.metricRules.push($root.google.api.MetricRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Quota message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Quota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Quota} Quota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Quota.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Quota message. + * @function verify + * @memberof google.api.Quota + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Quota.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.limits != null && message.hasOwnProperty("limits")) { + if (!Array.isArray(message.limits)) + return "limits: array expected"; + for (var i = 0; i < message.limits.length; ++i) { + var error = $root.google.api.QuotaLimit.verify(message.limits[i]); + if (error) + return "limits." + error; + } + } + if (message.metricRules != null && message.hasOwnProperty("metricRules")) { + if (!Array.isArray(message.metricRules)) + return "metricRules: array expected"; + for (var i = 0; i < message.metricRules.length; ++i) { + var error = $root.google.api.MetricRule.verify(message.metricRules[i]); + if (error) + return "metricRules." + error; + } + } + return null; + }; + + /** + * Creates a Quota message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Quota + * @static + * @param {Object.} object Plain object + * @returns {google.api.Quota} Quota + */ + Quota.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Quota) + return object; + var message = new $root.google.api.Quota(); + if (object.limits) { + if (!Array.isArray(object.limits)) + throw TypeError(".google.api.Quota.limits: array expected"); + message.limits = []; + for (var i = 0; i < object.limits.length; ++i) { + if (typeof object.limits[i] !== "object") + throw TypeError(".google.api.Quota.limits: object expected"); + message.limits[i] = $root.google.api.QuotaLimit.fromObject(object.limits[i]); + } + } + if (object.metricRules) { + if (!Array.isArray(object.metricRules)) + throw TypeError(".google.api.Quota.metricRules: array expected"); + message.metricRules = []; + for (var i = 0; i < object.metricRules.length; ++i) { + if (typeof object.metricRules[i] !== "object") + throw TypeError(".google.api.Quota.metricRules: object expected"); + message.metricRules[i] = $root.google.api.MetricRule.fromObject(object.metricRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Quota message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Quota + * @static + * @param {google.api.Quota} message Quota + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Quota.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.limits = []; + object.metricRules = []; + } + if (message.limits && message.limits.length) { + object.limits = []; + for (var j = 0; j < message.limits.length; ++j) + object.limits[j] = $root.google.api.QuotaLimit.toObject(message.limits[j], options); + } + if (message.metricRules && message.metricRules.length) { + object.metricRules = []; + for (var j = 0; j < message.metricRules.length; ++j) + object.metricRules[j] = $root.google.api.MetricRule.toObject(message.metricRules[j], options); + } + return object; + }; + + /** + * Converts this Quota to JSON. + * @function toJSON + * @memberof google.api.Quota + * @instance + * @returns {Object.} JSON object + */ + Quota.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Quota + * @function getTypeUrl + * @memberof google.api.Quota + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Quota.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Quota"; + }; + + return Quota; + })(); + + api.MetricRule = (function() { + + /** + * Properties of a MetricRule. + * @memberof google.api + * @interface IMetricRule + * @property {string|null} [selector] MetricRule selector + * @property {Object.|null} [metricCosts] MetricRule metricCosts + */ + + /** + * Constructs a new MetricRule. + * @memberof google.api + * @classdesc Represents a MetricRule. + * @implements IMetricRule + * @constructor + * @param {google.api.IMetricRule=} [properties] Properties to set + */ + function MetricRule(properties) { + this.metricCosts = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricRule selector. + * @member {string} selector + * @memberof google.api.MetricRule + * @instance + */ + MetricRule.prototype.selector = ""; + + /** + * MetricRule metricCosts. + * @member {Object.} metricCosts + * @memberof google.api.MetricRule + * @instance + */ + MetricRule.prototype.metricCosts = $util.emptyObject; + + /** + * Creates a new MetricRule instance using the specified properties. + * @function create + * @memberof google.api.MetricRule + * @static + * @param {google.api.IMetricRule=} [properties] Properties to set + * @returns {google.api.MetricRule} MetricRule instance + */ + MetricRule.create = function create(properties) { + return new MetricRule(properties); + }; + + /** + * Encodes the specified MetricRule message. Does not implicitly {@link google.api.MetricRule.verify|verify} messages. + * @function encode + * @memberof google.api.MetricRule + * @static + * @param {google.api.IMetricRule} message MetricRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricRule.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.metricCosts != null && Object.hasOwnProperty.call(message, "metricCosts")) + for (var keys = Object.keys(message.metricCosts), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.metricCosts[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetricRule message, length delimited. Does not implicitly {@link google.api.MetricRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MetricRule + * @static + * @param {google.api.IMetricRule} message MetricRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.MetricRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MetricRule} MetricRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricRule.decode = function 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.MetricRule(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + if (message.metricCosts === $util.emptyObject) + message.metricCosts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metricCosts[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MetricRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MetricRule} MetricRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricRule message. + * @function verify + * @memberof google.api.MetricRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.metricCosts != null && message.hasOwnProperty("metricCosts")) { + if (!$util.isObject(message.metricCosts)) + return "metricCosts: object expected"; + var key = Object.keys(message.metricCosts); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.metricCosts[key[i]]) && !(message.metricCosts[key[i]] && $util.isInteger(message.metricCosts[key[i]].low) && $util.isInteger(message.metricCosts[key[i]].high))) + return "metricCosts: integer|Long{k:string} expected"; + } + return null; + }; + + /** + * Creates a MetricRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MetricRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.MetricRule} MetricRule + */ + MetricRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MetricRule) + return object; + var message = new $root.google.api.MetricRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.metricCosts) { + if (typeof object.metricCosts !== "object") + throw TypeError(".google.api.MetricRule.metricCosts: object expected"); + message.metricCosts = {}; + for (var keys = Object.keys(object.metricCosts), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.metricCosts[keys[i]] = $util.Long.fromValue(object.metricCosts[keys[i]])).unsigned = false; + else if (typeof object.metricCosts[keys[i]] === "string") + message.metricCosts[keys[i]] = parseInt(object.metricCosts[keys[i]], 10); + else if (typeof object.metricCosts[keys[i]] === "number") + message.metricCosts[keys[i]] = object.metricCosts[keys[i]]; + else if (typeof object.metricCosts[keys[i]] === "object") + message.metricCosts[keys[i]] = new $util.LongBits(object.metricCosts[keys[i]].low >>> 0, object.metricCosts[keys[i]].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a MetricRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MetricRule + * @static + * @param {google.api.MetricRule} message MetricRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metricCosts = {}; + if (options.defaults) + object.selector = ""; + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + var keys2; + if (message.metricCosts && (keys2 = Object.keys(message.metricCosts)).length) { + object.metricCosts = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.metricCosts[keys2[j]] === "number") + object.metricCosts[keys2[j]] = options.longs === String ? String(message.metricCosts[keys2[j]]) : message.metricCosts[keys2[j]]; + else + object.metricCosts[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.metricCosts[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.metricCosts[keys2[j]].low >>> 0, message.metricCosts[keys2[j]].high >>> 0).toNumber() : message.metricCosts[keys2[j]]; + } + return object; + }; + + /** + * Converts this MetricRule to JSON. + * @function toJSON + * @memberof google.api.MetricRule + * @instance + * @returns {Object.} JSON object + */ + MetricRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricRule + * @function getTypeUrl + * @memberof google.api.MetricRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MetricRule"; + }; + + return MetricRule; + })(); + + api.QuotaLimit = (function() { + + /** + * Properties of a QuotaLimit. + * @memberof google.api + * @interface IQuotaLimit + * @property {string|null} [name] QuotaLimit name + * @property {string|null} [description] QuotaLimit description + * @property {number|Long|null} [defaultLimit] QuotaLimit defaultLimit + * @property {number|Long|null} [maxLimit] QuotaLimit maxLimit + * @property {number|Long|null} [freeTier] QuotaLimit freeTier + * @property {string|null} [duration] QuotaLimit duration + * @property {string|null} [metric] QuotaLimit metric + * @property {string|null} [unit] QuotaLimit unit + * @property {Object.|null} [values] QuotaLimit values + * @property {string|null} [displayName] QuotaLimit displayName + */ + + /** + * Constructs a new QuotaLimit. + * @memberof google.api + * @classdesc Represents a QuotaLimit. + * @implements IQuotaLimit + * @constructor + * @param {google.api.IQuotaLimit=} [properties] Properties to set + */ + function QuotaLimit(properties) { + this.values = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuotaLimit name. + * @member {string} name + * @memberof google.api.QuotaLimit + * @instance + */ + QuotaLimit.prototype.name = ""; + + /** + * QuotaLimit description. + * @member {string} description + * @memberof google.api.QuotaLimit + * @instance + */ + QuotaLimit.prototype.description = ""; + + /** + * QuotaLimit defaultLimit. + * @member {number|Long} defaultLimit + * @memberof google.api.QuotaLimit + * @instance + */ + QuotaLimit.prototype.defaultLimit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * QuotaLimit maxLimit. + * @member {number|Long} maxLimit + * @memberof google.api.QuotaLimit + * @instance + */ + QuotaLimit.prototype.maxLimit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * QuotaLimit freeTier. + * @member {number|Long} freeTier + * @memberof google.api.QuotaLimit + * @instance + */ + QuotaLimit.prototype.freeTier = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * QuotaLimit duration. + * @member {string} duration + * @memberof google.api.QuotaLimit + * @instance + */ + QuotaLimit.prototype.duration = ""; + + /** + * QuotaLimit metric. + * @member {string} metric + * @memberof google.api.QuotaLimit + * @instance + */ + QuotaLimit.prototype.metric = ""; + + /** + * QuotaLimit unit. + * @member {string} unit + * @memberof google.api.QuotaLimit + * @instance + */ + QuotaLimit.prototype.unit = ""; + + /** + * QuotaLimit values. + * @member {Object.} values + * @memberof google.api.QuotaLimit + * @instance + */ + QuotaLimit.prototype.values = $util.emptyObject; + + /** + * QuotaLimit displayName. + * @member {string} displayName + * @memberof google.api.QuotaLimit + * @instance + */ + QuotaLimit.prototype.displayName = ""; + + /** + * Creates a new QuotaLimit instance using the specified properties. + * @function create + * @memberof google.api.QuotaLimit + * @static + * @param {google.api.IQuotaLimit=} [properties] Properties to set + * @returns {google.api.QuotaLimit} QuotaLimit instance + */ + QuotaLimit.create = function create(properties) { + return new QuotaLimit(properties); + }; + + /** + * Encodes the specified QuotaLimit message. Does not implicitly {@link google.api.QuotaLimit.verify|verify} messages. + * @function encode + * @memberof google.api.QuotaLimit + * @static + * @param {google.api.IQuotaLimit} message QuotaLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaLimit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.defaultLimit != null && Object.hasOwnProperty.call(message, "defaultLimit")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.defaultLimit); + if (message.maxLimit != null && Object.hasOwnProperty.call(message, "maxLimit")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.maxLimit); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.duration); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + if (message.freeTier != null && Object.hasOwnProperty.call(message, "freeTier")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.freeTier); + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.metric); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.unit); + if (message.values != null && Object.hasOwnProperty.call(message, "values")) + for (var keys = Object.keys(message.values), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.values[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified QuotaLimit message, length delimited. Does not implicitly {@link google.api.QuotaLimit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.QuotaLimit + * @static + * @param {google.api.IQuotaLimit} message QuotaLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaLimit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuotaLimit message from the specified reader or buffer. + * @function decode + * @memberof google.api.QuotaLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.QuotaLimit} QuotaLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaLimit.decode = function 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.QuotaLimit(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.defaultLimit = reader.int64(); + break; + } + case 4: { + message.maxLimit = reader.int64(); + break; + } + case 7: { + message.freeTier = reader.int64(); + break; + } + case 5: { + message.duration = reader.string(); + break; + } + case 8: { + message.metric = reader.string(); + break; + } + case 9: { + message.unit = reader.string(); + break; + } + case 10: { + if (message.values === $util.emptyObject) + message.values = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.values[key] = value; + break; + } + case 12: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuotaLimit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.QuotaLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.QuotaLimit} QuotaLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaLimit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuotaLimit message. + * @function verify + * @memberof google.api.QuotaLimit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuotaLimit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.defaultLimit != null && message.hasOwnProperty("defaultLimit")) + if (!$util.isInteger(message.defaultLimit) && !(message.defaultLimit && $util.isInteger(message.defaultLimit.low) && $util.isInteger(message.defaultLimit.high))) + return "defaultLimit: integer|Long expected"; + if (message.maxLimit != null && message.hasOwnProperty("maxLimit")) + if (!$util.isInteger(message.maxLimit) && !(message.maxLimit && $util.isInteger(message.maxLimit.low) && $util.isInteger(message.maxLimit.high))) + return "maxLimit: integer|Long expected"; + if (message.freeTier != null && message.hasOwnProperty("freeTier")) + if (!$util.isInteger(message.freeTier) && !(message.freeTier && $util.isInteger(message.freeTier.low) && $util.isInteger(message.freeTier.high))) + return "freeTier: integer|Long expected"; + if (message.duration != null && message.hasOwnProperty("duration")) + if (!$util.isString(message.duration)) + return "duration: string expected"; + if (message.metric != null && message.hasOwnProperty("metric")) + if (!$util.isString(message.metric)) + return "metric: string expected"; + if (message.unit != null && message.hasOwnProperty("unit")) + if (!$util.isString(message.unit)) + return "unit: string expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!$util.isObject(message.values)) + return "values: object expected"; + var key = Object.keys(message.values); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.values[key[i]]) && !(message.values[key[i]] && $util.isInteger(message.values[key[i]].low) && $util.isInteger(message.values[key[i]].high))) + return "values: integer|Long{k:string} expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a QuotaLimit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.QuotaLimit + * @static + * @param {Object.} object Plain object + * @returns {google.api.QuotaLimit} QuotaLimit + */ + QuotaLimit.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.QuotaLimit) + return object; + var message = new $root.google.api.QuotaLimit(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.defaultLimit != null) + if ($util.Long) + (message.defaultLimit = $util.Long.fromValue(object.defaultLimit)).unsigned = false; + else if (typeof object.defaultLimit === "string") + message.defaultLimit = parseInt(object.defaultLimit, 10); + else if (typeof object.defaultLimit === "number") + message.defaultLimit = object.defaultLimit; + else if (typeof object.defaultLimit === "object") + message.defaultLimit = new $util.LongBits(object.defaultLimit.low >>> 0, object.defaultLimit.high >>> 0).toNumber(); + if (object.maxLimit != null) + if ($util.Long) + (message.maxLimit = $util.Long.fromValue(object.maxLimit)).unsigned = false; + else if (typeof object.maxLimit === "string") + message.maxLimit = parseInt(object.maxLimit, 10); + else if (typeof object.maxLimit === "number") + message.maxLimit = object.maxLimit; + else if (typeof object.maxLimit === "object") + message.maxLimit = new $util.LongBits(object.maxLimit.low >>> 0, object.maxLimit.high >>> 0).toNumber(); + if (object.freeTier != null) + if ($util.Long) + (message.freeTier = $util.Long.fromValue(object.freeTier)).unsigned = false; + else if (typeof object.freeTier === "string") + message.freeTier = parseInt(object.freeTier, 10); + else if (typeof object.freeTier === "number") + message.freeTier = object.freeTier; + else if (typeof object.freeTier === "object") + message.freeTier = new $util.LongBits(object.freeTier.low >>> 0, object.freeTier.high >>> 0).toNumber(); + if (object.duration != null) + message.duration = String(object.duration); + if (object.metric != null) + message.metric = String(object.metric); + if (object.unit != null) + message.unit = String(object.unit); + if (object.values) { + if (typeof object.values !== "object") + throw TypeError(".google.api.QuotaLimit.values: object expected"); + message.values = {}; + for (var keys = Object.keys(object.values), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.values[keys[i]] = $util.Long.fromValue(object.values[keys[i]])).unsigned = false; + else if (typeof object.values[keys[i]] === "string") + message.values[keys[i]] = parseInt(object.values[keys[i]], 10); + else if (typeof object.values[keys[i]] === "number") + message.values[keys[i]] = object.values[keys[i]]; + else if (typeof object.values[keys[i]] === "object") + message.values[keys[i]] = new $util.LongBits(object.values[keys[i]].low >>> 0, object.values[keys[i]].high >>> 0).toNumber(); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a QuotaLimit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.QuotaLimit + * @static + * @param {google.api.QuotaLimit} message QuotaLimit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuotaLimit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.values = {}; + if (options.defaults) { + object.description = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.defaultLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.defaultLimit = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxLimit = options.longs === String ? "0" : 0; + object.duration = ""; + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.freeTier = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.freeTier = options.longs === String ? "0" : 0; + object.metric = ""; + object.unit = ""; + object.displayName = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.defaultLimit != null && message.hasOwnProperty("defaultLimit")) + if (typeof message.defaultLimit === "number") + object.defaultLimit = options.longs === String ? String(message.defaultLimit) : message.defaultLimit; + else + object.defaultLimit = options.longs === String ? $util.Long.prototype.toString.call(message.defaultLimit) : options.longs === Number ? new $util.LongBits(message.defaultLimit.low >>> 0, message.defaultLimit.high >>> 0).toNumber() : message.defaultLimit; + if (message.maxLimit != null && message.hasOwnProperty("maxLimit")) + if (typeof message.maxLimit === "number") + object.maxLimit = options.longs === String ? String(message.maxLimit) : message.maxLimit; + else + object.maxLimit = options.longs === String ? $util.Long.prototype.toString.call(message.maxLimit) : options.longs === Number ? new $util.LongBits(message.maxLimit.low >>> 0, message.maxLimit.high >>> 0).toNumber() : message.maxLimit; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = message.duration; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.freeTier != null && message.hasOwnProperty("freeTier")) + if (typeof message.freeTier === "number") + object.freeTier = options.longs === String ? String(message.freeTier) : message.freeTier; + else + object.freeTier = options.longs === String ? $util.Long.prototype.toString.call(message.freeTier) : options.longs === Number ? new $util.LongBits(message.freeTier.low >>> 0, message.freeTier.high >>> 0).toNumber() : message.freeTier; + if (message.metric != null && message.hasOwnProperty("metric")) + object.metric = message.metric; + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = message.unit; + var keys2; + if (message.values && (keys2 = Object.keys(message.values)).length) { + object.values = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.values[keys2[j]] === "number") + object.values[keys2[j]] = options.longs === String ? String(message.values[keys2[j]]) : message.values[keys2[j]]; + else + object.values[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.values[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.values[keys2[j]].low >>> 0, message.values[keys2[j]].high >>> 0).toNumber() : message.values[keys2[j]]; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this QuotaLimit to JSON. + * @function toJSON + * @memberof google.api.QuotaLimit + * @instance + * @returns {Object.} JSON object + */ + QuotaLimit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuotaLimit + * @function getTypeUrl + * @memberof google.api.QuotaLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuotaLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.QuotaLimit"; + }; + + return QuotaLimit; + })(); + + api.SourceInfo = (function() { + + /** + * Properties of a SourceInfo. + * @memberof google.api + * @interface ISourceInfo + * @property {Array.|null} [sourceFiles] SourceInfo sourceFiles + */ + + /** + * Constructs a new SourceInfo. + * @memberof google.api + * @classdesc Represents a SourceInfo. + * @implements ISourceInfo + * @constructor + * @param {google.api.ISourceInfo=} [properties] Properties to set + */ + function SourceInfo(properties) { + this.sourceFiles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceInfo sourceFiles. + * @member {Array.} sourceFiles + * @memberof google.api.SourceInfo + * @instance + */ + SourceInfo.prototype.sourceFiles = $util.emptyArray; + + /** + * Creates a new SourceInfo instance using the specified properties. + * @function create + * @memberof google.api.SourceInfo + * @static + * @param {google.api.ISourceInfo=} [properties] Properties to set + * @returns {google.api.SourceInfo} SourceInfo instance + */ + SourceInfo.create = function create(properties) { + return new SourceInfo(properties); + }; + + /** + * Encodes the specified SourceInfo message. Does not implicitly {@link google.api.SourceInfo.verify|verify} messages. + * @function encode + * @memberof google.api.SourceInfo + * @static + * @param {google.api.ISourceInfo} message SourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceFiles != null && message.sourceFiles.length) + for (var i = 0; i < message.sourceFiles.length; ++i) + $root.google.protobuf.Any.encode(message.sourceFiles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceInfo message, length delimited. Does not implicitly {@link google.api.SourceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SourceInfo + * @static + * @param {google.api.ISourceInfo} message SourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.SourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SourceInfo} SourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceInfo.decode = function 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.SourceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sourceFiles && message.sourceFiles.length)) + message.sourceFiles = []; + message.sourceFiles.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SourceInfo} SourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceInfo message. + * @function verify + * @memberof google.api.SourceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceFiles != null && message.hasOwnProperty("sourceFiles")) { + if (!Array.isArray(message.sourceFiles)) + return "sourceFiles: array expected"; + for (var i = 0; i < message.sourceFiles.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.sourceFiles[i]); + if (error) + return "sourceFiles." + error; + } + } + return null; + }; + + /** + * Creates a SourceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SourceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.SourceInfo} SourceInfo + */ + SourceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SourceInfo) + return object; + var message = new $root.google.api.SourceInfo(); + if (object.sourceFiles) { + if (!Array.isArray(object.sourceFiles)) + throw TypeError(".google.api.SourceInfo.sourceFiles: array expected"); + message.sourceFiles = []; + for (var i = 0; i < object.sourceFiles.length; ++i) { + if (typeof object.sourceFiles[i] !== "object") + throw TypeError(".google.api.SourceInfo.sourceFiles: object expected"); + message.sourceFiles[i] = $root.google.protobuf.Any.fromObject(object.sourceFiles[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SourceInfo + * @static + * @param {google.api.SourceInfo} message SourceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sourceFiles = []; + if (message.sourceFiles && message.sourceFiles.length) { + object.sourceFiles = []; + for (var j = 0; j < message.sourceFiles.length; ++j) + object.sourceFiles[j] = $root.google.protobuf.Any.toObject(message.sourceFiles[j], options); + } + return object; + }; + + /** + * Converts this SourceInfo to JSON. + * @function toJSON + * @memberof google.api.SourceInfo + * @instance + * @returns {Object.} JSON object + */ + SourceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceInfo + * @function getTypeUrl + * @memberof google.api.SourceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SourceInfo"; + }; + + return SourceInfo; + })(); + + api.SystemParameters = (function() { + + /** + * Properties of a SystemParameters. + * @memberof google.api + * @interface ISystemParameters + * @property {Array.|null} [rules] SystemParameters rules + */ + + /** + * Constructs a new SystemParameters. + * @memberof google.api + * @classdesc Represents a SystemParameters. + * @implements ISystemParameters + * @constructor + * @param {google.api.ISystemParameters=} [properties] Properties to set + */ + function SystemParameters(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]]; + } + + /** + * SystemParameters rules. + * @member {Array.} rules + * @memberof google.api.SystemParameters + * @instance + */ + SystemParameters.prototype.rules = $util.emptyArray; + + /** + * Creates a new SystemParameters instance using the specified properties. + * @function create + * @memberof google.api.SystemParameters + * @static + * @param {google.api.ISystemParameters=} [properties] Properties to set + * @returns {google.api.SystemParameters} SystemParameters instance + */ + SystemParameters.create = function create(properties) { + return new SystemParameters(properties); + }; + + /** + * Encodes the specified SystemParameters message. Does not implicitly {@link google.api.SystemParameters.verify|verify} messages. + * @function encode + * @memberof google.api.SystemParameters + * @static + * @param {google.api.ISystemParameters} message SystemParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemParameters.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.SystemParameterRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SystemParameters message, length delimited. Does not implicitly {@link google.api.SystemParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SystemParameters + * @static + * @param {google.api.ISystemParameters} message SystemParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SystemParameters message from the specified reader or buffer. + * @function decode + * @memberof google.api.SystemParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SystemParameters} SystemParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemParameters.decode = function 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.SystemParameters(); + 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.SystemParameterRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SystemParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SystemParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SystemParameters} SystemParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SystemParameters message. + * @function verify + * @memberof google.api.SystemParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SystemParameters.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.SystemParameterRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates a SystemParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SystemParameters + * @static + * @param {Object.} object Plain object + * @returns {google.api.SystemParameters} SystemParameters + */ + SystemParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SystemParameters) + return object; + var message = new $root.google.api.SystemParameters(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.SystemParameters.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.SystemParameters.rules: object expected"); + message.rules[i] = $root.google.api.SystemParameterRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SystemParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SystemParameters + * @static + * @param {google.api.SystemParameters} message SystemParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SystemParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.SystemParameterRule.toObject(message.rules[j], options); + } + return object; + }; + + /** + * Converts this SystemParameters to JSON. + * @function toJSON + * @memberof google.api.SystemParameters + * @instance + * @returns {Object.} JSON object + */ + SystemParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SystemParameters + * @function getTypeUrl + * @memberof google.api.SystemParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SystemParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SystemParameters"; + }; + + return SystemParameters; + })(); + + api.SystemParameterRule = (function() { + + /** + * Properties of a SystemParameterRule. + * @memberof google.api + * @interface ISystemParameterRule + * @property {string|null} [selector] SystemParameterRule selector + * @property {Array.|null} [parameters] SystemParameterRule parameters + */ + + /** + * Constructs a new SystemParameterRule. + * @memberof google.api + * @classdesc Represents a SystemParameterRule. + * @implements ISystemParameterRule + * @constructor + * @param {google.api.ISystemParameterRule=} [properties] Properties to set + */ + function SystemParameterRule(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SystemParameterRule selector. + * @member {string} selector + * @memberof google.api.SystemParameterRule + * @instance + */ + SystemParameterRule.prototype.selector = ""; + + /** + * SystemParameterRule parameters. + * @member {Array.} parameters + * @memberof google.api.SystemParameterRule + * @instance + */ + SystemParameterRule.prototype.parameters = $util.emptyArray; + + /** + * Creates a new SystemParameterRule instance using the specified properties. + * @function create + * @memberof google.api.SystemParameterRule + * @static + * @param {google.api.ISystemParameterRule=} [properties] Properties to set + * @returns {google.api.SystemParameterRule} SystemParameterRule instance + */ + SystemParameterRule.create = function create(properties) { + return new SystemParameterRule(properties); + }; + + /** + * Encodes the specified SystemParameterRule message. Does not implicitly {@link google.api.SystemParameterRule.verify|verify} messages. + * @function encode + * @memberof google.api.SystemParameterRule + * @static + * @param {google.api.ISystemParameterRule} message SystemParameterRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemParameterRule.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.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.api.SystemParameter.encode(message.parameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SystemParameterRule message, length delimited. Does not implicitly {@link google.api.SystemParameterRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SystemParameterRule + * @static + * @param {google.api.ISystemParameterRule} message SystemParameterRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemParameterRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SystemParameterRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.SystemParameterRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SystemParameterRule} SystemParameterRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemParameterRule.decode = function 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.SystemParameterRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.api.SystemParameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SystemParameterRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SystemParameterRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SystemParameterRule} SystemParameterRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemParameterRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SystemParameterRule message. + * @function verify + * @memberof google.api.SystemParameterRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SystemParameterRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.api.SystemParameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a SystemParameterRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SystemParameterRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.SystemParameterRule} SystemParameterRule + */ + SystemParameterRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SystemParameterRule) + return object; + var message = new $root.google.api.SystemParameterRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.api.SystemParameterRule.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.api.SystemParameterRule.parameters: object expected"); + message.parameters[i] = $root.google.api.SystemParameter.fromObject(object.parameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SystemParameterRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SystemParameterRule + * @static + * @param {google.api.SystemParameterRule} message SystemParameterRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SystemParameterRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (options.defaults) + object.selector = ""; + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.api.SystemParameter.toObject(message.parameters[j], options); + } + return object; + }; + + /** + * Converts this SystemParameterRule to JSON. + * @function toJSON + * @memberof google.api.SystemParameterRule + * @instance + * @returns {Object.} JSON object + */ + SystemParameterRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SystemParameterRule + * @function getTypeUrl + * @memberof google.api.SystemParameterRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SystemParameterRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SystemParameterRule"; + }; + + return SystemParameterRule; + })(); + + api.SystemParameter = (function() { + + /** + * Properties of a SystemParameter. + * @memberof google.api + * @interface ISystemParameter + * @property {string|null} [name] SystemParameter name + * @property {string|null} [httpHeader] SystemParameter httpHeader + * @property {string|null} [urlQueryParameter] SystemParameter urlQueryParameter + */ + + /** + * Constructs a new SystemParameter. + * @memberof google.api + * @classdesc Represents a SystemParameter. + * @implements ISystemParameter + * @constructor + * @param {google.api.ISystemParameter=} [properties] Properties to set + */ + function SystemParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SystemParameter name. + * @member {string} name + * @memberof google.api.SystemParameter + * @instance + */ + SystemParameter.prototype.name = ""; + + /** + * SystemParameter httpHeader. + * @member {string} httpHeader + * @memberof google.api.SystemParameter + * @instance + */ + SystemParameter.prototype.httpHeader = ""; + + /** + * SystemParameter urlQueryParameter. + * @member {string} urlQueryParameter + * @memberof google.api.SystemParameter + * @instance + */ + SystemParameter.prototype.urlQueryParameter = ""; + + /** + * Creates a new SystemParameter instance using the specified properties. + * @function create + * @memberof google.api.SystemParameter + * @static + * @param {google.api.ISystemParameter=} [properties] Properties to set + * @returns {google.api.SystemParameter} SystemParameter instance + */ + SystemParameter.create = function create(properties) { + return new SystemParameter(properties); + }; + + /** + * Encodes the specified SystemParameter message. Does not implicitly {@link google.api.SystemParameter.verify|verify} messages. + * @function encode + * @memberof google.api.SystemParameter + * @static + * @param {google.api.ISystemParameter} message SystemParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemParameter.encode = function encode(message, writer) { + 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.httpHeader != null && Object.hasOwnProperty.call(message, "httpHeader")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.httpHeader); + if (message.urlQueryParameter != null && Object.hasOwnProperty.call(message, "urlQueryParameter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.urlQueryParameter); + return writer; + }; + + /** + * Encodes the specified SystemParameter message, length delimited. Does not implicitly {@link google.api.SystemParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SystemParameter + * @static + * @param {google.api.ISystemParameter} message SystemParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SystemParameter message from the specified reader or buffer. + * @function decode + * @memberof google.api.SystemParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SystemParameter} SystemParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemParameter.decode = function 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.SystemParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.httpHeader = reader.string(); + break; + } + case 3: { + message.urlQueryParameter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SystemParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SystemParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SystemParameter} SystemParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SystemParameter message. + * @function verify + * @memberof google.api.SystemParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SystemParameter.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.httpHeader != null && message.hasOwnProperty("httpHeader")) + if (!$util.isString(message.httpHeader)) + return "httpHeader: string expected"; + if (message.urlQueryParameter != null && message.hasOwnProperty("urlQueryParameter")) + if (!$util.isString(message.urlQueryParameter)) + return "urlQueryParameter: string expected"; + return null; + }; + + /** + * Creates a SystemParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SystemParameter + * @static + * @param {Object.} object Plain object + * @returns {google.api.SystemParameter} SystemParameter + */ + SystemParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SystemParameter) + return object; + var message = new $root.google.api.SystemParameter(); + if (object.name != null) + message.name = String(object.name); + if (object.httpHeader != null) + message.httpHeader = String(object.httpHeader); + if (object.urlQueryParameter != null) + message.urlQueryParameter = String(object.urlQueryParameter); + return message; + }; + + /** + * Creates a plain object from a SystemParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SystemParameter + * @static + * @param {google.api.SystemParameter} message SystemParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SystemParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.httpHeader = ""; + object.urlQueryParameter = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.httpHeader != null && message.hasOwnProperty("httpHeader")) + object.httpHeader = message.httpHeader; + if (message.urlQueryParameter != null && message.hasOwnProperty("urlQueryParameter")) + object.urlQueryParameter = message.urlQueryParameter; + return object; + }; + + /** + * Converts this SystemParameter to JSON. + * @function toJSON + * @memberof google.api.SystemParameter + * @instance + * @returns {Object.} JSON object + */ + SystemParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SystemParameter + * @function getTypeUrl + * @memberof google.api.SystemParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SystemParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SystemParameter"; + }; + + return SystemParameter; + })(); + + api.Usage = (function() { + + /** + * Properties of a Usage. + * @memberof google.api + * @interface IUsage + * @property {Array.|null} [requirements] Usage requirements + * @property {Array.|null} [rules] Usage rules + * @property {string|null} [producerNotificationChannel] Usage producerNotificationChannel + */ + + /** + * Constructs a new Usage. + * @memberof google.api + * @classdesc Represents a Usage. + * @implements IUsage + * @constructor + * @param {google.api.IUsage=} [properties] Properties to set + */ + function Usage(properties) { + this.requirements = []; + 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]]; + } + + /** + * Usage requirements. + * @member {Array.} requirements + * @memberof google.api.Usage + * @instance + */ + Usage.prototype.requirements = $util.emptyArray; + + /** + * Usage rules. + * @member {Array.} rules + * @memberof google.api.Usage + * @instance + */ + Usage.prototype.rules = $util.emptyArray; + + /** + * Usage producerNotificationChannel. + * @member {string} producerNotificationChannel + * @memberof google.api.Usage + * @instance + */ + Usage.prototype.producerNotificationChannel = ""; + + /** + * Creates a new Usage instance using the specified properties. + * @function create + * @memberof google.api.Usage + * @static + * @param {google.api.IUsage=} [properties] Properties to set + * @returns {google.api.Usage} Usage instance + */ + Usage.create = function create(properties) { + return new Usage(properties); + }; + + /** + * Encodes the specified Usage message. Does not implicitly {@link google.api.Usage.verify|verify} messages. + * @function encode + * @memberof google.api.Usage + * @static + * @param {google.api.IUsage} message Usage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Usage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requirements != null && message.requirements.length) + for (var i = 0; i < message.requirements.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.requirements[i]); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.UsageRule.encode(message.rules[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.producerNotificationChannel != null && Object.hasOwnProperty.call(message, "producerNotificationChannel")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.producerNotificationChannel); + return writer; + }; + + /** + * Encodes the specified Usage message, length delimited. Does not implicitly {@link google.api.Usage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Usage + * @static + * @param {google.api.IUsage} message Usage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Usage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Usage message from the specified reader or buffer. + * @function decode + * @memberof google.api.Usage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Usage} Usage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Usage.decode = function 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.Usage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.requirements && message.requirements.length)) + message.requirements = []; + message.requirements.push(reader.string()); + break; + } + case 6: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.UsageRule.decode(reader, reader.uint32())); + break; + } + case 7: { + message.producerNotificationChannel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Usage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Usage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Usage} Usage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Usage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Usage message. + * @function verify + * @memberof google.api.Usage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Usage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requirements != null && message.hasOwnProperty("requirements")) { + if (!Array.isArray(message.requirements)) + return "requirements: array expected"; + for (var i = 0; i < message.requirements.length; ++i) + if (!$util.isString(message.requirements[i])) + return "requirements: string[] 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.UsageRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.producerNotificationChannel != null && message.hasOwnProperty("producerNotificationChannel")) + if (!$util.isString(message.producerNotificationChannel)) + return "producerNotificationChannel: string expected"; + return null; + }; + + /** + * Creates a Usage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Usage + * @static + * @param {Object.} object Plain object + * @returns {google.api.Usage} Usage + */ + Usage.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Usage) + return object; + var message = new $root.google.api.Usage(); + if (object.requirements) { + if (!Array.isArray(object.requirements)) + throw TypeError(".google.api.Usage.requirements: array expected"); + message.requirements = []; + for (var i = 0; i < object.requirements.length; ++i) + message.requirements[i] = String(object.requirements[i]); + } + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Usage.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Usage.rules: object expected"); + message.rules[i] = $root.google.api.UsageRule.fromObject(object.rules[i]); + } + } + if (object.producerNotificationChannel != null) + message.producerNotificationChannel = String(object.producerNotificationChannel); + return message; + }; + + /** + * Creates a plain object from a Usage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Usage + * @static + * @param {google.api.Usage} message Usage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Usage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.requirements = []; + object.rules = []; + } + if (options.defaults) + object.producerNotificationChannel = ""; + if (message.requirements && message.requirements.length) { + object.requirements = []; + for (var j = 0; j < message.requirements.length; ++j) + object.requirements[j] = message.requirements[j]; + } + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.UsageRule.toObject(message.rules[j], options); + } + if (message.producerNotificationChannel != null && message.hasOwnProperty("producerNotificationChannel")) + object.producerNotificationChannel = message.producerNotificationChannel; + return object; + }; + + /** + * Converts this Usage to JSON. + * @function toJSON + * @memberof google.api.Usage + * @instance + * @returns {Object.} JSON object + */ + Usage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Usage + * @function getTypeUrl + * @memberof google.api.Usage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Usage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Usage"; + }; + + return Usage; + })(); + + api.UsageRule = (function() { + + /** + * Properties of a UsageRule. + * @memberof google.api + * @interface IUsageRule + * @property {string|null} [selector] UsageRule selector + * @property {boolean|null} [allowUnregisteredCalls] UsageRule allowUnregisteredCalls + * @property {boolean|null} [skipServiceControl] UsageRule skipServiceControl + */ + + /** + * Constructs a new UsageRule. + * @memberof google.api + * @classdesc Represents a UsageRule. + * @implements IUsageRule + * @constructor + * @param {google.api.IUsageRule=} [properties] Properties to set + */ + function UsageRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsageRule selector. + * @member {string} selector + * @memberof google.api.UsageRule + * @instance + */ + UsageRule.prototype.selector = ""; + + /** + * UsageRule allowUnregisteredCalls. + * @member {boolean} allowUnregisteredCalls + * @memberof google.api.UsageRule + * @instance + */ + UsageRule.prototype.allowUnregisteredCalls = false; + + /** + * UsageRule skipServiceControl. + * @member {boolean} skipServiceControl + * @memberof google.api.UsageRule + * @instance + */ + UsageRule.prototype.skipServiceControl = false; + + /** + * Creates a new UsageRule instance using the specified properties. + * @function create + * @memberof google.api.UsageRule + * @static + * @param {google.api.IUsageRule=} [properties] Properties to set + * @returns {google.api.UsageRule} UsageRule instance + */ + UsageRule.create = function create(properties) { + return new UsageRule(properties); + }; + + /** + * Encodes the specified UsageRule message. Does not implicitly {@link google.api.UsageRule.verify|verify} messages. + * @function encode + * @memberof google.api.UsageRule + * @static + * @param {google.api.IUsageRule} message UsageRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageRule.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.allowUnregisteredCalls != null && Object.hasOwnProperty.call(message, "allowUnregisteredCalls")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowUnregisteredCalls); + if (message.skipServiceControl != null && Object.hasOwnProperty.call(message, "skipServiceControl")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skipServiceControl); + return writer; + }; + + /** + * Encodes the specified UsageRule message, length delimited. Does not implicitly {@link google.api.UsageRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.UsageRule + * @static + * @param {google.api.IUsageRule} message UsageRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsageRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.UsageRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.UsageRule} UsageRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageRule.decode = function 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.UsageRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.allowUnregisteredCalls = reader.bool(); + break; + } + case 3: { + message.skipServiceControl = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsageRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.UsageRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.UsageRule} UsageRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsageRule message. + * @function verify + * @memberof google.api.UsageRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsageRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.allowUnregisteredCalls != null && message.hasOwnProperty("allowUnregisteredCalls")) + if (typeof message.allowUnregisteredCalls !== "boolean") + return "allowUnregisteredCalls: boolean expected"; + if (message.skipServiceControl != null && message.hasOwnProperty("skipServiceControl")) + if (typeof message.skipServiceControl !== "boolean") + return "skipServiceControl: boolean expected"; + return null; + }; + + /** + * Creates a UsageRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.UsageRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.UsageRule} UsageRule + */ + UsageRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.UsageRule) + return object; + var message = new $root.google.api.UsageRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.allowUnregisteredCalls != null) + message.allowUnregisteredCalls = Boolean(object.allowUnregisteredCalls); + if (object.skipServiceControl != null) + message.skipServiceControl = Boolean(object.skipServiceControl); + return message; + }; + + /** + * Creates a plain object from a UsageRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.UsageRule + * @static + * @param {google.api.UsageRule} message UsageRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsageRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selector = ""; + object.allowUnregisteredCalls = false; + object.skipServiceControl = false; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.allowUnregisteredCalls != null && message.hasOwnProperty("allowUnregisteredCalls")) + object.allowUnregisteredCalls = message.allowUnregisteredCalls; + if (message.skipServiceControl != null && message.hasOwnProperty("skipServiceControl")) + object.skipServiceControl = message.skipServiceControl; + return object; + }; + + /** + * Converts this UsageRule to JSON. + * @function toJSON + * @memberof google.api.UsageRule + * @instance + * @returns {Object.} JSON object + */ + UsageRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UsageRule + * @function getTypeUrl + * @memberof google.api.UsageRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UsageRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.UsageRule"; + }; + + return UsageRule; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * 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 = []; + if (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; + + /** + * 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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 = []; + 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); + } + 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 + */ + + /** + * 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; + + /** + * 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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; + } + 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); + } + 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 + */ + + /** + * 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; + + /** + * 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(); + } + 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; + } + 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; + } + } + 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; + } + } + 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; + } + 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]; + } + 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.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.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), 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.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function 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.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + 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.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function 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.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function 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.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + 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.Api = (function() { + + /** + * Properties of an Api. + * @memberof google.protobuf + * @interface IApi + * @property {string|null} [name] Api name + * @property {Array.|null} [methods] Api methods + * @property {Array.|null} [options] Api options + * @property {string|null} [version] Api version + * @property {google.protobuf.ISourceContext|null} [sourceContext] Api sourceContext + * @property {Array.|null} [mixins] Api mixins + * @property {google.protobuf.Syntax|null} [syntax] Api syntax + */ + + /** + * Constructs a new Api. + * @memberof google.protobuf + * @classdesc Represents an Api. + * @implements IApi + * @constructor + * @param {google.protobuf.IApi=} [properties] Properties to set + */ + function Api(properties) { + this.methods = []; + this.options = []; + this.mixins = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Api name. + * @member {string} name + * @memberof google.protobuf.Api + * @instance + */ + Api.prototype.name = ""; + + /** + * Api methods. + * @member {Array.} methods + * @memberof google.protobuf.Api + * @instance + */ + Api.prototype.methods = $util.emptyArray; + + /** + * Api options. + * @member {Array.} options + * @memberof google.protobuf.Api + * @instance + */ + Api.prototype.options = $util.emptyArray; + + /** + * Api version. + * @member {string} version + * @memberof google.protobuf.Api + * @instance + */ + Api.prototype.version = ""; + + /** + * Api sourceContext. + * @member {google.protobuf.ISourceContext|null|undefined} sourceContext + * @memberof google.protobuf.Api + * @instance + */ + Api.prototype.sourceContext = null; + + /** + * Api mixins. + * @member {Array.} mixins + * @memberof google.protobuf.Api + * @instance + */ + Api.prototype.mixins = $util.emptyArray; + + /** + * Api syntax. + * @member {google.protobuf.Syntax} syntax + * @memberof google.protobuf.Api + * @instance + */ + Api.prototype.syntax = 0; + + /** + * Creates a new Api instance using the specified properties. + * @function create + * @memberof google.protobuf.Api + * @static + * @param {google.protobuf.IApi=} [properties] Properties to set + * @returns {google.protobuf.Api} Api instance + */ + Api.create = function create(properties) { + return new Api(properties); + }; + + /** + * Encodes the specified Api message. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Api + * @static + * @param {google.protobuf.IApi} message Api message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Api.encode = function encode(message, writer) { + 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.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + $root.google.protobuf.Method.encode(message.methods[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.sourceContext != null && Object.hasOwnProperty.call(message, "sourceContext")) + $root.google.protobuf.SourceContext.encode(message.sourceContext, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.mixins != null && message.mixins.length) + for (var i = 0; i < message.mixins.length; ++i) + $root.google.protobuf.Mixin.encode(message.mixins[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.syntax); + return writer; + }; + + /** + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Api + * @static + * @param {google.protobuf.IApi} message Api message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Api.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Api message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Api + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Api} Api + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Api.decode = function 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.Api(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push($root.google.protobuf.Method.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); + break; + } + case 4: { + message.version = reader.string(); + break; + } + case 5: { + message.sourceContext = $root.google.protobuf.SourceContext.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.mixins && message.mixins.length)) + message.mixins = []; + message.mixins.push($root.google.protobuf.Mixin.decode(reader, reader.uint32())); + break; + } + case 7: { + message.syntax = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Api message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Api + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Api} Api + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Api.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Api message. + * @function verify + * @memberof google.protobuf.Api + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Api.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.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) { + var error = $root.google.protobuf.Method.verify(message.methods[i]); + if (error) + return "methods." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) { + var error = $root.google.protobuf.SourceContext.verify(message.sourceContext); + if (error) + return "sourceContext." + error; + } + if (message.mixins != null && message.hasOwnProperty("mixins")) { + if (!Array.isArray(message.mixins)) + return "mixins: array expected"; + for (var i = 0; i < message.mixins.length; ++i) { + var error = $root.google.protobuf.Mixin.verify(message.mixins[i]); + if (error) + return "mixins." + error; + } + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + switch (message.syntax) { + default: + return "syntax: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an Api message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Api + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Api} Api + */ + Api.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Api) + return object; + var message = new $root.google.protobuf.Api(); + if (object.name != null) + message.name = String(object.name); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.protobuf.Api.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) { + if (typeof object.methods[i] !== "object") + throw TypeError(".google.protobuf.Api.methods: object expected"); + message.methods[i] = $root.google.protobuf.Method.fromObject(object.methods[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.Api.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.Api.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); + } + } + if (object.version != null) + message.version = String(object.version); + if (object.sourceContext != null) { + if (typeof object.sourceContext !== "object") + throw TypeError(".google.protobuf.Api.sourceContext: object expected"); + message.sourceContext = $root.google.protobuf.SourceContext.fromObject(object.sourceContext); + } + if (object.mixins) { + if (!Array.isArray(object.mixins)) + throw TypeError(".google.protobuf.Api.mixins: array expected"); + message.mixins = []; + for (var i = 0; i < object.mixins.length; ++i) { + if (typeof object.mixins[i] !== "object") + throw TypeError(".google.protobuf.Api.mixins: object expected"); + message.mixins[i] = $root.google.protobuf.Mixin.fromObject(object.mixins[i]); + } + } + switch (object.syntax) { + default: + if (typeof object.syntax === "number") { + message.syntax = object.syntax; + break; + } + break; + case "SYNTAX_PROTO2": + case 0: + message.syntax = 0; + break; + case "SYNTAX_PROTO3": + case 1: + message.syntax = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an Api message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Api + * @static + * @param {google.protobuf.Api} message Api + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Api.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methods = []; + object.options = []; + object.mixins = []; + } + if (options.defaults) { + object.name = ""; + object.version = ""; + object.sourceContext = null; + object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = $root.google.protobuf.Method.toObject(message.methods[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) + object.sourceContext = $root.google.protobuf.SourceContext.toObject(message.sourceContext, options); + if (message.mixins && message.mixins.length) { + object.mixins = []; + for (var j = 0; j < message.mixins.length; ++j) + object.mixins[j] = $root.google.protobuf.Mixin.toObject(message.mixins[j], options); + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; + return object; + }; + + /** + * Converts this Api to JSON. + * @function toJSON + * @memberof google.protobuf.Api + * @instance + * @returns {Object.} JSON object + */ + Api.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Api + * @function getTypeUrl + * @memberof google.protobuf.Api + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Api.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Api"; + }; + + return Api; + })(); + + protobuf.Method = (function() { + + /** + * Properties of a Method. + * @memberof google.protobuf + * @interface IMethod + * @property {string|null} [name] Method name + * @property {string|null} [requestTypeUrl] Method requestTypeUrl + * @property {boolean|null} [requestStreaming] Method requestStreaming + * @property {string|null} [responseTypeUrl] Method responseTypeUrl + * @property {boolean|null} [responseStreaming] Method responseStreaming + * @property {Array.|null} [options] Method options + * @property {google.protobuf.Syntax|null} [syntax] Method syntax + */ + + /** + * Constructs a new Method. + * @memberof google.protobuf + * @classdesc Represents a Method. + * @implements IMethod + * @constructor + * @param {google.protobuf.IMethod=} [properties] Properties to set + */ + function Method(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Method name. + * @member {string} name + * @memberof google.protobuf.Method + * @instance + */ + Method.prototype.name = ""; + + /** + * Method requestTypeUrl. + * @member {string} requestTypeUrl + * @memberof google.protobuf.Method + * @instance + */ + Method.prototype.requestTypeUrl = ""; + + /** + * Method requestStreaming. + * @member {boolean} requestStreaming + * @memberof google.protobuf.Method + * @instance + */ + Method.prototype.requestStreaming = false; + + /** + * Method responseTypeUrl. + * @member {string} responseTypeUrl + * @memberof google.protobuf.Method + * @instance + */ + Method.prototype.responseTypeUrl = ""; + + /** + * Method responseStreaming. + * @member {boolean} responseStreaming + * @memberof google.protobuf.Method + * @instance + */ + Method.prototype.responseStreaming = false; + + /** + * Method options. + * @member {Array.} options + * @memberof google.protobuf.Method + * @instance + */ + Method.prototype.options = $util.emptyArray; + + /** + * Method syntax. + * @member {google.protobuf.Syntax} syntax + * @memberof google.protobuf.Method + * @instance + */ + Method.prototype.syntax = 0; + + /** + * Creates a new Method instance using the specified properties. + * @function create + * @memberof google.protobuf.Method + * @static + * @param {google.protobuf.IMethod=} [properties] Properties to set + * @returns {google.protobuf.Method} Method instance + */ + Method.create = function create(properties) { + return new Method(properties); + }; + + /** + * Encodes the specified Method message. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Method + * @static + * @param {google.protobuf.IMethod} message Method message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Method.encode = function encode(message, writer) { + 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.requestTypeUrl != null && Object.hasOwnProperty.call(message, "requestTypeUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestTypeUrl); + if (message.requestStreaming != null && Object.hasOwnProperty.call(message, "requestStreaming")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.requestStreaming); + if (message.responseTypeUrl != null && Object.hasOwnProperty.call(message, "responseTypeUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.responseTypeUrl); + if (message.responseStreaming != null && Object.hasOwnProperty.call(message, "responseStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.responseStreaming); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.syntax); + return writer; + }; + + /** + * Encodes the specified Method message, length delimited. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Method + * @static + * @param {google.protobuf.IMethod} message Method message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Method.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Method message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Method + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Method} Method + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Method.decode = function 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.Method(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestTypeUrl = reader.string(); + break; + } + case 3: { + message.requestStreaming = reader.bool(); + break; + } + case 4: { + message.responseTypeUrl = reader.string(); + break; + } + case 5: { + message.responseStreaming = reader.bool(); + break; + } + case 6: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); + break; + } + case 7: { + message.syntax = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Method message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Method + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Method} Method + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Method.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Method message. + * @function verify + * @memberof google.protobuf.Method + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Method.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.requestTypeUrl != null && message.hasOwnProperty("requestTypeUrl")) + if (!$util.isString(message.requestTypeUrl)) + return "requestTypeUrl: string expected"; + if (message.requestStreaming != null && message.hasOwnProperty("requestStreaming")) + if (typeof message.requestStreaming !== "boolean") + return "requestStreaming: boolean expected"; + if (message.responseTypeUrl != null && message.hasOwnProperty("responseTypeUrl")) + if (!$util.isString(message.responseTypeUrl)) + return "responseTypeUrl: string expected"; + if (message.responseStreaming != null && message.hasOwnProperty("responseStreaming")) + if (typeof message.responseStreaming !== "boolean") + return "responseStreaming: boolean expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + switch (message.syntax) { + default: + return "syntax: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a Method message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Method + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Method} Method + */ + Method.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Method) + return object; + var message = new $root.google.protobuf.Method(); + if (object.name != null) + message.name = String(object.name); + if (object.requestTypeUrl != null) + message.requestTypeUrl = String(object.requestTypeUrl); + if (object.requestStreaming != null) + message.requestStreaming = Boolean(object.requestStreaming); + if (object.responseTypeUrl != null) + message.responseTypeUrl = String(object.responseTypeUrl); + if (object.responseStreaming != null) + message.responseStreaming = Boolean(object.responseStreaming); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.Method.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.Method.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); + } + } + switch (object.syntax) { + default: + if (typeof object.syntax === "number") { + message.syntax = object.syntax; + break; + } + break; + case "SYNTAX_PROTO2": + case 0: + message.syntax = 0; + break; + case "SYNTAX_PROTO3": + case 1: + message.syntax = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a Method message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Method + * @static + * @param {google.protobuf.Method} message Method + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Method.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.name = ""; + object.requestTypeUrl = ""; + object.requestStreaming = false; + object.responseTypeUrl = ""; + object.responseStreaming = false; + object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestTypeUrl != null && message.hasOwnProperty("requestTypeUrl")) + object.requestTypeUrl = message.requestTypeUrl; + if (message.requestStreaming != null && message.hasOwnProperty("requestStreaming")) + object.requestStreaming = message.requestStreaming; + if (message.responseTypeUrl != null && message.hasOwnProperty("responseTypeUrl")) + object.responseTypeUrl = message.responseTypeUrl; + if (message.responseStreaming != null && message.hasOwnProperty("responseStreaming")) + object.responseStreaming = message.responseStreaming; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; + return object; + }; + + /** + * Converts this Method to JSON. + * @function toJSON + * @memberof google.protobuf.Method + * @instance + * @returns {Object.} JSON object + */ + Method.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Method + * @function getTypeUrl + * @memberof google.protobuf.Method + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Method.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Method"; + }; + + return Method; + })(); + + protobuf.Mixin = (function() { + + /** + * Properties of a Mixin. + * @memberof google.protobuf + * @interface IMixin + * @property {string|null} [name] Mixin name + * @property {string|null} [root] Mixin root + */ + + /** + * Constructs a new Mixin. + * @memberof google.protobuf + * @classdesc Represents a Mixin. + * @implements IMixin + * @constructor + * @param {google.protobuf.IMixin=} [properties] Properties to set + */ + function Mixin(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Mixin name. + * @member {string} name + * @memberof google.protobuf.Mixin + * @instance + */ + Mixin.prototype.name = ""; + + /** + * Mixin root. + * @member {string} root + * @memberof google.protobuf.Mixin + * @instance + */ + Mixin.prototype.root = ""; + + /** + * Creates a new Mixin instance using the specified properties. + * @function create + * @memberof google.protobuf.Mixin + * @static + * @param {google.protobuf.IMixin=} [properties] Properties to set + * @returns {google.protobuf.Mixin} Mixin instance + */ + Mixin.create = function create(properties) { + return new Mixin(properties); + }; + + /** + * Encodes the specified Mixin message. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Mixin + * @static + * @param {google.protobuf.IMixin} message Mixin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mixin.encode = function encode(message, writer) { + 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.root != null && Object.hasOwnProperty.call(message, "root")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.root); + return writer; + }; + + /** + * Encodes the specified Mixin message, length delimited. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Mixin + * @static + * @param {google.protobuf.IMixin} message Mixin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mixin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Mixin message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Mixin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Mixin} Mixin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mixin.decode = function 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.Mixin(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.root = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Mixin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Mixin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Mixin} Mixin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mixin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Mixin message. + * @function verify + * @memberof google.protobuf.Mixin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Mixin.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.root != null && message.hasOwnProperty("root")) + if (!$util.isString(message.root)) + return "root: string expected"; + return null; + }; + + /** + * Creates a Mixin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Mixin + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Mixin} Mixin + */ + Mixin.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Mixin) + return object; + var message = new $root.google.protobuf.Mixin(); + if (object.name != null) + message.name = String(object.name); + if (object.root != null) + message.root = String(object.root); + return message; + }; + + /** + * Creates a plain object from a Mixin message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Mixin + * @static + * @param {google.protobuf.Mixin} message Mixin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Mixin.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.root = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.root != null && message.hasOwnProperty("root")) + object.root = message.root; + return object; + }; + + /** + * Converts this Mixin to JSON. + * @function toJSON + * @memberof google.protobuf.Mixin + * @instance + * @returns {Object.} JSON object + */ + Mixin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Mixin + * @function getTypeUrl + * @memberof google.protobuf.Mixin + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Mixin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Mixin"; + }; + + return Mixin; + })(); + + protobuf.SourceContext = (function() { + + /** + * Properties of a SourceContext. + * @memberof google.protobuf + * @interface ISourceContext + * @property {string|null} [fileName] SourceContext fileName + */ + + /** + * Constructs a new SourceContext. + * @memberof google.protobuf + * @classdesc Represents a SourceContext. + * @implements ISourceContext + * @constructor + * @param {google.protobuf.ISourceContext=} [properties] Properties to set + */ + function SourceContext(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceContext fileName. + * @member {string} fileName + * @memberof google.protobuf.SourceContext + * @instance + */ + SourceContext.prototype.fileName = ""; + + /** + * Creates a new SourceContext instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceContext + * @static + * @param {google.protobuf.ISourceContext=} [properties] Properties to set + * @returns {google.protobuf.SourceContext} SourceContext instance + */ + SourceContext.create = function create(properties) { + return new SourceContext(properties); + }; + + /** + * Encodes the specified SourceContext message. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceContext + * @static + * @param {google.protobuf.ISourceContext} message SourceContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fileName); + return writer; + }; + + /** + * Encodes the specified SourceContext message, length delimited. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceContext + * @static + * @param {google.protobuf.ISourceContext} message SourceContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceContext message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceContext} SourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceContext.decode = function 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.SourceContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fileName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceContext} SourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceContext message. + * @function verify + * @memberof google.protobuf.SourceContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fileName != null && message.hasOwnProperty("fileName")) + if (!$util.isString(message.fileName)) + return "fileName: string expected"; + return null; + }; + + /** + * Creates a SourceContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceContext + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceContext} SourceContext + */ + SourceContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceContext) + return object; + var message = new $root.google.protobuf.SourceContext(); + if (object.fileName != null) + message.fileName = String(object.fileName); + return message; + }; + + /** + * Creates a plain object from a SourceContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceContext + * @static + * @param {google.protobuf.SourceContext} message SourceContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.fileName = ""; + if (message.fileName != null && message.hasOwnProperty("fileName")) + object.fileName = message.fileName; + return object; + }; + + /** + * Converts this SourceContext to JSON. + * @function toJSON + * @memberof google.protobuf.SourceContext + * @instance + * @returns {Object.} JSON object + */ + SourceContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceContext + * @function getTypeUrl + * @memberof google.protobuf.SourceContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceContext"; + }; + + return SourceContext; + })(); + + protobuf.Type = (function() { + + /** + * Properties of a Type. + * @memberof google.protobuf + * @interface IType + * @property {string|null} [name] Type name + * @property {Array.|null} [fields] Type fields + * @property {Array.|null} [oneofs] Type oneofs + * @property {Array.|null} [options] Type options + * @property {google.protobuf.ISourceContext|null} [sourceContext] Type sourceContext + * @property {google.protobuf.Syntax|null} [syntax] Type syntax + */ + + /** + * Constructs a new Type. + * @memberof google.protobuf + * @classdesc Represents a Type. + * @implements IType + * @constructor + * @param {google.protobuf.IType=} [properties] Properties to set + */ + function Type(properties) { + this.fields = []; + this.oneofs = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Type name. + * @member {string} name + * @memberof google.protobuf.Type + * @instance + */ + Type.prototype.name = ""; + + /** + * Type fields. + * @member {Array.} fields + * @memberof google.protobuf.Type + * @instance + */ + Type.prototype.fields = $util.emptyArray; + + /** + * Type oneofs. + * @member {Array.} oneofs + * @memberof google.protobuf.Type + * @instance + */ + Type.prototype.oneofs = $util.emptyArray; + + /** + * Type options. + * @member {Array.} options + * @memberof google.protobuf.Type + * @instance + */ + Type.prototype.options = $util.emptyArray; + + /** + * Type sourceContext. + * @member {google.protobuf.ISourceContext|null|undefined} sourceContext + * @memberof google.protobuf.Type + * @instance + */ + Type.prototype.sourceContext = null; + + /** + * Type syntax. + * @member {google.protobuf.Syntax} syntax + * @memberof google.protobuf.Type + * @instance + */ + Type.prototype.syntax = 0; + + /** + * Creates a new Type instance using the specified properties. + * @function create + * @memberof google.protobuf.Type + * @static + * @param {google.protobuf.IType=} [properties] Properties to set + * @returns {google.protobuf.Type} Type instance + */ + Type.create = function create(properties) { + return new Type(properties); + }; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Type + * @static + * @param {google.protobuf.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.protobuf.Field.encode(message.fields[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.oneofs != null && message.oneofs.length) + for (var i = 0; i < message.oneofs.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.oneofs[i]); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sourceContext != null && Object.hasOwnProperty.call(message, "sourceContext")) + $root.google.protobuf.SourceContext.encode(message.sourceContext, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.syntax); + return writer; + }; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Type + * @static + * @param {google.protobuf.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Type message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decode = function 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.Type(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.protobuf.Field.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.oneofs && message.oneofs.length)) + message.oneofs = []; + message.oneofs.push(reader.string()); + break; + } + case 4: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); + break; + } + case 5: { + message.sourceContext = $root.google.protobuf.SourceContext.decode(reader, reader.uint32()); + break; + } + case 6: { + message.syntax = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Type message. + * @function verify + * @memberof google.protobuf.Type + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Type.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.protobuf.Field.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + if (message.oneofs != null && message.hasOwnProperty("oneofs")) { + if (!Array.isArray(message.oneofs)) + return "oneofs: array expected"; + for (var i = 0; i < message.oneofs.length; ++i) + if (!$util.isString(message.oneofs[i])) + return "oneofs: string[] expected"; + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) { + var error = $root.google.protobuf.SourceContext.verify(message.sourceContext); + if (error) + return "sourceContext." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + switch (message.syntax) { + default: + return "syntax: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Type + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Type} Type + */ + Type.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Type) + return object; + var message = new $root.google.protobuf.Type(); + if (object.name != null) + message.name = String(object.name); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.protobuf.Type.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.protobuf.Type.fields: object expected"); + message.fields[i] = $root.google.protobuf.Field.fromObject(object.fields[i]); + } + } + if (object.oneofs) { + if (!Array.isArray(object.oneofs)) + throw TypeError(".google.protobuf.Type.oneofs: array expected"); + message.oneofs = []; + for (var i = 0; i < object.oneofs.length; ++i) + message.oneofs[i] = String(object.oneofs[i]); + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.Type.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.Type.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); + } + } + if (object.sourceContext != null) { + if (typeof object.sourceContext !== "object") + throw TypeError(".google.protobuf.Type.sourceContext: object expected"); + message.sourceContext = $root.google.protobuf.SourceContext.fromObject(object.sourceContext); + } + switch (object.syntax) { + default: + if (typeof object.syntax === "number") { + message.syntax = object.syntax; + break; + } + break; + case "SYNTAX_PROTO2": + case 0: + message.syntax = 0; + break; + case "SYNTAX_PROTO3": + case 1: + message.syntax = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Type + * @static + * @param {google.protobuf.Type} message Type + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Type.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fields = []; + object.oneofs = []; + object.options = []; + } + if (options.defaults) { + object.name = ""; + object.sourceContext = null; + object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.protobuf.Field.toObject(message.fields[j], options); + } + if (message.oneofs && message.oneofs.length) { + object.oneofs = []; + for (var j = 0; j < message.oneofs.length; ++j) + object.oneofs[j] = message.oneofs[j]; + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); + } + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) + object.sourceContext = $root.google.protobuf.SourceContext.toObject(message.sourceContext, options); + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; + return object; + }; + + /** + * Converts this Type to JSON. + * @function toJSON + * @memberof google.protobuf.Type + * @instance + * @returns {Object.} JSON object + */ + Type.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Type + * @function getTypeUrl + * @memberof google.protobuf.Type + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Type.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Type"; + }; + + return Type; + })(); + + protobuf.Field = (function() { + + /** + * Properties of a Field. + * @memberof google.protobuf + * @interface IField + * @property {google.protobuf.Field.Kind|null} [kind] Field kind + * @property {google.protobuf.Field.Cardinality|null} [cardinality] Field cardinality + * @property {number|null} [number] Field number + * @property {string|null} [name] Field name + * @property {string|null} [typeUrl] Field typeUrl + * @property {number|null} [oneofIndex] Field oneofIndex + * @property {boolean|null} [packed] Field packed + * @property {Array.|null} [options] Field options + * @property {string|null} [jsonName] Field jsonName + * @property {string|null} [defaultValue] Field defaultValue + */ + + /** + * Constructs a new Field. + * @memberof google.protobuf + * @classdesc Represents a Field. + * @implements IField + * @constructor + * @param {google.protobuf.IField=} [properties] Properties to set + */ + function Field(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Field kind. + * @member {google.protobuf.Field.Kind} kind + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.kind = 0; + + /** + * Field cardinality. + * @member {google.protobuf.Field.Cardinality} cardinality + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.cardinality = 0; + + /** + * Field number. + * @member {number} number + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.number = 0; + + /** + * Field name. + * @member {string} name + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.name = ""; + + /** + * Field typeUrl. + * @member {string} typeUrl + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.typeUrl = ""; + + /** + * Field oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.oneofIndex = 0; + + /** + * Field packed. + * @member {boolean} packed + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.packed = false; + + /** + * Field options. + * @member {Array.} options + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.options = $util.emptyArray; + + /** + * Field jsonName. + * @member {string} jsonName + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.jsonName = ""; + + /** + * Field defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.defaultValue = ""; + + /** + * Creates a new Field instance using the specified properties. + * @function create + * @memberof google.protobuf.Field + * @static + * @param {google.protobuf.IField=} [properties] Properties to set + * @returns {google.protobuf.Field} Field instance + */ + Field.create = function create(properties) { + return new Field(properties); + }; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Field + * @static + * @param {google.protobuf.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.cardinality != null && Object.hasOwnProperty.call(message, "cardinality")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.cardinality); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.typeUrl != null && Object.hasOwnProperty.call(message, "typeUrl")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeUrl); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.oneofIndex); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.packed); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.defaultValue); + return writer; + }; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Field + * @static + * @param {google.protobuf.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Field message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decode = function 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.Field(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.cardinality = reader.int32(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.name = reader.string(); + break; + } + case 6: { + message.typeUrl = reader.string(); + break; + } + case 7: { + message.oneofIndex = reader.int32(); + break; + } + case 8: { + message.packed = reader.bool(); + break; + } + case 9: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 11: { + message.defaultValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Field message. + * @function verify + * @memberof google.protobuf.Field + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Field.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.cardinality != null && message.hasOwnProperty("cardinality")) + switch (message.cardinality) { + default: + return "cardinality: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.typeUrl != null && message.hasOwnProperty("typeUrl")) + if (!$util.isString(message.typeUrl)) + return "typeUrl: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + return null; + }; + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Field + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Field} Field + */ + Field.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Field) + return object; + var message = new $root.google.protobuf.Field(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "TYPE_UNKNOWN": + case 0: + message.kind = 0; + break; + case "TYPE_DOUBLE": + case 1: + message.kind = 1; + break; + case "TYPE_FLOAT": + case 2: + message.kind = 2; + break; + case "TYPE_INT64": + case 3: + message.kind = 3; + break; + case "TYPE_UINT64": + case 4: + message.kind = 4; + break; + case "TYPE_INT32": + case 5: + message.kind = 5; + break; + case "TYPE_FIXED64": + case 6: + message.kind = 6; + break; + case "TYPE_FIXED32": + case 7: + message.kind = 7; + break; + case "TYPE_BOOL": + case 8: + message.kind = 8; + break; + case "TYPE_STRING": + case 9: + message.kind = 9; + break; + case "TYPE_GROUP": + case 10: + message.kind = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.kind = 11; + break; + case "TYPE_BYTES": + case 12: + message.kind = 12; + break; + case "TYPE_UINT32": + case 13: + message.kind = 13; + break; + case "TYPE_ENUM": + case 14: + message.kind = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.kind = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.kind = 16; + break; + case "TYPE_SINT32": + case 17: + message.kind = 17; + break; + case "TYPE_SINT64": + case 18: + message.kind = 18; + break; + } + switch (object.cardinality) { + default: + if (typeof object.cardinality === "number") { + message.cardinality = object.cardinality; + break; + } + break; + case "CARDINALITY_UNKNOWN": + case 0: + message.cardinality = 0; + break; + case "CARDINALITY_OPTIONAL": + case 1: + message.cardinality = 1; + break; + case "CARDINALITY_REQUIRED": + case 2: + message.cardinality = 2; + break; + case "CARDINALITY_REPEATED": + case 3: + message.cardinality = 3; + break; + } + if (object.number != null) + message.number = object.number | 0; + if (object.name != null) + message.name = String(object.name); + if (object.typeUrl != null) + message.typeUrl = String(object.typeUrl); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.packed != null) + message.packed = Boolean(object.packed); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.Field.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.Field.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); + } + } + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + return message; + }; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Field + * @static + * @param {google.protobuf.Field} message Field + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Field.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.kind = options.enums === String ? "TYPE_UNKNOWN" : 0; + object.cardinality = options.enums === String ? "CARDINALITY_UNKNOWN" : 0; + object.number = 0; + object.name = ""; + object.typeUrl = ""; + object.oneofIndex = 0; + object.packed = false; + object.jsonName = ""; + object.defaultValue = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.protobuf.Field.Kind[message.kind] === undefined ? message.kind : $root.google.protobuf.Field.Kind[message.kind] : message.kind; + if (message.cardinality != null && message.hasOwnProperty("cardinality")) + object.cardinality = options.enums === String ? $root.google.protobuf.Field.Cardinality[message.cardinality] === undefined ? message.cardinality : $root.google.protobuf.Field.Cardinality[message.cardinality] : message.cardinality; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.typeUrl != null && message.hasOwnProperty("typeUrl")) + object.typeUrl = message.typeUrl; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); + } + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + return object; + }; + + /** + * Converts this Field to JSON. + * @function toJSON + * @memberof google.protobuf.Field + * @instance + * @returns {Object.} JSON object + */ + Field.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Field + * @function getTypeUrl + * @memberof google.protobuf.Field + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Field"; + }; + + /** + * Kind enum. + * @name google.protobuf.Field.Kind + * @enum {number} + * @property {number} TYPE_UNKNOWN=0 TYPE_UNKNOWN value + * @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 + */ + Field.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNKNOWN"] = 0; + 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; + })(); + + /** + * Cardinality enum. + * @name google.protobuf.Field.Cardinality + * @enum {number} + * @property {number} CARDINALITY_UNKNOWN=0 CARDINALITY_UNKNOWN value + * @property {number} CARDINALITY_OPTIONAL=1 CARDINALITY_OPTIONAL value + * @property {number} CARDINALITY_REQUIRED=2 CARDINALITY_REQUIRED value + * @property {number} CARDINALITY_REPEATED=3 CARDINALITY_REPEATED value + */ + Field.Cardinality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CARDINALITY_UNKNOWN"] = 0; + values[valuesById[1] = "CARDINALITY_OPTIONAL"] = 1; + values[valuesById[2] = "CARDINALITY_REQUIRED"] = 2; + values[valuesById[3] = "CARDINALITY_REPEATED"] = 3; + return values; + })(); + + return Field; + })(); + + protobuf.Enum = (function() { + + /** + * Properties of an Enum. + * @memberof google.protobuf + * @interface IEnum + * @property {string|null} [name] Enum name + * @property {Array.|null} [enumvalue] Enum enumvalue + * @property {Array.|null} [options] Enum options + * @property {google.protobuf.ISourceContext|null} [sourceContext] Enum sourceContext + * @property {google.protobuf.Syntax|null} [syntax] Enum syntax + */ + + /** + * Constructs a new Enum. + * @memberof google.protobuf + * @classdesc Represents an Enum. + * @implements IEnum + * @constructor + * @param {google.protobuf.IEnum=} [properties] Properties to set + */ + function Enum(properties) { + this.enumvalue = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Enum name. + * @member {string} name + * @memberof google.protobuf.Enum + * @instance + */ + Enum.prototype.name = ""; + + /** + * Enum enumvalue. + * @member {Array.} enumvalue + * @memberof google.protobuf.Enum + * @instance + */ + Enum.prototype.enumvalue = $util.emptyArray; + + /** + * Enum options. + * @member {Array.} options + * @memberof google.protobuf.Enum + * @instance + */ + Enum.prototype.options = $util.emptyArray; + + /** + * Enum sourceContext. + * @member {google.protobuf.ISourceContext|null|undefined} sourceContext + * @memberof google.protobuf.Enum + * @instance + */ + Enum.prototype.sourceContext = null; + + /** + * Enum syntax. + * @member {google.protobuf.Syntax} syntax + * @memberof google.protobuf.Enum + * @instance + */ + Enum.prototype.syntax = 0; + + /** + * Creates a new Enum instance using the specified properties. + * @function create + * @memberof google.protobuf.Enum + * @static + * @param {google.protobuf.IEnum=} [properties] Properties to set + * @returns {google.protobuf.Enum} Enum instance + */ + Enum.create = function create(properties) { + return new Enum(properties); + }; + + /** + * Encodes the specified Enum message. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Enum + * @static + * @param {google.protobuf.IEnum} message Enum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Enum.encode = function encode(message, writer) { + 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.enumvalue != null && message.enumvalue.length) + for (var i = 0; i < message.enumvalue.length; ++i) + $root.google.protobuf.EnumValue.encode(message.enumvalue[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sourceContext != null && Object.hasOwnProperty.call(message, "sourceContext")) + $root.google.protobuf.SourceContext.encode(message.sourceContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.syntax); + return writer; + }; + + /** + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Enum + * @static + * @param {google.protobuf.IEnum} message Enum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Enum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Enum message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Enum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Enum} Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Enum.decode = function 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.Enum(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.enumvalue && message.enumvalue.length)) + message.enumvalue = []; + message.enumvalue.push($root.google.protobuf.EnumValue.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); + break; + } + case 4: { + message.sourceContext = $root.google.protobuf.SourceContext.decode(reader, reader.uint32()); + break; + } + case 5: { + message.syntax = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Enum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Enum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Enum} Enum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Enum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Enum message. + * @function verify + * @memberof google.protobuf.Enum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Enum.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.enumvalue != null && message.hasOwnProperty("enumvalue")) { + if (!Array.isArray(message.enumvalue)) + return "enumvalue: array expected"; + for (var i = 0; i < message.enumvalue.length; ++i) { + var error = $root.google.protobuf.EnumValue.verify(message.enumvalue[i]); + if (error) + return "enumvalue." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) { + var error = $root.google.protobuf.SourceContext.verify(message.sourceContext); + if (error) + return "sourceContext." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + switch (message.syntax) { + default: + return "syntax: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an Enum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Enum + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Enum} Enum + */ + Enum.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Enum) + return object; + var message = new $root.google.protobuf.Enum(); + if (object.name != null) + message.name = String(object.name); + if (object.enumvalue) { + if (!Array.isArray(object.enumvalue)) + throw TypeError(".google.protobuf.Enum.enumvalue: array expected"); + message.enumvalue = []; + for (var i = 0; i < object.enumvalue.length; ++i) { + if (typeof object.enumvalue[i] !== "object") + throw TypeError(".google.protobuf.Enum.enumvalue: object expected"); + message.enumvalue[i] = $root.google.protobuf.EnumValue.fromObject(object.enumvalue[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.Enum.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.Enum.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); + } + } + if (object.sourceContext != null) { + if (typeof object.sourceContext !== "object") + throw TypeError(".google.protobuf.Enum.sourceContext: object expected"); + message.sourceContext = $root.google.protobuf.SourceContext.fromObject(object.sourceContext); + } + switch (object.syntax) { + default: + if (typeof object.syntax === "number") { + message.syntax = object.syntax; + break; + } + break; + case "SYNTAX_PROTO2": + case 0: + message.syntax = 0; + break; + case "SYNTAX_PROTO3": + case 1: + message.syntax = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an Enum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Enum + * @static + * @param {google.protobuf.Enum} message Enum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Enum.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.enumvalue = []; + object.options = []; + } + if (options.defaults) { + object.name = ""; + object.sourceContext = null; + object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enumvalue && message.enumvalue.length) { + object.enumvalue = []; + for (var j = 0; j < message.enumvalue.length; ++j) + object.enumvalue[j] = $root.google.protobuf.EnumValue.toObject(message.enumvalue[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); + } + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) + object.sourceContext = $root.google.protobuf.SourceContext.toObject(message.sourceContext, options); + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; + return object; + }; + + /** + * Converts this Enum to JSON. + * @function toJSON + * @memberof google.protobuf.Enum + * @instance + * @returns {Object.} JSON object + */ + Enum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Enum + * @function getTypeUrl + * @memberof google.protobuf.Enum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Enum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Enum"; + }; + + return Enum; + })(); + + protobuf.EnumValue = (function() { + + /** + * Properties of an EnumValue. + * @memberof google.protobuf + * @interface IEnumValue + * @property {string|null} [name] EnumValue name + * @property {number|null} [number] EnumValue number + * @property {Array.|null} [options] EnumValue options + */ + + /** + * Constructs a new EnumValue. + * @memberof google.protobuf + * @classdesc Represents an EnumValue. + * @implements IEnumValue + * @constructor + * @param {google.protobuf.IEnumValue=} [properties] Properties to set + */ + function EnumValue(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValue name. + * @member {string} name + * @memberof google.protobuf.EnumValue + * @instance + */ + EnumValue.prototype.name = ""; + + /** + * EnumValue number. + * @member {number} number + * @memberof google.protobuf.EnumValue + * @instance + */ + EnumValue.prototype.number = 0; + + /** + * EnumValue options. + * @member {Array.} options + * @memberof google.protobuf.EnumValue + * @instance + */ + EnumValue.prototype.options = $util.emptyArray; + + /** + * Creates a new EnumValue instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValue + * @static + * @param {google.protobuf.IEnumValue=} [properties] Properties to set + * @returns {google.protobuf.EnumValue} EnumValue instance + */ + EnumValue.create = function create(properties) { + return new EnumValue(properties); + }; + + /** + * Encodes the specified EnumValue message. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValue + * @static + * @param {google.protobuf.IEnumValue} message EnumValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValue.encode = function encode(message, writer) { + 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 && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValue + * @static + * @param {google.protobuf.IEnumValue} message EnumValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValue} EnumValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValue.decode = function 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.EnumValue(); + 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: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValue} EnumValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValue message. + * @function verify + * @memberof google.protobuf.EnumValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValue.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")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates an EnumValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValue} EnumValue + */ + EnumValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValue) + return object; + var message = new $root.google.protobuf.EnumValue(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.EnumValue.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.EnumValue.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValue + * @static + * @param {google.protobuf.EnumValue} message EnumValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.name = ""; + object.number = 0; + } + 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 && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this EnumValue to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValue + * @instance + * @returns {Object.} JSON object + */ + EnumValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValue + * @function getTypeUrl + * @memberof google.protobuf.EnumValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValue"; + }; + + return EnumValue; + })(); + + protobuf.Option = (function() { + + /** + * Properties of an Option. + * @memberof google.protobuf + * @interface IOption + * @property {string|null} [name] Option name + * @property {google.protobuf.IAny|null} [value] Option value + */ + + /** + * Constructs a new Option. + * @memberof google.protobuf + * @classdesc Represents an Option. + * @implements IOption + * @constructor + * @param {google.protobuf.IOption=} [properties] Properties to set + */ + function Option(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Option name. + * @member {string} name + * @memberof google.protobuf.Option + * @instance + */ + Option.prototype.name = ""; + + /** + * Option value. + * @member {google.protobuf.IAny|null|undefined} value + * @memberof google.protobuf.Option + * @instance + */ + Option.prototype.value = null; + + /** + * Creates a new Option instance using the specified properties. + * @function create + * @memberof google.protobuf.Option + * @static + * @param {google.protobuf.IOption=} [properties] Properties to set + * @returns {google.protobuf.Option} Option instance + */ + Option.create = function create(properties) { + return new Option(properties); + }; + + /** + * Encodes the specified Option message. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Option + * @static + * @param {google.protobuf.IOption} message Option message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Option.encode = function encode(message, writer) { + 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 && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Any.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Option message, length delimited. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Option + * @static + * @param {google.protobuf.IOption} message Option message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Option.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Option message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Option + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Option} Option + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Option.decode = function 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.Option(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Option message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Option + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Option} Option + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Option.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Option message. + * @function verify + * @memberof google.protobuf.Option + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Option.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")) { + var error = $root.google.protobuf.Any.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates an Option message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Option + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Option} Option + */ + Option.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Option) + return object; + var message = new $root.google.protobuf.Option(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.protobuf.Option.value: object expected"); + message.value = $root.google.protobuf.Any.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from an Option message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Option + * @static + * @param {google.protobuf.Option} message Option + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Option.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.protobuf.Any.toObject(message.value, options); + return object; + }; + + /** + * Converts this Option to JSON. + * @function toJSON + * @memberof google.protobuf.Option + * @instance + * @returns {Object.} JSON object + */ + Option.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Option + * @function getTypeUrl + * @memberof google.protobuf.Option + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Option.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Option"; + }; + + return Option; + })(); + + /** + * Syntax enum. + * @name google.protobuf.Syntax + * @enum {number} + * @property {number} SYNTAX_PROTO2=0 SYNTAX_PROTO2 value + * @property {number} SYNTAX_PROTO3=1 SYNTAX_PROTO3 value + */ + protobuf.Syntax = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SYNTAX_PROTO2"] = 0; + values[valuesById[1] = "SYNTAX_PROTO3"] = 1; + return values; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + 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; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-api-servicemanagement/protos/protos.json b/packages/google-api-servicemanagement/protos/protos.json new file mode 100644 index 00000000000..8bf3022ea23 --- /dev/null +++ b/packages/google-api-servicemanagement/protos/protos.json @@ -0,0 +1,3502 @@ +{ + "nested": { + "google": { + "nested": { + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig", + "java_multiple_files": true, + "java_outer_classname": "UsageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "servicemanagement": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.ServiceManagement.V1", + "go_package": "google.golang.org/genproto/googleapis/api/servicemanagement/v1;servicemanagement", + "java_multiple_files": true, + "java_outer_classname": "ServiceManagerProto", + "java_package": "com.google.api.servicemanagement.v1", + "objc_class_prefix": "GASM", + "php_namespace": "Google\\Cloud\\ServiceManagement\\V1", + "ruby_package": "Google::Cloud::ServiceManagement::V1" + }, + "nested": { + "ManagedService": { + "fields": { + "serviceName": { + "type": "string", + "id": 2 + }, + "producerProjectId": { + "type": "string", + "id": 3 + } + } + }, + "OperationMetadata": { + "fields": { + "resourceNames": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "steps": { + "rule": "repeated", + "type": "Step", + "id": 2 + }, + "progressPercentage": { + "type": "int32", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + }, + "nested": { + "Step": { + "fields": { + "description": { + "type": "string", + "id": 2 + }, + "status": { + "type": "Status", + "id": 4 + } + } + }, + "Status": { + "values": { + "STATUS_UNSPECIFIED": 0, + "DONE": 1, + "NOT_STARTED": 2, + "IN_PROGRESS": 3, + "FAILED": 4, + "CANCELLED": 5 + } + } + } + }, + "Diagnostic": { + "fields": { + "location": { + "type": "string", + "id": 1 + }, + "kind": { + "type": "Kind", + "id": 2 + }, + "message": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Kind": { + "values": { + "WARNING": 0, + "ERROR": 1 + } + } + } + }, + "ConfigSource": { + "fields": { + "id": { + "type": "string", + "id": 5 + }, + "files": { + "rule": "repeated", + "type": "ConfigFile", + "id": 2 + } + } + }, + "ConfigFile": { + "fields": { + "filePath": { + "type": "string", + "id": 1 + }, + "fileContents": { + "type": "bytes", + "id": 3 + }, + "fileType": { + "type": "FileType", + "id": 4 + } + }, + "nested": { + "FileType": { + "values": { + "FILE_TYPE_UNSPECIFIED": 0, + "SERVICE_CONFIG_YAML": 1, + "OPEN_API_JSON": 2, + "OPEN_API_YAML": 3, + "FILE_DESCRIPTOR_SET_PROTO": 4, + "PROTO_FILE": 6 + } + } + } + }, + "ConfigRef": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ChangeReport": { + "fields": { + "configChanges": { + "rule": "repeated", + "type": "google.api.ConfigChange", + "id": 1 + } + } + }, + "Rollout": { + "oneofs": { + "strategy": { + "oneof": [ + "trafficPercentStrategy", + "deleteServiceStrategy" + ] + } + }, + "fields": { + "rolloutId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "createdBy": { + "type": "string", + "id": 3 + }, + "status": { + "type": "RolloutStatus", + "id": 4 + }, + "trafficPercentStrategy": { + "type": "TrafficPercentStrategy", + "id": 5 + }, + "deleteServiceStrategy": { + "type": "DeleteServiceStrategy", + "id": 200 + }, + "serviceName": { + "type": "string", + "id": 8 + } + }, + "nested": { + "TrafficPercentStrategy": { + "fields": { + "percentages": { + "keyType": "string", + "type": "double", + "id": 1 + } + } + }, + "DeleteServiceStrategy": { + "fields": {} + }, + "RolloutStatus": { + "values": { + "ROLLOUT_STATUS_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "SUCCESS": 2, + "CANCELLED": 3, + "FAILED": 4, + "PENDING": 5, + "FAILED_ROLLED_BACK": 6 + } + } + } + }, + "ServiceManager": { + "options": { + "(google.api.default_host)": "servicemanagement.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/service.management,https://www.googleapis.com/auth/service.management.readonly" + }, + "methods": { + "ListServices": { + "requestType": "ListServicesRequest", + "responseType": "ListServicesResponse", + "options": { + "(google.api.http).get": "/v1/services", + "(google.api.method_signature)": "producer_project_id,consumer_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/services" + } + }, + { + "(google.api.method_signature)": "producer_project_id,consumer_id" + } + ] + }, + "GetService": { + "requestType": "GetServiceRequest", + "responseType": "ManagedService", + "options": { + "(google.api.http).get": "/v1/services/{service_name}", + "(google.api.method_signature)": "service_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/services/{service_name}" + } + }, + { + "(google.api.method_signature)": "service_name" + } + ] + }, + "CreateService": { + "requestType": "CreateServiceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/services", + "(google.api.http).body": "service", + "(google.api.method_signature)": "service", + "(google.longrunning.operation_info).response_type": "google.api.servicemanagement.v1.ManagedService", + "(google.longrunning.operation_info).metadata_type": "google.api.servicemanagement.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/services", + "body": "service" + } + }, + { + "(google.api.method_signature)": "service" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.api.servicemanagement.v1.ManagedService", + "metadata_type": "google.api.servicemanagement.v1.OperationMetadata" + } + } + ] + }, + "DeleteService": { + "requestType": "DeleteServiceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/services/{service_name}", + "(google.api.method_signature)": "service_name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.api.servicemanagement.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/services/{service_name}" + } + }, + { + "(google.api.method_signature)": "service_name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.api.servicemanagement.v1.OperationMetadata" + } + } + ] + }, + "UndeleteService": { + "requestType": "UndeleteServiceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/services/{service_name}:undelete", + "(google.api.method_signature)": "service_name", + "(google.longrunning.operation_info).response_type": "google.api.servicemanagement.v1.UndeleteServiceResponse", + "(google.longrunning.operation_info).metadata_type": "google.api.servicemanagement.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/services/{service_name}:undelete" + } + }, + { + "(google.api.method_signature)": "service_name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.api.servicemanagement.v1.UndeleteServiceResponse", + "metadata_type": "google.api.servicemanagement.v1.OperationMetadata" + } + } + ] + }, + "ListServiceConfigs": { + "requestType": "ListServiceConfigsRequest", + "responseType": "ListServiceConfigsResponse", + "options": { + "(google.api.http).get": "/v1/services/{service_name}/configs", + "(google.api.method_signature)": "service_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/services/{service_name}/configs" + } + }, + { + "(google.api.method_signature)": "service_name" + } + ] + }, + "GetServiceConfig": { + "requestType": "GetServiceConfigRequest", + "responseType": "google.api.Service", + "options": { + "(google.api.http).get": "/v1/services/{service_name}/configs/{config_id}", + "(google.api.http).additional_bindings.get": "/v1/services/{service_name}/config", + "(google.api.method_signature)": "service_name,config_id,view" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/services/{service_name}/configs/{config_id}", + "additional_bindings": { + "get": "/v1/services/{service_name}/config" + } + } + }, + { + "(google.api.method_signature)": "service_name,config_id,view" + } + ] + }, + "CreateServiceConfig": { + "requestType": "CreateServiceConfigRequest", + "responseType": "google.api.Service", + "options": { + "(google.api.http).post": "/v1/services/{service_name}/configs", + "(google.api.http).body": "service_config", + "(google.api.method_signature)": "service_name,service_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/services/{service_name}/configs", + "body": "service_config" + } + }, + { + "(google.api.method_signature)": "service_name,service_config" + } + ] + }, + "SubmitConfigSource": { + "requestType": "SubmitConfigSourceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/services/{service_name}/configs:submit", + "(google.api.http).body": "*", + "(google.api.method_signature)": "service_name,config_source,validate_only", + "(google.longrunning.operation_info).response_type": "google.api.servicemanagement.v1.SubmitConfigSourceResponse", + "(google.longrunning.operation_info).metadata_type": "google.api.servicemanagement.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/services/{service_name}/configs:submit", + "body": "*" + } + }, + { + "(google.api.method_signature)": "service_name,config_source,validate_only" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.api.servicemanagement.v1.SubmitConfigSourceResponse", + "metadata_type": "google.api.servicemanagement.v1.OperationMetadata" + } + } + ] + }, + "ListServiceRollouts": { + "requestType": "ListServiceRolloutsRequest", + "responseType": "ListServiceRolloutsResponse", + "options": { + "(google.api.http).get": "/v1/services/{service_name}/rollouts", + "(google.api.method_signature)": "service_name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/services/{service_name}/rollouts" + } + }, + { + "(google.api.method_signature)": "service_name,filter" + } + ] + }, + "GetServiceRollout": { + "requestType": "GetServiceRolloutRequest", + "responseType": "Rollout", + "options": { + "(google.api.http).get": "/v1/services/{service_name}/rollouts/{rollout_id}", + "(google.api.method_signature)": "service_name,rollout_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/services/{service_name}/rollouts/{rollout_id}" + } + }, + { + "(google.api.method_signature)": "service_name,rollout_id" + } + ] + }, + "CreateServiceRollout": { + "requestType": "CreateServiceRolloutRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/services/{service_name}/rollouts", + "(google.api.http).body": "rollout", + "(google.api.method_signature)": "service_name,rollout", + "(google.longrunning.operation_info).response_type": "google.api.servicemanagement.v1.Rollout", + "(google.longrunning.operation_info).metadata_type": "google.api.servicemanagement.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/services/{service_name}/rollouts", + "body": "rollout" + } + }, + { + "(google.api.method_signature)": "service_name,rollout" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.api.servicemanagement.v1.Rollout", + "metadata_type": "google.api.servicemanagement.v1.OperationMetadata" + } + } + ] + }, + "GenerateConfigReport": { + "requestType": "GenerateConfigReportRequest", + "responseType": "GenerateConfigReportResponse", + "options": { + "(google.api.http).post": "/v1/services:generateConfigReport", + "(google.api.http).body": "*", + "(google.api.method_signature)": "new_config,old_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/services:generateConfigReport", + "body": "*" + } + }, + { + "(google.api.method_signature)": "new_config,old_config" + } + ] + } + } + }, + "ListServicesRequest": { + "fields": { + "producerProjectId": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 6 + }, + "consumerId": { + "type": "string", + "id": 7, + "options": { + "deprecated": true + } + } + } + }, + "ListServicesResponse": { + "fields": { + "services": { + "rule": "repeated", + "type": "ManagedService", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetServiceRequest": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateServiceRequest": { + "fields": { + "service": { + "type": "ManagedService", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteServiceRequest": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UndeleteServiceRequest": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UndeleteServiceResponse": { + "fields": { + "service": { + "type": "ManagedService", + "id": 1 + } + } + }, + "GetServiceConfigRequest": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "configId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "view": { + "type": "ConfigView", + "id": 3 + } + }, + "nested": { + "ConfigView": { + "values": { + "BASIC": 0, + "FULL": 1 + } + } + } + }, + "ListServiceConfigsRequest": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListServiceConfigsResponse": { + "fields": { + "serviceConfigs": { + "rule": "repeated", + "type": "google.api.Service", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateServiceConfigRequest": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "serviceConfig": { + "type": "google.api.Service", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SubmitConfigSourceRequest": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "configSource": { + "type": "ConfigSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SubmitConfigSourceResponse": { + "fields": { + "serviceConfig": { + "type": "google.api.Service", + "id": 1 + } + } + }, + "CreateServiceRolloutRequest": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rollout": { + "type": "Rollout", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListServiceRolloutsRequest": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListServiceRolloutsResponse": { + "fields": { + "rollouts": { + "rule": "repeated", + "type": "Rollout", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetServiceRolloutRequest": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rolloutId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GenerateConfigReportRequest": { + "fields": { + "newConfig": { + "type": "google.protobuf.Any", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "oldConfig": { + "type": "google.protobuf.Any", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GenerateConfigReportResponse": { + "fields": { + "serviceName": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "changeReports": { + "rule": "repeated", + "type": "ChangeReport", + "id": 3 + }, + "diagnostics": { + "rule": "repeated", + "type": "Diagnostic", + "id": 4 + } + } + } + } + } + } + }, + "ConfigChange": { + "fields": { + "element": { + "type": "string", + "id": 1 + }, + "oldValue": { + "type": "string", + "id": 2 + }, + "newValue": { + "type": "string", + "id": 3 + }, + "changeType": { + "type": "ChangeType", + "id": 4 + }, + "advices": { + "rule": "repeated", + "type": "Advice", + "id": 5 + } + } + }, + "Advice": { + "fields": { + "description": { + "type": "string", + "id": 2 + } + } + }, + "ChangeType": { + "values": { + "CHANGE_TYPE_UNSPECIFIED": 0, + "ADDED": 1, + "REMOVED": 2, + "MODIFIED": 3 + } + }, + "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 + } + }, + "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" + }, + "Service": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "producerProjectId": { + "type": "string", + "id": 22 + }, + "id": { + "type": "string", + "id": 33 + }, + "apis": { + "rule": "repeated", + "type": "google.protobuf.Api", + "id": 3 + }, + "types": { + "rule": "repeated", + "type": "google.protobuf.Type", + "id": 4 + }, + "enums": { + "rule": "repeated", + "type": "google.protobuf.Enum", + "id": 5 + }, + "documentation": { + "type": "Documentation", + "id": 6 + }, + "backend": { + "type": "Backend", + "id": 8 + }, + "http": { + "type": "Http", + "id": 9 + }, + "quota": { + "type": "Quota", + "id": 10 + }, + "authentication": { + "type": "Authentication", + "id": 11 + }, + "context": { + "type": "Context", + "id": 12 + }, + "usage": { + "type": "Usage", + "id": 15 + }, + "endpoints": { + "rule": "repeated", + "type": "Endpoint", + "id": 18 + }, + "control": { + "type": "Control", + "id": 21 + }, + "logs": { + "rule": "repeated", + "type": "LogDescriptor", + "id": 23 + }, + "metrics": { + "rule": "repeated", + "type": "MetricDescriptor", + "id": 24 + }, + "monitoredResources": { + "rule": "repeated", + "type": "MonitoredResourceDescriptor", + "id": 25 + }, + "billing": { + "type": "Billing", + "id": 26 + }, + "logging": { + "type": "Logging", + "id": 27 + }, + "monitoring": { + "type": "Monitoring", + "id": 28 + }, + "systemParameters": { + "type": "SystemParameters", + "id": 29 + }, + "sourceInfo": { + "type": "SourceInfo", + "id": 37 + }, + "configVersion": { + "type": "google.protobuf.UInt32Value", + "id": 20, + "options": { + "deprecated": true + } + } + } + }, + "Authentication": { + "fields": { + "rules": { + "rule": "repeated", + "type": "AuthenticationRule", + "id": 3 + }, + "providers": { + "rule": "repeated", + "type": "AuthProvider", + "id": 4 + } + } + }, + "AuthenticationRule": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "oauth": { + "type": "OAuthRequirements", + "id": 2 + }, + "allowWithoutCredential": { + "type": "bool", + "id": 5 + }, + "requirements": { + "rule": "repeated", + "type": "AuthRequirement", + "id": 7 + } + } + }, + "JwtLocation": { + "oneofs": { + "in": { + "oneof": [ + "header", + "query" + ] + } + }, + "fields": { + "header": { + "type": "string", + "id": 1 + }, + "query": { + "type": "string", + "id": 2 + }, + "valuePrefix": { + "type": "string", + "id": 3 + } + } + }, + "AuthProvider": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "issuer": { + "type": "string", + "id": 2 + }, + "jwksUri": { + "type": "string", + "id": 3 + }, + "audiences": { + "type": "string", + "id": 4 + }, + "authorizationUrl": { + "type": "string", + "id": 5 + }, + "jwtLocations": { + "rule": "repeated", + "type": "JwtLocation", + "id": 6 + } + } + }, + "OAuthRequirements": { + "fields": { + "canonicalScopes": { + "type": "string", + "id": 1 + } + } + }, + "AuthRequirement": { + "fields": { + "providerId": { + "type": "string", + "id": 1 + }, + "audiences": { + "type": "string", + "id": 2 + } + } + }, + "Backend": { + "fields": { + "rules": { + "rule": "repeated", + "type": "BackendRule", + "id": 1 + } + } + }, + "BackendRule": { + "oneofs": { + "authentication": { + "oneof": [ + "jwtAudience", + "disableAuth" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "address": { + "type": "string", + "id": 2 + }, + "deadline": { + "type": "double", + "id": 3 + }, + "minDeadline": { + "type": "double", + "id": 4 + }, + "operationDeadline": { + "type": "double", + "id": 5 + }, + "pathTranslation": { + "type": "PathTranslation", + "id": 6 + }, + "jwtAudience": { + "type": "string", + "id": 7 + }, + "disableAuth": { + "type": "bool", + "id": 8 + }, + "protocol": { + "type": "string", + "id": 9 + } + }, + "nested": { + "PathTranslation": { + "values": { + "PATH_TRANSLATION_UNSPECIFIED": 0, + "CONSTANT_ADDRESS": 1, + "APPEND_PATH_TO_ADDRESS": 2 + } + } + } + }, + "Billing": { + "fields": { + "consumerDestinations": { + "rule": "repeated", + "type": "BillingDestination", + "id": 8 + } + }, + "nested": { + "BillingDestination": { + "fields": { + "monitoredResource": { + "type": "string", + "id": 1 + }, + "metrics": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, + "Context": { + "fields": { + "rules": { + "rule": "repeated", + "type": "ContextRule", + "id": 1 + } + } + }, + "ContextRule": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "requested": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "provided": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "allowedRequestExtensions": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "allowedResponseExtensions": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "Control": { + "fields": { + "environment": { + "type": "string", + "id": 1 + } + } + }, + "Documentation": { + "fields": { + "summary": { + "type": "string", + "id": 1 + }, + "pages": { + "rule": "repeated", + "type": "Page", + "id": 5 + }, + "rules": { + "rule": "repeated", + "type": "DocumentationRule", + "id": 3 + }, + "documentationRootUrl": { + "type": "string", + "id": 4 + }, + "serviceRootUrl": { + "type": "string", + "id": 6 + }, + "overview": { + "type": "string", + "id": 2 + } + } + }, + "DocumentationRule": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "deprecationDescription": { + "type": "string", + "id": 3 + } + } + }, + "Page": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "content": { + "type": "string", + "id": 2 + }, + "subpages": { + "rule": "repeated", + "type": "Page", + "id": 3 + } + } + }, + "Endpoint": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "aliases": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "target": { + "type": "string", + "id": 101 + }, + "allowCors": { + "type": "bool", + "id": 5 + } + } + }, + "LogDescriptor": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "labels": { + "rule": "repeated", + "type": "LabelDescriptor", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 4 + } + } + }, + "LabelDescriptor": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "valueType": { + "type": "ValueType", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + }, + "nested": { + "ValueType": { + "values": { + "STRING": 0, + "BOOL": 1, + "INT64": 2 + } + } + } + }, + "Logging": { + "fields": { + "producerDestinations": { + "rule": "repeated", + "type": "LoggingDestination", + "id": 1 + }, + "consumerDestinations": { + "rule": "repeated", + "type": "LoggingDestination", + "id": 2 + } + }, + "nested": { + "LoggingDestination": { + "fields": { + "monitoredResource": { + "type": "string", + "id": 3 + }, + "logs": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "MetricDescriptor": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 8 + }, + "labels": { + "rule": "repeated", + "type": "LabelDescriptor", + "id": 2 + }, + "metricKind": { + "type": "MetricKind", + "id": 3 + }, + "valueType": { + "type": "ValueType", + "id": 4 + }, + "unit": { + "type": "string", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + }, + "displayName": { + "type": "string", + "id": 7 + }, + "metadata": { + "type": "MetricDescriptorMetadata", + "id": 10 + }, + "launchStage": { + "type": "LaunchStage", + "id": 12 + }, + "monitoredResourceTypes": { + "rule": "repeated", + "type": "string", + "id": 13 + } + }, + "nested": { + "MetricDescriptorMetadata": { + "fields": { + "launchStage": { + "type": "LaunchStage", + "id": 1, + "options": { + "deprecated": true + } + }, + "samplePeriod": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "ingestDelay": { + "type": "google.protobuf.Duration", + "id": 3 + } + } + }, + "MetricKind": { + "values": { + "METRIC_KIND_UNSPECIFIED": 0, + "GAUGE": 1, + "DELTA": 2, + "CUMULATIVE": 3 + } + }, + "ValueType": { + "values": { + "VALUE_TYPE_UNSPECIFIED": 0, + "BOOL": 1, + "INT64": 2, + "DOUBLE": 3, + "STRING": 4, + "DISTRIBUTION": 5, + "MONEY": 6 + } + } + } + }, + "Metric": { + "fields": { + "type": { + "type": "string", + "id": 3 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "MonitoredResourceDescriptor": { + "fields": { + "name": { + "type": "string", + "id": 5 + }, + "type": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "labels": { + "rule": "repeated", + "type": "LabelDescriptor", + "id": 4 + }, + "launchStage": { + "type": "LaunchStage", + "id": 7 + } + } + }, + "MonitoredResource": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "MonitoredResourceMetadata": { + "fields": { + "systemLabels": { + "type": "google.protobuf.Struct", + "id": 1 + }, + "userLabels": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "Monitoring": { + "fields": { + "producerDestinations": { + "rule": "repeated", + "type": "MonitoringDestination", + "id": 1 + }, + "consumerDestinations": { + "rule": "repeated", + "type": "MonitoringDestination", + "id": 2 + } + }, + "nested": { + "MonitoringDestination": { + "fields": { + "monitoredResource": { + "type": "string", + "id": 1 + }, + "metrics": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, + "Quota": { + "fields": { + "limits": { + "rule": "repeated", + "type": "QuotaLimit", + "id": 3 + }, + "metricRules": { + "rule": "repeated", + "type": "MetricRule", + "id": 4 + } + } + }, + "MetricRule": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "metricCosts": { + "keyType": "string", + "type": "int64", + "id": 2 + } + } + }, + "QuotaLimit": { + "fields": { + "name": { + "type": "string", + "id": 6 + }, + "description": { + "type": "string", + "id": 2 + }, + "defaultLimit": { + "type": "int64", + "id": 3 + }, + "maxLimit": { + "type": "int64", + "id": 4 + }, + "freeTier": { + "type": "int64", + "id": 7 + }, + "duration": { + "type": "string", + "id": 5 + }, + "metric": { + "type": "string", + "id": 8 + }, + "unit": { + "type": "string", + "id": 9 + }, + "values": { + "keyType": "string", + "type": "int64", + "id": 10 + }, + "displayName": { + "type": "string", + "id": 12 + } + } + }, + "SourceInfo": { + "fields": { + "sourceFiles": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 1 + } + } + }, + "SystemParameters": { + "fields": { + "rules": { + "rule": "repeated", + "type": "SystemParameterRule", + "id": 1 + } + } + }, + "SystemParameterRule": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "parameters": { + "rule": "repeated", + "type": "SystemParameter", + "id": 2 + } + } + }, + "SystemParameter": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "httpHeader": { + "type": "string", + "id": 2 + }, + "urlQueryParameter": { + "type": "string", + "id": 3 + } + } + }, + "Usage": { + "fields": { + "requirements": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "rules": { + "rule": "repeated", + "type": "UsageRule", + "id": 6 + }, + "producerNotificationChannel": { + "type": "string", + "id": 7 + } + } + }, + "UsageRule": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "allowUnregisteredCalls": { + "type": "bool", + "id": 2 + }, + "skipServiceControl": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/known/typepb", + "java_package": "com.google.protobuf", + "java_outer_classname": "TypeProto", + "csharp_namespace": "Google.Protobuf.WellKnownTypes", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED", + "java_multiple_files": true + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Api": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "methods": { + "rule": "repeated", + "type": "Method", + "id": 2 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 3 + }, + "version": { + "type": "string", + "id": 4 + }, + "sourceContext": { + "type": "SourceContext", + "id": 5 + }, + "mixins": { + "rule": "repeated", + "type": "Mixin", + "id": 6 + }, + "syntax": { + "type": "Syntax", + "id": 7 + } + } + }, + "Method": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "requestTypeUrl": { + "type": "string", + "id": 2 + }, + "requestStreaming": { + "type": "bool", + "id": 3 + }, + "responseTypeUrl": { + "type": "string", + "id": 4 + }, + "responseStreaming": { + "type": "bool", + "id": 5 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 6 + }, + "syntax": { + "type": "Syntax", + "id": 7 + } + } + }, + "Mixin": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "root": { + "type": "string", + "id": 2 + } + } + }, + "SourceContext": { + "fields": { + "fileName": { + "type": "string", + "id": 1 + } + } + }, + "Type": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "fields": { + "rule": "repeated", + "type": "Field", + "id": 2 + }, + "oneofs": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 4 + }, + "sourceContext": { + "type": "SourceContext", + "id": 5 + }, + "syntax": { + "type": "Syntax", + "id": 6 + } + } + }, + "Field": { + "fields": { + "kind": { + "type": "Kind", + "id": 1 + }, + "cardinality": { + "type": "Cardinality", + "id": 2 + }, + "number": { + "type": "int32", + "id": 3 + }, + "name": { + "type": "string", + "id": 4 + }, + "typeUrl": { + "type": "string", + "id": 6 + }, + "oneofIndex": { + "type": "int32", + "id": 7 + }, + "packed": { + "type": "bool", + "id": 8 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "defaultValue": { + "type": "string", + "id": 11 + } + }, + "nested": { + "Kind": { + "values": { + "TYPE_UNKNOWN": 0, + "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 + } + }, + "Cardinality": { + "values": { + "CARDINALITY_UNKNOWN": 0, + "CARDINALITY_OPTIONAL": 1, + "CARDINALITY_REQUIRED": 2, + "CARDINALITY_REPEATED": 3 + } + } + } + }, + "Enum": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "enumvalue": { + "rule": "repeated", + "type": "EnumValue", + "id": 2 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 3 + }, + "sourceContext": { + "type": "SourceContext", + "id": 4 + }, + "syntax": { + "type": "Syntax", + "id": 5 + } + } + }, + "EnumValue": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 3 + } + } + }, + "Option": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "Any", + "id": 2 + } + } + }, + "Syntax": { + "values": { + "SYNTAX_PROTO2": 0, + "SYNTAX_PROTO3": 1 + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "Empty": { + "fields": {} + } + } + }, + "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-api-servicemanagement/samples/README.md b/packages/google-api-servicemanagement/samples/README.md new file mode 100644 index 00000000000..89b9ef15789 --- /dev/null +++ b/packages/google-api-servicemanagement/samples/README.md @@ -0,0 +1,50 @@ +[//]: # "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 + +# [Service Management API: Node.js Samples](https://github.com/googleapis/nodejs-service-management) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [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/nodejs-service-management#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-service-management/blob/main/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-service-management&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/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/nodejs-service-management&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/service-infrastructure/docs/overview/ diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service.js new file mode 100644 index 00000000000..a9fcf4fc20d --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service.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(service) { + // [START servicemanagement_v1_generated_ServiceManager_CreateService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Initial values for the service resource. + */ + // const service = {} + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callCreateService() { + // Construct request + const request = { + service, + }; + + // Run request + const [operation] = await servicemanagementClient.createService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateService(); + // [END servicemanagement_v1_generated_ServiceManager_CreateService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_config.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_config.js new file mode 100644 index 00000000000..1cf81c15105 --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_config.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(serviceName, serviceConfig) { + // [START servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the service. See the + * overview (https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + */ + // const serviceName = 'abc123' + /** + * Required. The service configuration resource. + */ + // const serviceConfig = {} + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callCreateServiceConfig() { + // Construct request + const request = { + serviceName, + serviceConfig, + }; + + // Run request + const response = await servicemanagementClient.createServiceConfig(request); + console.log(response); + } + + callCreateServiceConfig(); + // [END servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_rollout.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_rollout.js new file mode 100644 index 00000000000..fe8e14c270e --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_rollout.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(serviceName, rollout) { + // [START servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the service. See the + * overview (https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + */ + // const serviceName = 'abc123' + /** + * Required. The rollout resource. The `service_name` field is output only. + */ + // const rollout = {} + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callCreateServiceRollout() { + // Construct request + const request = { + serviceName, + rollout, + }; + + // Run request + const [operation] = await servicemanagementClient.createServiceRollout(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateServiceRollout(); + // [END servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.delete_service.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.delete_service.js new file mode 100644 index 00000000000..ba386177382 --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.delete_service.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(serviceName) { + // [START servicemanagement_v1_generated_ServiceManager_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. + */ + /** + * Required. The name of the service. See the + * overview (https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + */ + // const serviceName = 'abc123' + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callDeleteService() { + // Construct request + const request = { + serviceName, + }; + + // Run request + const [operation] = await servicemanagementClient.deleteService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteService(); + // [END servicemanagement_v1_generated_ServiceManager_DeleteService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.disable_service.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.disable_service.js new file mode 100644 index 00000000000..35db40174fb --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.disable_service.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(serviceName, consumerId) { + // [START servicemanagement_v1_generated_ServiceManager_DisableService_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the service to disable. Specifying an unknown service name + * will cause the request to fail. + */ + // const serviceName = 'abc123' + /** + * Required. The identity of consumer resource which service disablement will be + * applied to. + * The Google Service Management implementation accepts the following + * forms: + * - "project:" + * Note: this is made compatible with + * google.api.servicecontrol.v1.Operation.consumer_id. + */ + // const consumerId = 'abc123' + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callDisableService() { + // Construct request + const request = { + serviceName, + consumerId, + }; + + // Run request + const [operation] = await servicemanagementClient.disableService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDisableService(); + // [END servicemanagement_v1_generated_ServiceManager_DisableService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.enable_service.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.enable_service.js new file mode 100644 index 00000000000..12e1c92651f --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.enable_service.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(serviceName, consumerId) { + // [START servicemanagement_v1_generated_ServiceManager_EnableService_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the service to enable. Specifying an unknown service name will + * cause the request to fail. + */ + // const serviceName = 'abc123' + /** + * Required. The identity of consumer resource which service enablement will be + * applied to. + * The Google Service Management implementation accepts the following + * forms: + * - "project:" + * Note: this is made compatible with + * google.api.servicecontrol.v1.Operation.consumer_id. + */ + // const consumerId = 'abc123' + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callEnableService() { + // Construct request + const request = { + serviceName, + consumerId, + }; + + // Run request + const [operation] = await servicemanagementClient.enableService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callEnableService(); + // [END servicemanagement_v1_generated_ServiceManager_EnableService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.generate_config_report.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.generate_config_report.js new file mode 100644 index 00000000000..03315096a9c --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.generate_config_report.js @@ -0,0 +1,73 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(newConfig) { + // [START servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Service configuration for which we want to generate the report. + * For this version of API, the supported types are + * google.api.servicemanagement.v1.ConfigRef google.api.servicemanagement.v1.ConfigRef, + * google.api.servicemanagement.v1.ConfigSource google.api.servicemanagement.v1.ConfigSource, + * and google.api.Service google.api.Service + */ + // const newConfig = {} + /** + * Optional. Service configuration against which the comparison will be done. + * For this version of API, the supported types are + * google.api.servicemanagement.v1.ConfigRef google.api.servicemanagement.v1.ConfigRef, + * google.api.servicemanagement.v1.ConfigSource google.api.servicemanagement.v1.ConfigSource, + * and google.api.Service google.api.Service + */ + // const oldConfig = {} + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callGenerateConfigReport() { + // Construct request + const request = { + newConfig, + }; + + // Run request + const response = await servicemanagementClient.generateConfigReport(request); + console.log(response); + } + + callGenerateConfigReport(); + // [END servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service.js new file mode 100644 index 00000000000..25b6670c01e --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service.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(serviceName) { + // [START servicemanagement_v1_generated_ServiceManager_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. + */ + /** + * Required. The name of the service. See the `ServiceManager` overview for + * naming requirements. For example: `example.googleapis.com`. + */ + // const serviceName = 'abc123' + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callGetService() { + // Construct request + const request = { + serviceName, + }; + + // Run request + const response = await servicemanagementClient.getService(request); + console.log(response); + } + + callGetService(); + // [END servicemanagement_v1_generated_ServiceManager_GetService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_config.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_config.js new file mode 100644 index 00000000000..51c0f56c3a8 --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_config.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(serviceName, configId) { + // [START servicemanagement_v1_generated_ServiceManager_GetServiceConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the service. See the + * overview (https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + */ + // const serviceName = 'abc123' + /** + * Required. The id of the service configuration resource. + * This field must be specified for the server to return all fields, including + * `SourceInfo`. + */ + // const configId = 'abc123' + /** + * Specifies which parts of the Service Config should be returned in the + * response. + */ + // const view = {} + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callGetServiceConfig() { + // Construct request + const request = { + serviceName, + configId, + }; + + // Run request + const response = await servicemanagementClient.getServiceConfig(request); + console.log(response); + } + + callGetServiceConfig(); + // [END servicemanagement_v1_generated_ServiceManager_GetServiceConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_rollout.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_rollout.js new file mode 100644 index 00000000000..4c2a17e7a6f --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_rollout.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(serviceName, rolloutId) { + // [START servicemanagement_v1_generated_ServiceManager_GetServiceRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the service. See the + * overview (https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + */ + // const serviceName = 'abc123' + /** + * Required. The id of the rollout resource. + */ + // const rolloutId = 'abc123' + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callGetServiceRollout() { + // Construct request + const request = { + serviceName, + rolloutId, + }; + + // Run request + const response = await servicemanagementClient.getServiceRollout(request); + console.log(response); + } + + callGetServiceRollout(); + // [END servicemanagement_v1_generated_ServiceManager_GetServiceRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_configs.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_configs.js new file mode 100644 index 00000000000..7c3492af58e --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_configs.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(serviceName) { + // [START servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the service. See the + * overview (https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + */ + // const serviceName = 'abc123' + /** + * The token of the page to retrieve. + */ + // const pageToken = 'abc123' + /** + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 100. + */ + // const pageSize = 1234 + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callListServiceConfigs() { + // Construct request + const request = { + serviceName, + }; + + // Run request + const iterable = await servicemanagementClient.listServiceConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListServiceConfigs(); + // [END servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_rollouts.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_rollouts.js new file mode 100644 index 00000000000..0bebade3bbf --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_rollouts.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(serviceName, filter) { + // [START servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the service. See the + * overview (https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + */ + // const serviceName = 'abc123' + /** + * The token of the page to retrieve. + */ + // const pageToken = 'abc123' + /** + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 100. + */ + // const pageSize = 1234 + /** + * Required. Use `filter` to return subset of rollouts. + * The following filters are supported: + * -- To limit the results to only those in + * status (google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', + * use filter='status=SUCCESS' + * -- To limit the results to those in + * status (google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' + * or 'FAILED', use filter='status=CANCELLED OR status=FAILED' + */ + // const filter = 'abc123' + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callListServiceRollouts() { + // Construct request + const request = { + serviceName, + filter, + }; + + // Run request + const iterable = await servicemanagementClient.listServiceRolloutsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListServiceRollouts(); + // [END servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_services.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_services.js new file mode 100644 index 00000000000..3d5e480326a --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_services.js @@ -0,0 +1,79 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START servicemanagement_v1_generated_ServiceManager_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. + */ + /** + * Include services produced by the specified project. + */ + // const producerProjectId = 'abc123' + /** + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 100. + */ + // const pageSize = 1234 + /** + * Token identifying which result to start with; returned by a previous list + * call. + */ + // const pageToken = 'abc123' + /** + * Include services consumed by the specified consumer. + * The Google Service Management implementation accepts the following + * forms: + * - project: + */ + // const consumerId = 'abc123' + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callListServices() { + // Construct request + const request = { + }; + + // Run request + const iterable = await servicemanagementClient.listServicesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListServices(); + // [END servicemanagement_v1_generated_ServiceManager_ListServices_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.submit_config_source.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.submit_config_source.js new file mode 100644 index 00000000000..1cdfda4e0af --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.submit_config_source.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(serviceName, configSource) { + // [START servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the service. See the + * overview (https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + */ + // const serviceName = 'abc123' + /** + * Required. The source configuration for the service. + */ + // const configSource = {} + /** + * Optional. If set, this will result in the generation of a + * `google.api.Service` configuration based on the `ConfigSource` provided, + * but the generated config and the sources will NOT be persisted. + */ + // const validateOnly = true + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callSubmitConfigSource() { + // Construct request + const request = { + serviceName, + configSource, + }; + + // Run request + const [operation] = await servicemanagementClient.submitConfigSource(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSubmitConfigSource(); + // [END servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.undelete_service.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.undelete_service.js new file mode 100644 index 00000000000..559fcf7940e --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.undelete_service.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(serviceName) { + // [START servicemanagement_v1_generated_ServiceManager_UndeleteService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the service. See the + * overview (https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + */ + // const serviceName = 'abc123' + + // Imports the Servicemanagement library + const {ServiceManagerClient} = require('@google-cloud/service-management').v1; + + // Instantiates a client + const servicemanagementClient = new ServiceManagerClient(); + + async function callUndeleteService() { + // Construct request + const request = { + serviceName, + }; + + // Run request + const [operation] = await servicemanagementClient.undeleteService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeleteService(); + // [END servicemanagement_v1_generated_ServiceManager_UndeleteService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-servicemanagement/samples/generated/v1/snippet_metadata.google.api.servicemanagement.v1.json b/packages/google-api-servicemanagement/samples/generated/v1/snippet_metadata.google.api.servicemanagement.v1.json new file mode 100644 index 00000000000..0a1eb792041 --- /dev/null +++ b/packages/google-api-servicemanagement/samples/generated/v1/snippet_metadata.google.api.servicemanagement.v1.json @@ -0,0 +1,599 @@ +{ + "clientLibrary": { + "name": "nodejs-servicemanagement", + "version": "1.1.3", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.api.servicemanagement.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_ListServices_async", + "title": "ServiceManager listServices Sample", + "origin": "API_DEFINITION", + "description": " Lists managed services. Returns all public services. For authenticated users, also returns all services the calling user has \"servicemanagement.services.get\" permission for.", + "canonical": true, + "file": "service_manager.list_services.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListServices", + "fullName": "google.api.servicemanagement.v1.ServiceManager.ListServices", + "async": true, + "parameters": [ + { + "name": "producer_project_id", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "consumer_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.servicemanagement.v1.ListServicesResponse", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "ListServices", + "fullName": "google.api.servicemanagement.v1.ServiceManager.ListServices", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_GetService_async", + "title": "ServiceManager getService Sample", + "origin": "API_DEFINITION", + "description": " Gets a managed service. Authentication is required unless the service is public.", + "canonical": true, + "file": "service_manager.get_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetService", + "fullName": "google.api.servicemanagement.v1.ServiceManager.GetService", + "async": true, + "parameters": [ + { + "name": "service_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.servicemanagement.v1.ManagedService", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "GetService", + "fullName": "google.api.servicemanagement.v1.ServiceManager.GetService", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_CreateService_async", + "title": "ServiceManager createService Sample", + "origin": "API_DEFINITION", + "description": " Creates a new managed service. A managed service is immutable, and is subject to mandatory 30-day data retention. You cannot move a service or recreate it within 30 days after deletion. One producer project can own no more than 500 services. For security and reliability purposes, a production service should be hosted in a dedicated producer project. Operation", + "canonical": true, + "file": "service_manager.create_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateService", + "fullName": "google.api.servicemanagement.v1.ServiceManager.CreateService", + "async": true, + "parameters": [ + { + "name": "service", + "type": ".google.api.servicemanagement.v1.ManagedService" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "CreateService", + "fullName": "google.api.servicemanagement.v1.ServiceManager.CreateService", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_DeleteService_async", + "title": "ServiceManager deleteService Sample", + "origin": "API_DEFINITION", + "description": " Deletes a managed service. This method will change the service to the `Soft-Delete` state for 30 days. Within this period, service producers may call [UndeleteService][google.api.servicemanagement.v1.ServiceManager.UndeleteService] to restore the service. After 30 days, the service will be permanently deleted. Operation", + "canonical": true, + "file": "service_manager.delete_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteService", + "fullName": "google.api.servicemanagement.v1.ServiceManager.DeleteService", + "async": true, + "parameters": [ + { + "name": "service_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "DeleteService", + "fullName": "google.api.servicemanagement.v1.ServiceManager.DeleteService", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_UndeleteService_async", + "title": "ServiceManager undeleteService Sample", + "origin": "API_DEFINITION", + "description": " Revives a previously deleted managed service. The method restores the service using the configuration at the time the service was deleted. The target service must exist and must have been deleted within the last 30 days. Operation", + "canonical": true, + "file": "service_manager.undelete_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeleteService", + "fullName": "google.api.servicemanagement.v1.ServiceManager.UndeleteService", + "async": true, + "parameters": [ + { + "name": "service_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "UndeleteService", + "fullName": "google.api.servicemanagement.v1.ServiceManager.UndeleteService", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_async", + "title": "ServiceManager listServiceConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists the history of the service configuration for a managed service, from the newest to the oldest.", + "canonical": true, + "file": "service_manager.list_service_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListServiceConfigs", + "fullName": "google.api.servicemanagement.v1.ServiceManager.ListServiceConfigs", + "async": true, + "parameters": [ + { + "name": "service_name", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.api.servicemanagement.v1.ListServiceConfigsResponse", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "ListServiceConfigs", + "fullName": "google.api.servicemanagement.v1.ServiceManager.ListServiceConfigs", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_GetServiceConfig_async", + "title": "ServiceManager getServiceConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a service configuration (version) for a managed service.", + "canonical": true, + "file": "service_manager.get_service_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetServiceConfig", + "fullName": "google.api.servicemanagement.v1.ServiceManager.GetServiceConfig", + "async": true, + "parameters": [ + { + "name": "service_name", + "type": "TYPE_STRING" + }, + { + "name": "config_id", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView" + } + ], + "resultType": ".google.api.Service", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "GetServiceConfig", + "fullName": "google.api.servicemanagement.v1.ServiceManager.GetServiceConfig", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_async", + "title": "ServiceManager createServiceConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a new service configuration (version) for a managed service. This method only stores the service configuration. To roll out the service configuration to backend systems please call [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. Only the 100 most recent service configurations and ones referenced by existing rollouts are kept for each service. The rest will be deleted eventually.", + "canonical": true, + "file": "service_manager.create_service_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateServiceConfig", + "fullName": "google.api.servicemanagement.v1.ServiceManager.CreateServiceConfig", + "async": true, + "parameters": [ + { + "name": "service_name", + "type": "TYPE_STRING" + }, + { + "name": "service_config", + "type": ".google.api.Service" + } + ], + "resultType": ".google.api.Service", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "CreateServiceConfig", + "fullName": "google.api.servicemanagement.v1.ServiceManager.CreateServiceConfig", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_async", + "title": "ServiceManager submitConfigSource Sample", + "origin": "API_DEFINITION", + "description": " Creates a new service configuration (version) for a managed service based on user-supplied configuration source files (for example: OpenAPI Specification). This method stores the source configurations as well as the generated service configuration. To rollout the service configuration to other services, please call [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. Only the 100 most recent configuration sources and ones referenced by existing service configurtions are kept for each service. The rest will be deleted eventually. Operation", + "canonical": true, + "file": "service_manager.submit_config_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SubmitConfigSource", + "fullName": "google.api.servicemanagement.v1.ServiceManager.SubmitConfigSource", + "async": true, + "parameters": [ + { + "name": "service_name", + "type": "TYPE_STRING" + }, + { + "name": "config_source", + "type": ".google.api.servicemanagement.v1.ConfigSource" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "SubmitConfigSource", + "fullName": "google.api.servicemanagement.v1.ServiceManager.SubmitConfigSource", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_async", + "title": "ServiceManager listServiceRollouts Sample", + "origin": "API_DEFINITION", + "description": " Lists the history of the service configuration rollouts for a managed service, from the newest to the oldest.", + "canonical": true, + "file": "service_manager.list_service_rollouts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListServiceRollouts", + "fullName": "google.api.servicemanagement.v1.ServiceManager.ListServiceRollouts", + "async": true, + "parameters": [ + { + "name": "service_name", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.servicemanagement.v1.ListServiceRolloutsResponse", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "ListServiceRollouts", + "fullName": "google.api.servicemanagement.v1.ServiceManager.ListServiceRollouts", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_GetServiceRollout_async", + "title": "ServiceManager getServiceRollout Sample", + "origin": "API_DEFINITION", + "description": " Gets a service configuration [rollout][google.api.servicemanagement.v1.Rollout].", + "canonical": true, + "file": "service_manager.get_service_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetServiceRollout", + "fullName": "google.api.servicemanagement.v1.ServiceManager.GetServiceRollout", + "async": true, + "parameters": [ + { + "name": "service_name", + "type": "TYPE_STRING" + }, + { + "name": "rollout_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.servicemanagement.v1.Rollout", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "GetServiceRollout", + "fullName": "google.api.servicemanagement.v1.ServiceManager.GetServiceRollout", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_async", + "title": "ServiceManager createServiceRollout Sample", + "origin": "API_DEFINITION", + "description": " Creates a new service configuration rollout. Based on rollout, the Google Service Management will roll out the service configurations to different backend services. For example, the logging configuration will be pushed to Google Cloud Logging. Please note that any previous pending and running Rollouts and associated Operations will be automatically cancelled so that the latest Rollout will not be blocked by previous Rollouts. Only the 100 most recent (in any state) and the last 10 successful (if not already part of the set of 100 most recent) rollouts are kept for each service. The rest will be deleted eventually. Operation", + "canonical": true, + "file": "service_manager.create_service_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateServiceRollout", + "fullName": "google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout", + "async": true, + "parameters": [ + { + "name": "service_name", + "type": "TYPE_STRING" + }, + { + "name": "rollout", + "type": ".google.api.servicemanagement.v1.Rollout" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "CreateServiceRollout", + "fullName": "google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + }, + { + "regionTag": "servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_async", + "title": "ServiceManager generateConfigReport Sample", + "origin": "API_DEFINITION", + "description": " Generates and returns a report (errors, warnings and changes from existing configurations) associated with GenerateConfigReportRequest.new_value If GenerateConfigReportRequest.old_value is specified, GenerateConfigReportRequest will contain a single ChangeReport based on the comparison between GenerateConfigReportRequest.new_value and GenerateConfigReportRequest.old_value. If GenerateConfigReportRequest.old_value is not specified, this method will compare GenerateConfigReportRequest.new_value with the last pushed service configuration.", + "canonical": true, + "file": "service_manager.generate_config_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateConfigReport", + "fullName": "google.api.servicemanagement.v1.ServiceManager.GenerateConfigReport", + "async": true, + "parameters": [ + { + "name": "new_config", + "type": ".google.protobuf.Any" + }, + { + "name": "old_config", + "type": ".google.protobuf.Any" + } + ], + "resultType": ".google.api.servicemanagement.v1.GenerateConfigReportResponse", + "client": { + "shortName": "ServiceManagerClient", + "fullName": "google.api.servicemanagement.v1.ServiceManagerClient" + }, + "method": { + "shortName": "GenerateConfigReport", + "fullName": "google.api.servicemanagement.v1.ServiceManager.GenerateConfigReport", + "service": { + "shortName": "ServiceManager", + "fullName": "google.api.servicemanagement.v1.ServiceManager" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-api-servicemanagement/samples/package.json b/packages/google-api-servicemanagement/samples/package.json new file mode 100644 index 00000000000..ff42ef08a9a --- /dev/null +++ b/packages/google-api-servicemanagement/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-service-management", + "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/service-management": "^1.1.3" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} \ No newline at end of file diff --git a/packages/google-api-servicemanagement/samples/quickstart.js b/packages/google-api-servicemanagement/samples/quickstart.js new file mode 100644 index 00000000000..cd55c0e12b3 --- /dev/null +++ b/packages/google-api-servicemanagement/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_service_management_quickstart] + + // Imports the Google Cloud client library + const {ServiceManagerClient} = require('@google-cloud/service-management'); + + // TODO(developer): replace with your prefered project ID. + // const projectId = 'my-project' + + // Creates a client + const client = new ServiceManagerClient(); + + async function listServices() { + const [services] = await client.listServices({ + producerProjectId: projectId, + }); + console.info(services); + } + listServices(); + // [END nodejs_service_management_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-api-servicemanagement/samples/test/quickstart.js b/packages/google-api-servicemanagement/samples/test/quickstart.js new file mode 100644 index 00000000000..8980e65bf13 --- /dev/null +++ b/packages/google-api-servicemanagement/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 {ServiceManagerClient} = require('@google-cloud/service-management'); +// 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 ServiceManagerClient(); + +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]*\]/); + }); +}); diff --git a/packages/google-api-servicemanagement/src/index.ts b/packages/google-api-servicemanagement/src/index.ts new file mode 100644 index 00000000000..c49c64c72c4 --- /dev/null +++ b/packages/google-api-servicemanagement/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const ServiceManagerClient = v1.ServiceManagerClient; +type ServiceManagerClient = v1.ServiceManagerClient; + +export {v1, ServiceManagerClient}; +export default {v1, ServiceManagerClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-api-servicemanagement/src/v1/gapic_metadata.json b/packages/google-api-servicemanagement/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..6ff3a512fa1 --- /dev/null +++ b/packages/google-api-servicemanagement/src/v1/gapic_metadata.json @@ -0,0 +1,165 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.api.servicemanagement.v1", + "libraryPackage": "@google-cloud/service-management", + "services": { + "ServiceManager": { + "clients": { + "grpc": { + "libraryClient": "ServiceManagerClient", + "rpcs": { + "GetService": { + "methods": [ + "getService" + ] + }, + "GetServiceConfig": { + "methods": [ + "getServiceConfig" + ] + }, + "CreateServiceConfig": { + "methods": [ + "createServiceConfig" + ] + }, + "GetServiceRollout": { + "methods": [ + "getServiceRollout" + ] + }, + "GenerateConfigReport": { + "methods": [ + "generateConfigReport" + ] + }, + "CreateService": { + "methods": [ + "createService" + ] + }, + "DeleteService": { + "methods": [ + "deleteService" + ] + }, + "UndeleteService": { + "methods": [ + "undeleteService" + ] + }, + "SubmitConfigSource": { + "methods": [ + "submitConfigSource" + ] + }, + "CreateServiceRollout": { + "methods": [ + "createServiceRollout" + ] + }, + "ListServices": { + "methods": [ + "listServices", + "listServicesStream", + "listServicesAsync" + ] + }, + "ListServiceConfigs": { + "methods": [ + "listServiceConfigs", + "listServiceConfigsStream", + "listServiceConfigsAsync" + ] + }, + "ListServiceRollouts": { + "methods": [ + "listServiceRollouts", + "listServiceRolloutsStream", + "listServiceRolloutsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ServiceManagerClient", + "rpcs": { + "GetService": { + "methods": [ + "getService" + ] + }, + "GetServiceConfig": { + "methods": [ + "getServiceConfig" + ] + }, + "CreateServiceConfig": { + "methods": [ + "createServiceConfig" + ] + }, + "GetServiceRollout": { + "methods": [ + "getServiceRollout" + ] + }, + "GenerateConfigReport": { + "methods": [ + "generateConfigReport" + ] + }, + "CreateService": { + "methods": [ + "createService" + ] + }, + "DeleteService": { + "methods": [ + "deleteService" + ] + }, + "UndeleteService": { + "methods": [ + "undeleteService" + ] + }, + "SubmitConfigSource": { + "methods": [ + "submitConfigSource" + ] + }, + "CreateServiceRollout": { + "methods": [ + "createServiceRollout" + ] + }, + "ListServices": { + "methods": [ + "listServices", + "listServicesStream", + "listServicesAsync" + ] + }, + "ListServiceConfigs": { + "methods": [ + "listServiceConfigs", + "listServiceConfigsStream", + "listServiceConfigsAsync" + ] + }, + "ListServiceRollouts": { + "methods": [ + "listServiceRollouts", + "listServiceRolloutsStream", + "listServiceRolloutsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-api-servicemanagement/src/v1/index.ts b/packages/google-api-servicemanagement/src/v1/index.ts new file mode 100644 index 00000000000..fa343c94e89 --- /dev/null +++ b/packages/google-api-servicemanagement/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {ServiceManagerClient} from './service_manager_client'; diff --git a/packages/google-api-servicemanagement/src/v1/service_manager_client.ts b/packages/google-api-servicemanagement/src/v1/service_manager_client.ts new file mode 100644 index 00000000000..b9022e2c0d8 --- /dev/null +++ b/packages/google-api-servicemanagement/src/v1/service_manager_client.ts @@ -0,0 +1,2387 @@ +// 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/service_manager_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './service_manager_client_config.json'; +const version = require('../../../package.json').version; + +/** + * [Google Service Management + * API](https://cloud.google.com/service-infrastructure/docs/overview) + * @class + * @memberof v1 + */ +export class ServiceManagerClient { + 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}; + operationsClient: gax.OperationsClient; + serviceManagerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ServiceManagerClient. + * + * @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 ServiceManagerClient({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 ServiceManagerClient; + 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); + + // 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' + ), + listServiceConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'serviceConfigs' + ), + listServiceRollouts: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'rollouts' + ), + }; + + 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.iam.v1.IAMPolicy.GetIamPolicy', + post: '/v1/{resource=services/*}:getIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=services/*/consumers/*}:getIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=services/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=services/*/consumers/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=services/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=services/*/consumers/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createServiceResponse = protoFilesRoot.lookup( + '.google.api.servicemanagement.v1.ManagedService' + ) as gax.protobuf.Type; + const createServiceMetadata = protoFilesRoot.lookup( + '.google.api.servicemanagement.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteServiceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteServiceMetadata = protoFilesRoot.lookup( + '.google.api.servicemanagement.v1.OperationMetadata' + ) as gax.protobuf.Type; + const undeleteServiceResponse = protoFilesRoot.lookup( + '.google.api.servicemanagement.v1.UndeleteServiceResponse' + ) as gax.protobuf.Type; + const undeleteServiceMetadata = protoFilesRoot.lookup( + '.google.api.servicemanagement.v1.OperationMetadata' + ) as gax.protobuf.Type; + const submitConfigSourceResponse = protoFilesRoot.lookup( + '.google.api.servicemanagement.v1.SubmitConfigSourceResponse' + ) as gax.protobuf.Type; + const submitConfigSourceMetadata = protoFilesRoot.lookup( + '.google.api.servicemanagement.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createServiceRolloutResponse = protoFilesRoot.lookup( + '.google.api.servicemanagement.v1.Rollout' + ) as gax.protobuf.Type; + const createServiceRolloutMetadata = protoFilesRoot.lookup( + '.google.api.servicemanagement.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createService: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createServiceResponse.decode.bind(createServiceResponse), + createServiceMetadata.decode.bind(createServiceMetadata) + ), + deleteService: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteServiceResponse.decode.bind(deleteServiceResponse), + deleteServiceMetadata.decode.bind(deleteServiceMetadata) + ), + undeleteService: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeleteServiceResponse.decode.bind(undeleteServiceResponse), + undeleteServiceMetadata.decode.bind(undeleteServiceMetadata) + ), + submitConfigSource: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + submitConfigSourceResponse.decode.bind(submitConfigSourceResponse), + submitConfigSourceMetadata.decode.bind(submitConfigSourceMetadata) + ), + createServiceRollout: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createServiceRolloutResponse.decode.bind(createServiceRolloutResponse), + createServiceRolloutMetadata.decode.bind(createServiceRolloutMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.api.servicemanagement.v1.ServiceManager', + 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.serviceManagerStub) { + return this.serviceManagerStub; + } + + // Put together the "service stub" for + // google.api.servicemanagement.v1.ServiceManager. + this.serviceManagerStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.api.servicemanagement.v1.ServiceManager' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.api.servicemanagement.v1.ServiceManager, + 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 serviceManagerStubMethods = [ + 'listServices', + 'getService', + 'createService', + 'deleteService', + 'undeleteService', + 'listServiceConfigs', + 'getServiceConfig', + 'createServiceConfig', + 'submitConfigSource', + 'listServiceRollouts', + 'getServiceRollout', + 'createServiceRollout', + 'generateConfigReport', + ]; + for (const methodName of serviceManagerStubMethods) { + const callPromise = this.serviceManagerStub.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.serviceManagerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'servicemanagement.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 'servicemanagement.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + 'https://www.googleapis.com/auth/service.management', + 'https://www.googleapis.com/auth/service.management.readonly', + ]; + } + + 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 a managed service. Authentication is required unless the service is + * public. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.serviceName + * Required. The name of the service. See the `ServiceManager` overview for + * naming requirements. For example: `example.googleapis.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 [ManagedService]{@link google.api.servicemanagement.v1.ManagedService}. + * 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/service_manager.get_service.js + * region_tag:servicemanagement_v1_generated_ServiceManager_GetService_async + */ + getService( + request?: protos.google.api.servicemanagement.v1.IGetServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IGetServiceRequest | undefined, + {} | undefined + ] + >; + getService( + request: protos.google.api.servicemanagement.v1.IGetServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.api.servicemanagement.v1.IManagedService, + | protos.google.api.servicemanagement.v1.IGetServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getService( + request: protos.google.api.servicemanagement.v1.IGetServiceRequest, + callback: Callback< + protos.google.api.servicemanagement.v1.IManagedService, + | protos.google.api.servicemanagement.v1.IGetServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getService( + request?: protos.google.api.servicemanagement.v1.IGetServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.servicemanagement.v1.IManagedService, + | protos.google.api.servicemanagement.v1.IGetServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.servicemanagement.v1.IManagedService, + | protos.google.api.servicemanagement.v1.IGetServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.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({ + service_name: request.serviceName ?? '', + }); + this.initialize(); + return this.innerApiCalls.getService(request, options, callback); + } + /** + * Gets a service configuration (version) for a managed service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + * @param {string} request.configId + * Required. The id of the service configuration resource. + * + * This field must be specified for the server to return all fields, including + * `SourceInfo`. + * @param {google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView} request.view + * Specifies which parts of the Service Config should be returned in the + * 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 [Service]{@link google.api.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/service_manager.get_service_config.js + * region_tag:servicemanagement_v1_generated_ServiceManager_GetServiceConfig_async + */ + getServiceConfig( + request?: protos.google.api.servicemanagement.v1.IGetServiceConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.IService, + ( + | protos.google.api.servicemanagement.v1.IGetServiceConfigRequest + | undefined + ), + {} | undefined + ] + >; + getServiceConfig( + request: protos.google.api.servicemanagement.v1.IGetServiceConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.api.IService, + | protos.google.api.servicemanagement.v1.IGetServiceConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getServiceConfig( + request: protos.google.api.servicemanagement.v1.IGetServiceConfigRequest, + callback: Callback< + protos.google.api.IService, + | protos.google.api.servicemanagement.v1.IGetServiceConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getServiceConfig( + request?: protos.google.api.servicemanagement.v1.IGetServiceConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IService, + | protos.google.api.servicemanagement.v1.IGetServiceConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IService, + | protos.google.api.servicemanagement.v1.IGetServiceConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IService, + ( + | protos.google.api.servicemanagement.v1.IGetServiceConfigRequest + | 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({ + service_name: request.serviceName ?? '', + config_id: request.configId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getServiceConfig(request, options, callback); + } + /** + * Creates a new service configuration (version) for a managed service. + * This method only stores the service configuration. To roll out the service + * configuration to backend systems please call + * {@link google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout|CreateServiceRollout}. + * + * Only the 100 most recent service configurations and ones referenced by + * existing rollouts are kept for each service. The rest will be deleted + * eventually. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + * @param {google.api.Service} request.serviceConfig + * Required. The service configuration resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Service]{@link google.api.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/service_manager.create_service_config.js + * region_tag:servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_async + */ + createServiceConfig( + request?: protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.IService, + ( + | protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest + | undefined + ), + {} | undefined + ] + >; + createServiceConfig( + request: protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.api.IService, + | protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createServiceConfig( + request: protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest, + callback: Callback< + protos.google.api.IService, + | protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createServiceConfig( + request?: protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IService, + | protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IService, + | protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IService, + ( + | protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest + | 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({ + service_name: request.serviceName ?? '', + }); + this.initialize(); + return this.innerApiCalls.createServiceConfig(request, options, callback); + } + /** + * Gets a service configuration + * {@link google.api.servicemanagement.v1.Rollout|rollout}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + * @param {string} request.rolloutId + * Required. The id of the rollout resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Rollout]{@link google.api.servicemanagement.v1.Rollout}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/service_manager.get_service_rollout.js + * region_tag:servicemanagement_v1_generated_ServiceManager_GetServiceRollout_async + */ + getServiceRollout( + request?: protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.servicemanagement.v1.IRollout, + ( + | protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest + | undefined + ), + {} | undefined + ] + >; + getServiceRollout( + request: protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest, + options: CallOptions, + callback: Callback< + protos.google.api.servicemanagement.v1.IRollout, + | protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getServiceRollout( + request: protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest, + callback: Callback< + protos.google.api.servicemanagement.v1.IRollout, + | protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getServiceRollout( + request?: protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.servicemanagement.v1.IRollout, + | protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.servicemanagement.v1.IRollout, + | protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.servicemanagement.v1.IRollout, + ( + | protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest + | 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({ + service_name: request.serviceName ?? '', + rollout_id: request.rolloutId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getServiceRollout(request, options, callback); + } + /** + * Generates and returns a report (errors, warnings and changes from + * existing configurations) associated with + * GenerateConfigReportRequest.new_value + * + * If GenerateConfigReportRequest.old_value is specified, + * GenerateConfigReportRequest will contain a single ChangeReport based on the + * comparison between GenerateConfigReportRequest.new_value and + * GenerateConfigReportRequest.old_value. + * If GenerateConfigReportRequest.old_value is not specified, this method + * will compare GenerateConfigReportRequest.new_value with the last pushed + * service configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.Any} request.newConfig + * Required. Service configuration for which we want to generate the report. + * For this version of API, the supported types are + * {@link google.api.servicemanagement.v1.ConfigRef|google.api.servicemanagement.v1.ConfigRef}, + * {@link google.api.servicemanagement.v1.ConfigSource|google.api.servicemanagement.v1.ConfigSource}, + * and {@link google.api.Service|google.api.Service} + * @param {google.protobuf.Any} [request.oldConfig] + * Optional. Service configuration against which the comparison will be done. + * For this version of API, the supported types are + * {@link google.api.servicemanagement.v1.ConfigRef|google.api.servicemanagement.v1.ConfigRef}, + * {@link google.api.servicemanagement.v1.ConfigSource|google.api.servicemanagement.v1.ConfigSource}, + * and {@link google.api.Service|google.api.Service} + * @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 [GenerateConfigReportResponse]{@link google.api.servicemanagement.v1.GenerateConfigReportResponse}. + * 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/service_manager.generate_config_report.js + * region_tag:servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_async + */ + generateConfigReport( + request?: protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, + ( + | protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest + | undefined + ), + {} | undefined + ] + >; + generateConfigReport( + request: protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest, + options: CallOptions, + callback: Callback< + protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, + | protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateConfigReport( + request: protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest, + callback: Callback< + protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, + | protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateConfigReport( + request?: protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, + | protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, + | protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, + ( + | protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest + | 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.generateConfigReport(request, options, callback); + } + + /** + * Creates a new managed service. + * + * A managed service is immutable, and is subject to mandatory 30-day + * data retention. You cannot move a service or recreate it within 30 days + * after deletion. + * + * One producer project can own no more than 500 services. For security and + * reliability purposes, a production service should be hosted in a + * dedicated producer project. + * + * Operation + * + * @param {Object} request + * The request object that will be sent. + * @param {google.api.servicemanagement.v1.ManagedService} request.service + * Required. Initial values for the service resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/service_manager.create_service.js + * region_tag:servicemanagement_v1_generated_ServiceManager_CreateService_async + */ + createService( + request?: protos.google.api.servicemanagement.v1.ICreateServiceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createService( + request: protos.google.api.servicemanagement.v1.ICreateServiceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createService( + request: protos.google.api.servicemanagement.v1.ICreateServiceRequest, + callback: Callback< + LROperation< + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createService( + request?: protos.google.api.servicemanagement.v1.ICreateServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.createService(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createService()`. + * @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/service_manager.create_service.js + * region_tag:servicemanagement_v1_generated_ServiceManager_CreateService_async + */ + async checkCreateServiceProgress( + name: string + ): Promise< + LROperation< + protos.google.api.servicemanagement.v1.ManagedService, + protos.google.api.servicemanagement.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createService, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.api.servicemanagement.v1.ManagedService, + protos.google.api.servicemanagement.v1.OperationMetadata + >; + } + /** + * Deletes a managed service. This method will change the service to the + * `Soft-Delete` state for 30 days. Within this period, service producers may + * call + * {@link google.api.servicemanagement.v1.ServiceManager.UndeleteService|UndeleteService} + * to restore the service. After 30 days, the service will be permanently + * deleted. + * + * Operation + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.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/service_manager.delete_service.js + * region_tag:servicemanagement_v1_generated_ServiceManager_DeleteService_async + */ + deleteService( + request?: protos.google.api.servicemanagement.v1.IDeleteServiceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteService( + request: protos.google.api.servicemanagement.v1.IDeleteServiceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteService( + request: protos.google.api.servicemanagement.v1.IDeleteServiceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteService( + request?: protos.google.api.servicemanagement.v1.IDeleteServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + service_name: request.serviceName ?? '', + }); + 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/service_manager.delete_service.js + * region_tag:servicemanagement_v1_generated_ServiceManager_DeleteService_async + */ + async checkDeleteServiceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.api.servicemanagement.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteService, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.api.servicemanagement.v1.OperationMetadata + >; + } + /** + * Revives a previously deleted managed service. The method restores the + * service using the configuration at the time the service was deleted. + * The target service must exist and must have been deleted within the + * last 30 days. + * + * Operation + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.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/service_manager.undelete_service.js + * region_tag:servicemanagement_v1_generated_ServiceManager_UndeleteService_async + */ + undeleteService( + request?: protos.google.api.servicemanagement.v1.IUndeleteServiceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + undeleteService( + request: protos.google.api.servicemanagement.v1.IUndeleteServiceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeleteService( + request: protos.google.api.servicemanagement.v1.IUndeleteServiceRequest, + callback: Callback< + LROperation< + protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeleteService( + request?: protos.google.api.servicemanagement.v1.IUndeleteServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + service_name: request.serviceName ?? '', + }); + this.initialize(); + return this.innerApiCalls.undeleteService(request, options, callback); + } + /** + * Check the status of the long running operation returned by `undeleteService()`. + * @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/service_manager.undelete_service.js + * region_tag:servicemanagement_v1_generated_ServiceManager_UndeleteService_async + */ + async checkUndeleteServiceProgress( + name: string + ): Promise< + LROperation< + protos.google.api.servicemanagement.v1.UndeleteServiceResponse, + protos.google.api.servicemanagement.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.undeleteService, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.api.servicemanagement.v1.UndeleteServiceResponse, + protos.google.api.servicemanagement.v1.OperationMetadata + >; + } + /** + * Creates a new service configuration (version) for a managed service based + * on + * user-supplied configuration source files (for example: OpenAPI + * Specification). This method stores the source configurations as well as the + * generated service configuration. To rollout the service configuration to + * other services, + * please call + * {@link google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout|CreateServiceRollout}. + * + * Only the 100 most recent configuration sources and ones referenced by + * existing service configurtions are kept for each service. The rest will be + * deleted eventually. + * + * Operation + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + * @param {google.api.servicemanagement.v1.ConfigSource} request.configSource + * Required. The source configuration for the service. + * @param {boolean} [request.validateOnly] + * Optional. If set, this will result in the generation of a + * `google.api.Service` configuration based on the `ConfigSource` provided, + * but the generated config and the sources will NOT be persisted. + * @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/service_manager.submit_config_source.js + * region_tag:servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_async + */ + submitConfigSource( + request?: protos.google.api.servicemanagement.v1.ISubmitConfigSourceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + submitConfigSource( + request: protos.google.api.servicemanagement.v1.ISubmitConfigSourceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + submitConfigSource( + request: protos.google.api.servicemanagement.v1.ISubmitConfigSourceRequest, + callback: Callback< + LROperation< + protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + submitConfigSource( + request?: protos.google.api.servicemanagement.v1.ISubmitConfigSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + service_name: request.serviceName ?? '', + }); + this.initialize(); + return this.innerApiCalls.submitConfigSource(request, options, callback); + } + /** + * Check the status of the long running operation returned by `submitConfigSource()`. + * @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/service_manager.submit_config_source.js + * region_tag:servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_async + */ + async checkSubmitConfigSourceProgress( + name: string + ): Promise< + LROperation< + protos.google.api.servicemanagement.v1.SubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.submitConfigSource, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.api.servicemanagement.v1.SubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.OperationMetadata + >; + } + /** + * Creates a new service configuration rollout. Based on rollout, the + * Google Service Management will roll out the service configurations to + * different backend services. For example, the logging configuration will be + * pushed to Google Cloud Logging. + * + * Please note that any previous pending and running Rollouts and associated + * Operations will be automatically cancelled so that the latest Rollout will + * not be blocked by previous Rollouts. + * + * Only the 100 most recent (in any state) and the last 10 successful (if not + * already part of the set of 100 most recent) rollouts are kept for each + * service. The rest will be deleted eventually. + * + * Operation + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + * @param {google.api.servicemanagement.v1.Rollout} request.rollout + * Required. The rollout resource. The `service_name` field is output only. + * @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/service_manager.create_service_rollout.js + * region_tag:servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_async + */ + createServiceRollout( + request?: protos.google.api.servicemanagement.v1.ICreateServiceRolloutRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.api.servicemanagement.v1.IRollout, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createServiceRollout( + request: protos.google.api.servicemanagement.v1.ICreateServiceRolloutRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.api.servicemanagement.v1.IRollout, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createServiceRollout( + request: protos.google.api.servicemanagement.v1.ICreateServiceRolloutRequest, + callback: Callback< + LROperation< + protos.google.api.servicemanagement.v1.IRollout, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createServiceRollout( + request?: protos.google.api.servicemanagement.v1.ICreateServiceRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.api.servicemanagement.v1.IRollout, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.api.servicemanagement.v1.IRollout, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.api.servicemanagement.v1.IRollout, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + service_name: request.serviceName ?? '', + }); + this.initialize(); + return this.innerApiCalls.createServiceRollout(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createServiceRollout()`. + * @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/service_manager.create_service_rollout.js + * region_tag:servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_async + */ + async checkCreateServiceRolloutProgress( + name: string + ): Promise< + LROperation< + protos.google.api.servicemanagement.v1.Rollout, + protos.google.api.servicemanagement.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createServiceRollout, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.api.servicemanagement.v1.Rollout, + protos.google.api.servicemanagement.v1.OperationMetadata + >; + } + /** + * Lists managed services. + * + * Returns all public services. For authenticated users, also returns all + * services the calling user has "servicemanagement.services.get" permission + * for. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.producerProjectId + * Include services produced by the specified project. + * @param {number} request.pageSize + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 100. + * @param {string} request.pageToken + * Token identifying which result to start with; returned by a previous list + * call. + * @param {string} request.consumerId + * Include services consumed by the specified consumer. + * + * The Google Service Management implementation accepts the following + * forms: + * - project: + * @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 [ManagedService]{@link google.api.servicemanagement.v1.ManagedService}. + * 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.api.servicemanagement.v1.IListServicesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.servicemanagement.v1.IManagedService[], + protos.google.api.servicemanagement.v1.IListServicesRequest | null, + protos.google.api.servicemanagement.v1.IListServicesResponse + ] + >; + listServices( + request: protos.google.api.servicemanagement.v1.IListServicesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.api.servicemanagement.v1.IListServicesRequest, + | protos.google.api.servicemanagement.v1.IListServicesResponse + | null + | undefined, + protos.google.api.servicemanagement.v1.IManagedService + > + ): void; + listServices( + request: protos.google.api.servicemanagement.v1.IListServicesRequest, + callback: PaginationCallback< + protos.google.api.servicemanagement.v1.IListServicesRequest, + | protos.google.api.servicemanagement.v1.IListServicesResponse + | null + | undefined, + protos.google.api.servicemanagement.v1.IManagedService + > + ): void; + listServices( + request?: protos.google.api.servicemanagement.v1.IListServicesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.api.servicemanagement.v1.IListServicesRequest, + | protos.google.api.servicemanagement.v1.IListServicesResponse + | null + | undefined, + protos.google.api.servicemanagement.v1.IManagedService + >, + callback?: PaginationCallback< + protos.google.api.servicemanagement.v1.IListServicesRequest, + | protos.google.api.servicemanagement.v1.IListServicesResponse + | null + | undefined, + protos.google.api.servicemanagement.v1.IManagedService + > + ): Promise< + [ + protos.google.api.servicemanagement.v1.IManagedService[], + protos.google.api.servicemanagement.v1.IListServicesRequest | null, + protos.google.api.servicemanagement.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 || {}; + 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.producerProjectId + * Include services produced by the specified project. + * @param {number} request.pageSize + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 100. + * @param {string} request.pageToken + * Token identifying which result to start with; returned by a previous list + * call. + * @param {string} request.consumerId + * Include services consumed by the specified consumer. + * + * The Google Service Management implementation accepts the following + * forms: + * - project: + * @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 [ManagedService]{@link google.api.servicemanagement.v1.ManagedService} 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.api.servicemanagement.v1.IListServicesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + 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.producerProjectId + * Include services produced by the specified project. + * @param {number} request.pageSize + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 100. + * @param {string} request.pageToken + * Token identifying which result to start with; returned by a previous list + * call. + * @param {string} request.consumerId + * Include services consumed by the specified consumer. + * + * The Google Service Management implementation accepts the following + * forms: + * - project: + * @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 + * [ManagedService]{@link google.api.servicemanagement.v1.ManagedService}. 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/service_manager.list_services.js + * region_tag:servicemanagement_v1_generated_ServiceManager_ListServices_async + */ + listServicesAsync( + request?: protos.google.api.servicemanagement.v1.IListServicesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + 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; + } + /** + * Lists the history of the service configuration for a managed service, + * from the newest to the oldest. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + * @param {string} request.pageToken + * The token of the page to retrieve. + * @param {number} request.pageSize + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 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 Array of [Service]{@link google.api.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 `listServiceConfigsAsync()` + * 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. + */ + listServiceConfigs( + request?: protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.IService[], + protos.google.api.servicemanagement.v1.IListServiceConfigsRequest | null, + protos.google.api.servicemanagement.v1.IListServiceConfigsResponse + ] + >; + listServiceConfigs( + request: protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, + | protos.google.api.servicemanagement.v1.IListServiceConfigsResponse + | null + | undefined, + protos.google.api.IService + > + ): void; + listServiceConfigs( + request: protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, + callback: PaginationCallback< + protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, + | protos.google.api.servicemanagement.v1.IListServiceConfigsResponse + | null + | undefined, + protos.google.api.IService + > + ): void; + listServiceConfigs( + request?: protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, + | protos.google.api.servicemanagement.v1.IListServiceConfigsResponse + | null + | undefined, + protos.google.api.IService + >, + callback?: PaginationCallback< + protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, + | protos.google.api.servicemanagement.v1.IListServiceConfigsResponse + | null + | undefined, + protos.google.api.IService + > + ): Promise< + [ + protos.google.api.IService[], + protos.google.api.servicemanagement.v1.IListServiceConfigsRequest | null, + protos.google.api.servicemanagement.v1.IListServiceConfigsResponse + ] + > | 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({ + service_name: request.serviceName ?? '', + }); + this.initialize(); + return this.innerApiCalls.listServiceConfigs(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.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + * @param {string} request.pageToken + * The token of the page to retrieve. + * @param {number} request.pageSize + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 100. + * @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.api.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 `listServiceConfigsAsync()` + * 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. + */ + listServiceConfigsStream( + request?: protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, + 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({ + service_name: request.serviceName ?? '', + }); + const defaultCallSettings = this._defaults['listServiceConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listServiceConfigs.createStream( + this.innerApiCalls.listServiceConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listServiceConfigs`, 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.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + * @param {string} request.pageToken + * The token of the page to retrieve. + * @param {number} request.pageSize + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 100. + * @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.api.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/service_manager.list_service_configs.js + * region_tag:servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_async + */ + listServiceConfigsAsync( + request?: protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, + 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({ + service_name: request.serviceName ?? '', + }); + const defaultCallSettings = this._defaults['listServiceConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listServiceConfigs.asyncIterate( + this.innerApiCalls['listServiceConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the history of the service configuration rollouts for a managed + * service, from the newest to the oldest. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + * @param {string} request.pageToken + * The token of the page to retrieve. + * @param {number} request.pageSize + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 100. + * @param {string} request.filter + * Required. Use `filter` to return subset of rollouts. + * The following filters are supported: + * -- To limit the results to only those in + * status (google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', + * use filter='status=SUCCESS' + * -- To limit the results to those in + * status (google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' + * or 'FAILED', use filter='status=CANCELLED OR status=FAILED' + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Rollout]{@link google.api.servicemanagement.v1.Rollout}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listServiceRolloutsAsync()` + * 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. + */ + listServiceRollouts( + request?: protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.servicemanagement.v1.IRollout[], + protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest | null, + protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse + ] + >; + listServiceRollouts( + request: protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, + | protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse + | null + | undefined, + protos.google.api.servicemanagement.v1.IRollout + > + ): void; + listServiceRollouts( + request: protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, + callback: PaginationCallback< + protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, + | protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse + | null + | undefined, + protos.google.api.servicemanagement.v1.IRollout + > + ): void; + listServiceRollouts( + request?: protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, + | protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse + | null + | undefined, + protos.google.api.servicemanagement.v1.IRollout + >, + callback?: PaginationCallback< + protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, + | protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse + | null + | undefined, + protos.google.api.servicemanagement.v1.IRollout + > + ): Promise< + [ + protos.google.api.servicemanagement.v1.IRollout[], + protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest | null, + protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse + ] + > | 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({ + service_name: request.serviceName ?? '', + }); + this.initialize(); + return this.innerApiCalls.listServiceRollouts(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.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + * @param {string} request.pageToken + * The token of the page to retrieve. + * @param {number} request.pageSize + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 100. + * @param {string} request.filter + * Required. Use `filter` to return subset of rollouts. + * The following filters are supported: + * -- To limit the results to only those in + * status (google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', + * use filter='status=SUCCESS' + * -- To limit the results to those in + * status (google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' + * or 'FAILED', use filter='status=CANCELLED OR status=FAILED' + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Rollout]{@link google.api.servicemanagement.v1.Rollout} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listServiceRolloutsAsync()` + * 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. + */ + listServiceRolloutsStream( + request?: protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, + 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({ + service_name: request.serviceName ?? '', + }); + const defaultCallSettings = this._defaults['listServiceRollouts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listServiceRollouts.createStream( + this.innerApiCalls.listServiceRollouts as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listServiceRollouts`, 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.serviceName + * Required. The name of the service. See the + * [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For + * example: `example.googleapis.com`. + * @param {string} request.pageToken + * The token of the page to retrieve. + * @param {number} request.pageSize + * The max number of items to include in the response list. Page size is 50 + * if not specified. Maximum value is 100. + * @param {string} request.filter + * Required. Use `filter` to return subset of rollouts. + * The following filters are supported: + * -- To limit the results to only those in + * status (google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', + * use filter='status=SUCCESS' + * -- To limit the results to those in + * status (google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' + * or 'FAILED', use filter='status=CANCELLED OR status=FAILED' + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Rollout]{@link google.api.servicemanagement.v1.Rollout}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/service_manager.list_service_rollouts.js + * region_tag:servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_async + */ + listServiceRolloutsAsync( + request?: protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, + 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({ + service_name: request.serviceName ?? '', + }); + const defaultCallSettings = this._defaults['listServiceRollouts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listServiceRollouts.asyncIterate( + this.innerApiCalls['listServiceRollouts'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + + /** + * 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.serviceManagerStub && !this._terminated) { + return this.serviceManagerStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-api-servicemanagement/src/v1/service_manager_client_config.json b/packages/google-api-servicemanagement/src/v1/service_manager_client_config.json new file mode 100644 index 00000000000..83bc47568b7 --- /dev/null +++ b/packages/google-api-servicemanagement/src/v1/service_manager_client_config.json @@ -0,0 +1,91 @@ +{ + "interfaces": { + "google.api.servicemanagement.v1.ServiceManager": { + "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": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetService": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateService": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteService": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeleteService": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListServiceConfigs": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetServiceConfig": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateServiceConfig": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SubmitConfigSource": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListServiceRollouts": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetServiceRollout": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateServiceRollout": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateConfigReport": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-api-servicemanagement/src/v1/service_manager_proto_list.json b/packages/google-api-servicemanagement/src/v1/service_manager_proto_list.json new file mode 100644 index 00000000000..205a739ef94 --- /dev/null +++ b/packages/google-api-servicemanagement/src/v1/service_manager_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/api/servicemanagement/v1/resources.proto", + "../../protos/google/api/servicemanagement/v1/servicemanager.proto" +] diff --git a/packages/google-api-servicemanagement/synth.metadata b/packages/google-api-servicemanagement/synth.metadata new file mode 100644 index 00000000000..78188c1885c --- /dev/null +++ b/packages/google-api-servicemanagement/synth.metadata @@ -0,0 +1,37 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-service-management.git", + "sha": "e679ea9d735b9edd25913b990e3a0d037025c984" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "6fa858c6489b1bbc505a7d7afe39f2dc45819c38", + "internalRef": "372656503" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "b891fb474173f810051a7fdb0d66915e0a9bc82f" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "servicemanagement", + "apiVersion": "v1", + "language": "nodejs", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.js b/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..f8ba014bf8f --- /dev/null +++ b/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const servicemanagement = require('@google-cloud/service-management'); + +function main() { + const serviceManagerClient = new servicemanagement.ServiceManagerClient(); +} + +main(); diff --git a/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.ts b/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..4ede399e2ae --- /dev/null +++ b/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {ServiceManagerClient} from '@google-cloud/service-management'; + +// check that the client class type name can be used +function doStuffWithServiceManagerClient(client: ServiceManagerClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const serviceManagerClient = new ServiceManagerClient(); + doStuffWithServiceManagerClient(serviceManagerClient); +} + +main(); diff --git a/packages/google-api-servicemanagement/system-test/install.ts b/packages/google-api-servicemanagement/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-api-servicemanagement/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-api-servicemanagement/test/gapic_service_manager_v1.ts b/packages/google-api-servicemanagement/test/gapic_service_manager_v1.ts new file mode 100644 index 00000000000..f189fd5b553 --- /dev/null +++ b/packages/google-api-servicemanagement/test/gapic_service_manager_v1.ts @@ -0,0 +1,2675 @@ +// 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 servicemanagerModule 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.ServiceManagerClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + servicemanagerModule.v1.ServiceManagerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + servicemanagerModule.v1.ServiceManagerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = servicemanagerModule.v1.ServiceManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new servicemanagerModule.v1.ServiceManagerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.serviceManagerStub, undefined); + await client.initialize(); + assert(client.serviceManagerStub); + }); + + it('has close method for the initialized client', done => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.serviceManagerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.serviceManagerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new servicemanagerModule.v1.ServiceManagerClient({ + 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 servicemanagerModule.v1.ServiceManagerClient({ + 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 servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ); + 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 servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ); + client.innerApiCalls.getService = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getService( + request, + ( + err?: Error | null, + result?: protos.google.api.servicemanagement.v1.IManagedService | 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 servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_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 servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getService(request), expectedError); + }); + }); + + describe('getServiceConfig', () => { + it('invokes getServiceConfig without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceConfigRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceConfigRequest', + ['configId'] + ); + request.configId = defaultValue2; + const expectedHeaderRequestParams = `service_name=${defaultValue1}&config_id=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.Service() + ); + client.innerApiCalls.getServiceConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getServiceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getServiceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceConfig without error using callback', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceConfigRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceConfigRequest', + ['configId'] + ); + request.configId = defaultValue2; + const expectedHeaderRequestParams = `service_name=${defaultValue1}&config_id=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.Service() + ); + client.innerApiCalls.getServiceConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getServiceConfig( + request, + (err?: Error | null, result?: protos.google.api.IService | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getServiceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceConfig with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceConfigRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceConfigRequest', + ['configId'] + ); + request.configId = defaultValue2; + const expectedHeaderRequestParams = `service_name=${defaultValue1}&config_id=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getServiceConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getServiceConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getServiceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceConfig with closed client', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceConfigRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceConfigRequest', + ['configId'] + ); + request.configId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getServiceConfig(request), expectedError); + }); + }); + + describe('createServiceConfig', () => { + it('invokes createServiceConfig without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.CreateServiceConfigRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.Service() + ); + client.innerApiCalls.createServiceConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.createServiceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createServiceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createServiceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createServiceConfig without error using callback', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.CreateServiceConfigRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.Service() + ); + client.innerApiCalls.createServiceConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createServiceConfig( + request, + (err?: Error | null, result?: protos.google.api.IService | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createServiceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createServiceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createServiceConfig with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.CreateServiceConfigRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createServiceConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createServiceConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createServiceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createServiceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createServiceConfig with closed client', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.CreateServiceConfigRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createServiceConfig(request), expectedError); + }); + }); + + describe('getServiceRollout', () => { + it('invokes getServiceRollout without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRolloutRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRolloutRequest', + ['rolloutId'] + ); + request.rolloutId = defaultValue2; + const expectedHeaderRequestParams = `service_name=${defaultValue1}&rollout_id=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ); + client.innerApiCalls.getServiceRollout = stubSimpleCall(expectedResponse); + const [response] = await client.getServiceRollout(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getServiceRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceRollout without error using callback', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRolloutRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRolloutRequest', + ['rolloutId'] + ); + request.rolloutId = defaultValue2; + const expectedHeaderRequestParams = `service_name=${defaultValue1}&rollout_id=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ); + client.innerApiCalls.getServiceRollout = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getServiceRollout( + request, + ( + err?: Error | null, + result?: protos.google.api.servicemanagement.v1.IRollout | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getServiceRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceRollout with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRolloutRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRolloutRequest', + ['rolloutId'] + ); + request.rolloutId = defaultValue2; + const expectedHeaderRequestParams = `service_name=${defaultValue1}&rollout_id=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getServiceRollout = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getServiceRollout(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getServiceRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceRollout with closed client', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GetServiceRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRolloutRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.GetServiceRolloutRequest', + ['rolloutId'] + ); + request.rolloutId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getServiceRollout(request), expectedError); + }); + }); + + describe('generateConfigReport', () => { + it('invokes generateConfigReport without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GenerateConfigReportRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GenerateConfigReportResponse() + ); + client.innerApiCalls.generateConfigReport = + stubSimpleCall(expectedResponse); + const [response] = await client.generateConfigReport(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes generateConfigReport without error using callback', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GenerateConfigReportRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GenerateConfigReportResponse() + ); + client.innerApiCalls.generateConfigReport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateConfigReport( + request, + ( + err?: Error | null, + result?: protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes generateConfigReport with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GenerateConfigReportRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.generateConfigReport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateConfigReport(request), expectedError); + }); + + it('invokes generateConfigReport with closed client', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.GenerateConfigReportRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateConfigReport(request), expectedError); + }); + }); + + describe('createService', () => { + it('invokes createService without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createService = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createService(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createService without error using callback', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createService = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createService( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createService with call error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createService = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createService(request), expectedError); + }); + + it('invokes createService with LRO error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createService = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createService(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkCreateServiceProgress without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + 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.checkCreateServiceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateServiceProgress with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + 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.checkCreateServiceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteService', () => { + it('invokes deleteService without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.DeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.DeleteServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_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 servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.DeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.DeleteServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_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.api.servicemanagement.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.servicemanagement.v1.IOperationMetadata + >; + 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 servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.DeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.DeleteServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_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 servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.DeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.DeleteServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_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 servicemanagerModule.v1.ServiceManagerClient({ + 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 servicemanagerModule.v1.ServiceManagerClient({ + 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('undeleteService', () => { + it('invokes undeleteService without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.UndeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.UndeleteServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteService = + stubLongRunningCall(expectedResponse); + const [operation] = await client.undeleteService(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteService without error using callback', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.UndeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.UndeleteServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteService = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeleteService( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteService with call error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.UndeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.UndeleteServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteService = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.undeleteService(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeleteService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteService with LRO error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.UndeleteServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.UndeleteServiceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteService = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.undeleteService(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.undeleteService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeleteServiceProgress without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + 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.checkUndeleteServiceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeleteServiceProgress with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + 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.checkUndeleteServiceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('submitConfigSource', () => { + it('invokes submitConfigSource without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.SubmitConfigSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.SubmitConfigSourceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.submitConfigSource = + stubLongRunningCall(expectedResponse); + const [operation] = await client.submitConfigSource(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.submitConfigSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.submitConfigSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitConfigSource without error using callback', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.SubmitConfigSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.SubmitConfigSourceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.submitConfigSource = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.submitConfigSource( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.submitConfigSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.submitConfigSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitConfigSource with call error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.SubmitConfigSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.SubmitConfigSourceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.submitConfigSource = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.submitConfigSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.submitConfigSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.submitConfigSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitConfigSource with LRO error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.SubmitConfigSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.SubmitConfigSourceRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.submitConfigSource = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.submitConfigSource(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.submitConfigSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.submitConfigSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSubmitConfigSourceProgress without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + 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.checkSubmitConfigSourceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSubmitConfigSourceProgress with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + 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.checkSubmitConfigSourceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createServiceRollout', () => { + it('invokes createServiceRollout without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.CreateServiceRolloutRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createServiceRollout = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createServiceRollout(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createServiceRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createServiceRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createServiceRollout without error using callback', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.CreateServiceRolloutRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createServiceRollout = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createServiceRollout( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.api.servicemanagement.v1.IRollout, + protos.google.api.servicemanagement.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.api.servicemanagement.v1.IRollout, + protos.google.api.servicemanagement.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createServiceRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createServiceRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createServiceRollout with call error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.CreateServiceRolloutRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createServiceRollout = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createServiceRollout(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createServiceRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createServiceRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createServiceRollout with LRO error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.CreateServiceRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.CreateServiceRolloutRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createServiceRollout = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createServiceRollout(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createServiceRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createServiceRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateServiceRolloutProgress without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + 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.checkCreateServiceRolloutProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateServiceRolloutProgress with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + 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.checkCreateServiceRolloutProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listServices', () => { + it('invokes listServices without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServicesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + ]; + client.innerApiCalls.listServices = stubSimpleCall(expectedResponse); + const [response] = await client.listServices(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listServices without error using callback', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServicesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + ]; + client.innerApiCalls.listServices = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listServices( + request, + ( + err?: Error | null, + result?: + | protos.google.api.servicemanagement.v1.IManagedService[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listServices with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServicesRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listServices = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listServices(request), expectedError); + }); + + it('invokes listServicesStream without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServicesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + ]; + client.descriptors.page.listServices.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listServicesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.api.servicemanagement.v1.ManagedService[] = + []; + stream.on( + 'data', + (response: protos.google.api.servicemanagement.v1.ManagedService) => { + 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) + ); + }); + + it('invokes listServicesStream with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServicesRequest() + ); + 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.api.servicemanagement.v1.ManagedService[] = + []; + stream.on( + 'data', + (response: protos.google.api.servicemanagement.v1.ManagedService) => { + 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) + ); + }); + + it('uses async iteration with listServices without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServicesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.ManagedService() + ), + ]; + client.descriptors.page.listServices.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.api.servicemanagement.v1.IManagedService[] = + []; + 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 + ); + }); + + it('uses async iteration with listServices with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServicesRequest() + ); + 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.api.servicemanagement.v1.IManagedService[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listServices.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('listServiceConfigs', () => { + it('invokes listServiceConfigs without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceConfigsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.api.Service()), + generateSampleMessage(new protos.google.api.Service()), + generateSampleMessage(new protos.google.api.Service()), + ]; + client.innerApiCalls.listServiceConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listServiceConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listServiceConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServiceConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServiceConfigs without error using callback', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceConfigsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.api.Service()), + generateSampleMessage(new protos.google.api.Service()), + generateSampleMessage(new protos.google.api.Service()), + ]; + client.innerApiCalls.listServiceConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listServiceConfigs( + request, + ( + err?: Error | null, + result?: protos.google.api.IService[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listServiceConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServiceConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServiceConfigs with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceConfigsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listServiceConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listServiceConfigs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listServiceConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServiceConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServiceConfigsStream without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceConfigsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.api.Service()), + generateSampleMessage(new protos.google.api.Service()), + generateSampleMessage(new protos.google.api.Service()), + ]; + client.descriptors.page.listServiceConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listServiceConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.api.Service[] = []; + stream.on('data', (response: protos.google.api.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.listServiceConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listServiceConfigs, request) + ); + assert( + (client.descriptors.page.listServiceConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listServiceConfigsStream with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceConfigsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listServiceConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listServiceConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.api.Service[] = []; + stream.on('data', (response: protos.google.api.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.listServiceConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listServiceConfigs, request) + ); + assert( + (client.descriptors.page.listServiceConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServiceConfigs without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceConfigsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.api.Service()), + generateSampleMessage(new protos.google.api.Service()), + generateSampleMessage(new protos.google.api.Service()), + ]; + client.descriptors.page.listServiceConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.api.IService[] = []; + const iterable = client.listServiceConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listServiceConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listServiceConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServiceConfigs with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceConfigsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listServiceConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listServiceConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.api.IService[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listServiceConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listServiceConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listServiceRollouts', () => { + it('invokes listServiceRollouts without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceRolloutsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + ]; + client.innerApiCalls.listServiceRollouts = + stubSimpleCall(expectedResponse); + const [response] = await client.listServiceRollouts(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listServiceRollouts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServiceRollouts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServiceRollouts without error using callback', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceRolloutsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + ]; + client.innerApiCalls.listServiceRollouts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listServiceRollouts( + request, + ( + err?: Error | null, + result?: protos.google.api.servicemanagement.v1.IRollout[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listServiceRollouts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServiceRollouts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServiceRollouts with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceRolloutsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listServiceRollouts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listServiceRollouts(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listServiceRollouts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServiceRollouts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServiceRolloutsStream without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceRolloutsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + ]; + client.descriptors.page.listServiceRollouts.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listServiceRolloutsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.api.servicemanagement.v1.Rollout[] = []; + stream.on( + 'data', + (response: protos.google.api.servicemanagement.v1.Rollout) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listServiceRollouts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listServiceRollouts, request) + ); + assert( + (client.descriptors.page.listServiceRollouts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listServiceRolloutsStream with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceRolloutsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listServiceRollouts.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listServiceRolloutsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.api.servicemanagement.v1.Rollout[] = []; + stream.on( + 'data', + (response: protos.google.api.servicemanagement.v1.Rollout) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listServiceRollouts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listServiceRollouts, request) + ); + assert( + (client.descriptors.page.listServiceRollouts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServiceRollouts without error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceRolloutsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + generateSampleMessage( + new protos.google.api.servicemanagement.v1.Rollout() + ), + ]; + client.descriptors.page.listServiceRollouts.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.api.servicemanagement.v1.IRollout[] = []; + const iterable = client.listServiceRolloutsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listServiceRollouts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listServiceRollouts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServiceRollouts with error', async () => { + const client = new servicemanagerModule.v1.ServiceManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.servicemanagement.v1.ListServiceRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.servicemanagement.v1.ListServiceRolloutsRequest', + ['serviceName'] + ); + request.serviceName = defaultValue1; + const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listServiceRollouts.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listServiceRolloutsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.api.servicemanagement.v1.IRollout[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listServiceRollouts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listServiceRollouts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); +}); diff --git a/packages/google-api-servicemanagement/tsconfig.json b/packages/google-api-servicemanagement/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-api-servicemanagement/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-api-servicemanagement/webpack.config.js b/packages/google-api-servicemanagement/webpack.config.js new file mode 100644 index 00000000000..3f75927a086 --- /dev/null +++ b/packages/google-api-servicemanagement/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: 'ServiceManager', + filename: './service-manager.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', +};